X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Frename%2FRename.lhs;h=f2f86144876eb683fcce09198a5962dead493231;hb=77a8c0dbd5c5ad90fe483cb9ddc2b6ef36d3f4d8;hp=e6229017d36477eb556124f28bd95913f65e0a47;hpb=8d873902b0ba7e267089f9e1faf690368670fe62;p=ghc-hetmet.git diff --git a/ghc/compiler/rename/Rename.lhs b/ghc/compiler/rename/Rename.lhs index e622901..f2f8614 100644 --- a/ghc/compiler/rename/Rename.lhs +++ b/ghc/compiler/rename/Rename.lhs @@ -39,7 +39,8 @@ import Name ( Name, isLocallyDefined, NamedThing(..), getSrcLoc, nameOccName, nameUnique, nameModule, maybeUserImportedFrom, isUserImportedExplicitlyName, isUserImportedName, maybeWiredInTyConName, maybeWiredInIdName, - isUserExportedName, toRdrName + isUserExportedName, toRdrName, + nameEnvElts, extendNameEnv ) import OccName ( occNameFlavour, isValOcc ) import Id ( idType ) @@ -489,7 +490,7 @@ getGates source_fvs (SigD (IfaceSig _ ty _ _)) getGates source_fvs (TyClD (ClassDecl ctxt cls tvs _ sigs _ _ _ _ _ _ _)) = (delListFromNameSet (foldr (plusFV . get) (extractHsCtxtTyNames ctxt) sigs) - (map getTyVarName tvs) + (hsTyVarNames tvs) `addOneToNameSet` cls) `plusFV` maybe_double where @@ -509,12 +510,12 @@ getGates source_fvs (TyClD (ClassDecl ctxt cls tvs _ sigs _ _ _ _ _ _ _)) getGates source_fvs (TyClD (TySynonym tycon tvs ty _)) = delListFromNameSet (extractHsTyNames ty) - (map getTyVarName tvs) + (hsTyVarNames tvs) -- A type synonym type constructor isn't a "gate" for instance decls getGates source_fvs (TyClD (TyData _ ctxt tycon tvs cons _ _ _ _)) = delListFromNameSet (foldr (plusFV . get) (extractHsCtxtTyNames ctxt) cons) - (map getTyVarName tvs) + (hsTyVarNames tvs) `addOneToNameSet` tycon where get (ConDecl n _ tvs ctxt details _) @@ -522,7 +523,7 @@ getGates source_fvs (TyClD (TyData _ ctxt tycon tvs cons _ _ _ _)) -- If the constructor is method, get fvs from all its fields = delListFromNameSet (get_details details `plusFV` extractHsCtxtTyNames ctxt) - (map getTyVarName tvs) + (hsTyVarNames tvs) get (ConDecl n _ tvs ctxt (RecCon fields) _) -- Even if the constructor isn't mentioned, the fields -- might be, as selectors. They can't mention existentially @@ -540,9 +541,7 @@ getGates source_fvs (TyClD (TyData _ ctxt tycon tvs cons _ _ _ _)) get_field (fs,t) | any (`elemNameSet` source_fvs) fs = get_bang t | otherwise = emptyFVs - get_bang (Banged t) = extractHsTyNames t - get_bang (Unbanged t) = extractHsTyNames t - get_bang (Unpacked t) = extractHsTyNames t + get_bang bty = extractHsTyNames (getBangType bty) getGates source_fvs other_decl = emptyFVs \end{code} @@ -612,7 +611,7 @@ fixitiesFromLocalDecls gbl_env decls Just (FixitySig _ _ loc') -> addErrRn (dupFixityDecl rdr_name loc loc') `thenRn_` returnRn acc ; - Nothing -> returnRn (addToNameEnv acc name (FixitySig name fixity loc)) + Nothing -> returnRn (extendNameEnv acc name (FixitySig name fixity loc)) }} \end{code}