do { -- Deal with imports; sets tcg_rdr_env, tcg_imports
(rdr_env, imports) <- rnImports import_decls ;
updGblEnv ( \ gbl -> gbl { tcg_rdr_env = rdr_env,
- tcg_imports = imports })
+ tcg_imports = tcg_imports gbl `plusImportAvails` imports })
$ do {
traceRn (text "rn1") ;
-- Fail if there are any errors so far
updGblEnv (\gbl -> gbl { tcg_deprecs = tcg_deprecs gbl `plusDeprecs` mod_deprecs })
$ do {
- traceRn (text "rn4") ;
+ traceRn (text "Rn4:" <+> ppr (imp_unqual (tcg_imports tcg_env))) ;
-- Process the export list
export_avails <- exportsFromAvail exports ;
updGblEnv (\gbl -> gbl { tcg_exports = export_avails })
GlobalRdrEnv, LocalRdrEnv, NameCache, FixityEnv,
GhciMode, lookupType, unQualInScope )
import TcRnTypes
-import Module ( Module, foldModuleEnv )
+import Module ( Module, moduleName, foldModuleEnv )
import Name ( Name, isInternalName )
import Type ( Type )
import NameEnv ( extendNameEnvList )
tcg_ist = mkImpTypeEnv eps hpt,
tcg_inst_env = mkImpInstEnv dflags eps hpt,
tcg_exports = [],
- tcg_imports = emptyImportAvails,
+ tcg_imports = init_imports,
tcg_binds = EmptyMonoBinds,
tcg_deprecs = NoDeprecs,
tcg_insts = [],
where
eps = pcs_EPS pcs
+ init_imports = mkImportAvails (moduleName mod) True []
+ -- Initialise tcg_imports with an empty set of bindings for
+ -- this module, so that if we see 'module M' in the export
+ -- list, and there are no bindings in M, we don't bleat
+ -- "unknown module M".
+
+
defaultDefaultTys :: [Type]
defaultDefaultTys = [integerTy, doubleTy]