summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2011-12-23 17:25:36 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2011-12-23 17:25:36 +0000
commitbffff2ef177018174737b0f6d61e1082283293f8 (patch)
tree9846898de5e3c12fea9b5e7bc90b32cb163919c2 /compiler
parent89c0f09ac144a6b0cd20adbf73b196cc99e90a8f (diff)
downloadhaskell-bffff2ef177018174737b0f6d61e1082283293f8.tar.gz
Add an ASSERT on 'pick'
Diffstat (limited to 'compiler')
-rw-r--r--compiler/basicTypes/RdrName.lhs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/basicTypes/RdrName.lhs b/compiler/basicTypes/RdrName.lhs
index d7f4ced721..de0ff56222 100644
--- a/compiler/basicTypes/RdrName.lhs
+++ b/compiler/basicTypes/RdrName.lhs
@@ -506,6 +506,7 @@ pickGREs :: RdrName -> [GlobalRdrElt] -> [GlobalRdrElt]
-- ^ Take a list of GREs which have the right OccName
-- Pick those GREs that are suitable for this RdrName
-- And for those, keep only only the Provenances that are suitable
+-- Only used for Qual and Unqual, not Orig or Exact
--
-- Consider:
--
@@ -522,7 +523,8 @@ pickGREs :: RdrName -> [GlobalRdrElt] -> [GlobalRdrElt]
-- the locally-defined @f@, and a GRE for the imported @f@, with a /single/
-- provenance, namely the one for @Baz(f)@.
pickGREs rdr_name gres
- = mapCatMaybes pick gres
+ = ASSERT2( isSrcRdrName rdr_name, ppr rdr_name )
+ mapCatMaybes pick gres
where
rdr_is_unqual = isUnqual rdr_name
rdr_is_qual = isQual_maybe rdr_name