X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Frename%2FRnNames.lhs;h=6781ee7cacb0554ac2f52c7df2f10dc1828875ad;hb=bb88e732b7383c10496c0f60c3bdea2c22362cc6;hp=1c18fefd17e1e381c316c86c44c0cef2592a3562;hpb=4e3255388e8b99ccdae290bfcb6cd666b8c93d4a;p=ghc-hetmet.git diff --git a/ghc/compiler/rename/RnNames.lhs b/ghc/compiler/rename/RnNames.lhs index 1c18fef..6781ee7 100644 --- a/ghc/compiler/rename/RnNames.lhs +++ b/ghc/compiler/rename/RnNames.lhs @@ -23,14 +23,15 @@ import LoadIface ( loadSrcInterface ) import TcRnMonad import FiniteMap -import PrelNames ( pRELUDE_Name, isBuiltInSyntaxName, isUnboundName, +import PrelNames ( pRELUDE_Name, isUnboundName, main_RDR_Unqual ) import Module ( Module, ModuleName, moduleName, mkPackageModule, moduleNameUserString, isHomeModule, unitModuleEnvByName, unitModuleEnv, lookupModuleEnvByName, moduleEnvElts ) import Name ( Name, nameSrcLoc, nameOccName, nameModuleName, isWiredInName, - nameParent, nameParent_maybe, isExternalName, nameModule ) + nameParent, nameParent_maybe, isExternalName, nameModule, + isBuiltInSyntax ) import NameSet import NameEnv import OccName ( srcDataName, isTcOcc, occNameFlavour, OccEnv, @@ -53,7 +54,7 @@ import SrcLoc ( noSrcLoc, Located(..), mkGeneralSrcSpan, unLoc, noLoc, srcLocSpan, SrcSpan ) import BasicTypes ( DeprecTxt ) import ListSetOps ( removeDups ) -import Util ( sortLt, notNull, isSingleton ) +import Util ( sortLe, notNull, isSingleton ) import List ( partition ) import IO ( openFile, IOMode(..) ) \end{code} @@ -336,10 +337,10 @@ importsFromLocalDecls group avails' | implicit_prelude = filter not_built_in_syntax avails | otherwise = avails - not_built_in_syntax a = not (all isBuiltInSyntaxName (availNames a)) + not_built_in_syntax a = not (all isBuiltInSyntax (availNames a)) -- Only filter it if all the names of the avail are built-in -- In particular, lists have (:) which is not built in syntax - -- so we don't filter it out. [Sept 03: wrong: see isBuiltInSyntaxName] + -- so we don't filter it out. [Sept 03: wrong: see isBuiltInSyntax] avail_env = mkAvailEnv avails' imports = emptyImportAvails { @@ -1010,8 +1011,11 @@ addDupDeclErr (n:ns) nest 2 (ptext SLIT("other declarations at:")), nest 4 (vcat (map ppr sorted_locs))] where - sorted_locs = sortLt occ'ed_before (map nameSrcLoc ns) - occ'ed_before a b = LT == compare a b + sorted_locs = sortLe occ'ed_before (map nameSrcLoc ns) + occ'ed_before a b = case compare a b of + LT -> True + EQ -> True + GT -> False dupExportWarn occ_name ie1 ie2 = hsep [quotes (ppr occ_name),