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.
-- 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