Skip to content

Commit

Permalink
fix the home_imps filter to allow for 'import "this" <module>'
Browse files Browse the repository at this point in the history
In the PackageImports extension, import "this" means "import from the
current package".
  • Loading branch information
simonmar committed Jun 21, 2010
1 parent 3679b28 commit 436a5fd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion compiler/main/GHC.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 436a5fd

Please sign in to comment.