Commit 2183ac16 authored by Eugene Akentyev's avatar Eugene Akentyev Committed by Ben Gamari
Browse files

Fix import error with -XPackageImports when the module has a duplicate name

Reviewers: austin, bgamari, mpickering

Reviewed By: bgamari

Subscribers: mpickering, rwbarton, thomie

GHC Trac Issues: #13168

Differential Revision:
parent 8ec77708
......@@ -1777,14 +1777,19 @@ runTcInteractive hsc_env thing_inside
vcat (map ppr [ local_gres | gres <- occEnvElts (ic_rn_gbl_env icxt)
, let local_gres = filter isLocalGRE gres
, not (null local_gres) ]) ]
; let getOrphans m = fmap (\iface -> mi_module iface
; let getOrphans m mb_pkg = fmap (\iface -> mi_module iface
: dep_orphs (mi_deps iface))
(loadSrcInterface (text "runTcInteractive") m
False Nothing)
False mb_pkg)
; orphs <- fmap concat . forM (ic_imports icxt) $ \i ->
case i of
IIModule n -> getOrphans n
IIDecl i -> getOrphans (unLoc (ideclName i))
IIModule n -> getOrphans n Nothing
IIDecl i ->
let mb_pkg = sl_fs <$> ideclPkgQual i in
getOrphans (unLoc (ideclName i)) mb_pkg
; let imports = emptyImportAvails {
imp_orphs = orphs
[extra_files(['package1', 'package2', 'Setup.hs']), expect_broken(13168)],
extra_files(['package1', 'package2', 'Setup.hs']),
['$MAKE -s --no-print-directory T13168'])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment