diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2016-07-04 18:34:12 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2016-07-05 13:54:55 +0100 |
commit | 1267048e1785eb4f05834ec56e30107cda4828bd (patch) | |
tree | 3b1bc66cbd280967458aa84363378b7339f2c0a6 | |
parent | 85aa6ef09346e841abf4e089b24c7f783286cd74 (diff) | |
download | haskell-1267048e1785eb4f05834ec56e30107cda4828bd.tar.gz |
Extra ASSERTs for nameModule
-rw-r--r-- | compiler/basicTypes/RdrName.hs | 2 | ||||
-rw-r--r-- | compiler/main/HscTypes.hs | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/compiler/basicTypes/RdrName.hs b/compiler/basicTypes/RdrName.hs index 592ee92034..d6a8aa6d08 100644 --- a/compiler/basicTypes/RdrName.hs +++ b/compiler/basicTypes/RdrName.hs @@ -1142,7 +1142,7 @@ ppr_defn_site imp_spec name 2 (pprLoc loc) where loc = nameSrcSpan name - defining_mod = nameModule name + defining_mod = ASSERT2( isExternalName name, ppr name ) nameModule name same_module = importSpecModule imp_spec == moduleName defining_mod pp_mod | same_module = empty | otherwise = text "in" <+> quotes (ppr defining_mod) diff --git a/compiler/main/HscTypes.hs b/compiler/main/HscTypes.hs index a3352f4f33..b71e8ae6e6 100644 --- a/compiler/main/HscTypes.hs +++ b/compiler/main/HscTypes.hs @@ -1650,7 +1650,8 @@ mkPrintUnqualified dflags env = QueryQualify qual_name -- Eg f = True; g = 0; f = False where is_name :: Name -> Bool - is_name name = nameModule name == mod && nameOccName name == occ + is_name name = ASSERT2( isExternalName name, ppr name ) + nameModule name == mod && nameOccName name == occ forceUnqualNames :: [Name] forceUnqualNames = |