From: Ian Lynagh Date: Thu, 13 Aug 2009 16:24:35 +0000 (+0000) Subject: Only look up whether a module's SOURCE-imported if it's in the current package X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=0e3d5132699d278ffd1aad10db16fe0c8495cfbd 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. --- diff --git a/compiler/iface/LoadIface.lhs b/compiler/iface/LoadIface.lhs index 1412b00..1a3c0cb 100644 --- a/compiler/iface/LoadIface.lhs +++ b/compiler/iface/LoadIface.lhs @@ -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