Commit 0e3d5132 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Only look up whether a module's SOURCE-imported if it's in the current package

Suppose we import anotherPackage:M, which exports things from
anotherPackage:Internal. Then GHC will want to read
anotherPackage:Internal.hi.

However, if we have also SOURCE-imported thisPackage:Internal then
we don't want GHC to try to read anotherPackage:Internal.hi-boot
instead.

The mapping that tells us whether a module is SOURCE-imported uses just
the module name for the key, so we have to check the package ID before
looking it up.

Fixes #3007.
parent 2d1262b6
......@@ -191,9 +191,11 @@ loadInterface doc_str mod from
-- if an earlier import had a before we got to real imports. I think.
_ -> do {
let { hi_boot_file = case from of
ImportByUser usr_boot -> usr_boot
ImportBySystem -> sys_boot
let { hi_boot_file = if thisPackage dflags == modulePackageId mod
then case from of
ImportByUser usr_boot -> usr_boot
ImportBySystem -> sys_boot
else False
; mb_dep = lookupUFM (eps_is_boot eps) (moduleName mod)
; sys_boot = case mb_dep of
......
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