X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Frename%2FRnNames.lhs;h=508c22467675c89cfec38f30a724b031df908595;hb=e34cff9c046f4b5661d555603833dd2f85ac4e6d;hp=e5ce969ea4d891d1bb4b9c4813364175dd62b264;hpb=c91cb5aed3054f0bba98d9d35dd07f7c1ad0ffff;p=ghc-hetmet.git diff --git a/ghc/compiler/rename/RnNames.lhs b/ghc/compiler/rename/RnNames.lhs index e5ce969..508c224 100644 --- a/ghc/compiler/rename/RnNames.lhs +++ b/ghc/compiler/rename/RnNames.lhs @@ -307,6 +307,11 @@ filterImports mod from (Just (want_hiding, import_items)) total_avails returnRn [] get_item :: RdrNameIE -> RnMG [(AvailInfo, [Name])] + -- Empty list for a bad item. + -- Singleton is typical case. + -- Can have two when we are hiding, and mention C which might be + -- both a class and a data constructor. + -- The [Name] is the list of explicitly-mentioned names get_item item@(IEModuleContents _) = bale_out item get_item item@(IEThingAll _) @@ -391,7 +396,12 @@ mkExportAvails mod_name unqual_imp gbl_env avails unqual_avails | not unqual_imp = [] -- Short cut when no unqualified imports | otherwise = pruneAvails (unQualInScope gbl_env) avails - entity_avail_env = mkNameEnv [(availName avail, avail) | avail <- avails] + entity_avail_env = foldl insert emptyAvailEnv avails + insert env avail = extendNameEnv_C plusAvail env (availName avail) avail + -- 'avails' may have several items with the same availName + -- E.g import Ix( Ix(..), index ) + -- will give Ix(Ix,index,range) and Ix(index) + -- We want to combine these \end{code}