diff options
Diffstat (limited to 'compiler/main')
-rw-r--r-- | compiler/main/DynamicLoading.hs | 2 | ||||
-rw-r--r-- | compiler/main/HscTypes.hs | 26 | ||||
-rw-r--r-- | compiler/main/InteractiveEval.hs | 2 |
3 files changed, 17 insertions, 13 deletions
diff --git a/compiler/main/DynamicLoading.hs b/compiler/main/DynamicLoading.hs index 82081bf1a3..37e272e70e 100644 --- a/compiler/main/DynamicLoading.hs +++ b/compiler/main/DynamicLoading.hs @@ -213,7 +213,7 @@ lookupRdrNameInModuleForPlugins hsc_env mod_name rdr_name = do -- Try and find the required name in the exports let decl_spec = ImpDeclSpec { is_mod = mod_name, is_as = mod_name , is_qual = False, is_dloc = noSrcSpan } - provenance = Imported [ImpSpec decl_spec ImpAll] + provenance mw = Imported [ImpSpec decl_spec ImpAll mw] env = mkGlobalRdrEnv (gresFromAvails provenance (mi_exports iface)) case lookupGRE_RdrName rdr_name env of [gre] -> return (Just (gre_name gre)) diff --git a/compiler/main/HscTypes.hs b/compiler/main/HscTypes.hs index 3b28635028..82c5b2296a 100644 --- a/compiler/main/HscTypes.hs +++ b/compiler/main/HscTypes.hs @@ -1752,17 +1752,21 @@ tyThingsTyVars tts = -- | The Names that a TyThing should bring into scope. Used to build -- the GlobalRdrEnv for the InteractiveContext. tyThingAvailInfo :: TyThing -> AvailInfo -tyThingAvailInfo (ATyCon t) - = case tyConClass_maybe t of - Just c -> AvailTC n (n : map getName (classMethods c) - ++ map getName (classATs c)) - where n = getName c - Nothing -> AvailTC n (n : map getName dcs ++ - concatMap dataConFieldLabels dcs) - where n = getName t - dcs = tyConDataCons t -tyThingAvailInfo t - = Avail (getName t) +tyThingAvailInfo t = case t of + ATyCon t -> + let (n, ns) = case tyConClass_maybe t of + Just c -> (n, n : map getName (classMethods c) + ++ map getName (classATs c)) + where n = getName c + + Nothing -> (n, n : map getName dcs ++ + concatMap dataConFieldLabels dcs) + where n = getName t + dcs = tyConDataCons t + in AvailTC (mkNameWarn n) (map mkNameWarn ns) + _ -> Avail (mkNameWarn $ getName t) + where + mkNameWarn name = NameWarn name Nothing {- ************************************************************************ diff --git a/compiler/main/InteractiveEval.hs b/compiler/main/InteractiveEval.hs index 70c61f2215..f921f26d8b 100644 --- a/compiler/main/InteractiveEval.hs +++ b/compiler/main/InteractiveEval.hs @@ -855,7 +855,7 @@ availsToGlobalRdrEnv mod_name avails where -- We're building a GlobalRdrEnv as if the user imported -- all the specified modules into the global interactive module - imp_prov = Imported [ImpSpec { is_decl = decl, is_item = ImpAll}] + imp_prov mw = Imported [ImpSpec { is_decl = decl, is_item = ImpAll, is_warning = mw }] decl = ImpDeclSpec { is_mod = mod_name, is_as = mod_name, is_qual = False, is_dloc = srcLocSpan interactiveSrcLoc } |