From: simonpj Date: Fri, 7 May 2004 14:06:45 +0000 (+0000) Subject: [project @ 2004-05-07 14:06:45 by simonpj] X-Git-Tag: Initial_conversion_from_CVS_complete~1853 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=250be0a30ad58f81b727061d0a390a8168b29bdf;p=ghc-hetmet.git [project @ 2004-05-07 14:06:45 by simonpj] --------------------------------- Make sure that GHCi loads all necessary orphan-instance modules --------------------------------- When you do :m A, we need to load any orphan-instance modules below A. That's easily done, but had been forgotten. Do not merge to stable: the fix is different there --- diff --git a/ghc/compiler/typecheck/TcRnDriver.lhs b/ghc/compiler/typecheck/TcRnDriver.lhs index 0e4a93b..eddc460 100644 --- a/ghc/compiler/typecheck/TcRnDriver.lhs +++ b/ghc/compiler/typecheck/TcRnDriver.lhs @@ -62,7 +62,7 @@ import TyCon ( tyConHasGenerics ) import SrcLoc ( srcLocSpan, Located(..), noLoc ) import Outputable import HscTypes ( ModGuts(..), HscEnv(..), - GhciMode(..), noDependencies, + GhciMode(..), Dependencies(..), noDependencies, Deprecs( NoDeprecs ), plusDeprecs, ForeignStubs(NoStubs), TypeEnv, extendTypeEnvWithIds, typeEnvIds, typeEnvTyCons, @@ -847,6 +847,9 @@ mkExportEnv hsc_env exports getModuleExports :: ModuleName -> TcM GlobalRdrEnv getModuleExports mod = do { iface <- load_iface mod + ; loadOrphanModules (dep_orphs (mi_deps iface)) + -- Load any orphan-module interfaces, + -- so their instances are visible ; avails <- exportsToAvails (mi_exports iface) ; let { gres = [ GRE { gre_name = name, gre_prov = vanillaProv mod } | avail <- avails, name <- availNames avail ] }