Only look up whether a module's SOURCE-imported if it's in the current package
[ghc-hetmet.git] / compiler / iface / LoadIface.lhs
index 27f6cdd..1a3c0cb 100644 (file)
@@ -28,7 +28,6 @@ import HscTypes
 
 import BasicTypes hiding (SuccessFlag(..))
 import TcRnMonad
-import Type
 
 import PrelNames
 import PrelInfo
@@ -39,9 +38,7 @@ import InstEnv
 import FamInstEnv
 import Name
 import NameEnv
-import MkId
 import Module
-import OccName
 import Maybes
 import ErrUtils
 import Finder
@@ -55,8 +52,6 @@ import FastString
 import Fingerprint
 
 import Control.Monad
-import Data.List
-import Data.Maybe
 \end{code}
 
 
@@ -131,7 +126,7 @@ loadInterfaceForName doc name
 loadWiredInHomeIface :: Name -> IfM lcl ()
 loadWiredInHomeIface name
   = ASSERT( isWiredInName name )
-    do loadSysInterface doc (nameModule name); return ()
+    do _ <- loadSysInterface doc (nameModule name); return ()
   where
     doc = ptext (sLit "Need home interface for wired-in thing") <+> ppr name
 
@@ -196,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