From: Simon Marlow Date: Mon, 21 Jun 2010 12:55:35 +0000 (+0000) Subject: fix the home_imps filter to allow for 'import "this" ' X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=436a5fdbe0c9a466569abf1d501a6018aaa3e49e;p=ghc-hetmet.git fix the home_imps filter to allow for 'import "this" ' In the PackageImports extension, import "this" means "import from the current package". --- diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs index e5cfffe..99362cd 100644 --- a/compiler/main/GHC.hs +++ b/compiler/main/GHC.hs @@ -2016,7 +2016,10 @@ msDeps s = ++ [ (m,False) | m <- ms_home_imps s ] home_imps :: [Located (ImportDecl RdrName)] -> [Located ModuleName] -home_imps imps = [ ideclName i | L _ i <- imps, isNothing (ideclPkgQual i) ] +home_imps imps = [ ideclName i | L _ i <- imps, isLocal (ideclPkgQual i) ] + where isLocal Nothing = True + isLocal (Just pkg) | pkg == fsLit "this" = True -- "this" is special + isLocal _ = False ms_home_allimps :: ModSummary -> [ModuleName] ms_home_allimps ms = map unLoc (ms_home_srcimps ms ++ ms_home_imps ms)