X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FHscTypes.lhs;h=2c8780ca3df4a71e42d64f7a7df0ae0f08a08901;hb=c94408e522e5af3b79a5beadc7e6d15cee553ee7;hp=a200bf99ca31c01dc883d79d262be71803d7e00f;hpb=61d2625ae2e6a4cdae2ffc92df828905e81c24cc;p=ghc-hetmet.git diff --git a/compiler/main/HscTypes.lhs b/compiler/main/HscTypes.lhs index a200bf9..2c8780c 100644 --- a/compiler/main/HscTypes.lhs +++ b/compiler/main/HscTypes.lhs @@ -83,7 +83,7 @@ import Id ( Id ) import Type ( TyThing(..) ) import Class ( Class, classSelIds, classTyCon ) -import TyCon ( TyCon, tyConSelIds, tyConDataCons ) +import TyCon ( TyCon, tyConSelIds, tyConDataCons, isNewTyCon, newTyConCo ) import DataCon ( dataConImplicitIds ) import PrelNames ( gHC_PRIM ) import Packages ( PackageId ) @@ -323,8 +323,8 @@ data FindResult | ModuleHidden PackageId -- for an explicit source import: the package containing the module is -- exposed, but the module itself is hidden. - | NotFound [FilePath] - -- the module was not found, the specified places were searched. + | NotFound [FilePath] (Maybe PackageId) + -- the module was not found, the specified places were searched | NotFoundInPackage PackageId -- the module was not found in this package @@ -618,13 +618,16 @@ mkPrintUnqualified env = (qual_name, qual_mod) \begin{code} implicitTyThings :: TyThing -> [TyThing] +-- If you change this, make sure you change LoadIface.ifaceDeclSubBndrs in sync + implicitTyThings (AnId id) = [] -- For type constructors, add the data cons (and their extras), -- and the selectors and generic-programming Ids too -- -- Newtypes don't have a worker Id, so don't generate that? -implicitTyThings (ATyCon tc) = map AnId (tyConSelIds tc) ++ +implicitTyThings (ATyCon tc) = implicitNewCoTyCon tc ++ + map AnId (tyConSelIds tc) ++ concatMap (extras_plus . ADataCon) (tyConDataCons tc) -- For classes, add the class TyCon too (and its extras) @@ -636,6 +639,11 @@ implicitTyThings (AClass cl) = map AnId (classSelIds cl) ++ -- For data cons add the worker and wrapper (if any) implicitTyThings (ADataCon dc) = map AnId (dataConImplicitIds dc) + -- For newtypes, add the implicit coercion tycon +implicitNewCoTyCon tc + | isNewTyCon tc, Just co_con <- newTyConCo tc = [ATyCon co_con] + | otherwise = [] + extras_plus thing = thing : implicitTyThings thing extendTypeEnvWithIds :: TypeEnv -> [Id] -> TypeEnv @@ -1064,7 +1072,7 @@ showModMsg target recomp mod_summary _other -> text (msObjFilePath mod_summary), char ')']) where - mod = ms_mod mod_summary + mod = moduleName (ms_mod mod_summary) mod_str = showSDoc (ppr mod) ++ hscSourceString (ms_hsc_src mod_summary) \end{code}