From 436a5fdbe0c9a466569abf1d501a6018aaa3e49e Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Mon, 21 Jun 2010 12:55:35 +0000 Subject: [PATCH] fix the home_imps filter to allow for 'import "this" ' In the PackageImports extension, import "this" means "import from the current package". --- compiler/main/GHC.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) -- 1.7.10.4