Commit 250be0a3 authored by simonpj's avatar simonpj
Browse files

[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
parent cd837518
......@@ -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 ] }
......
Supports Markdown
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