From: simonpj Date: Fri, 17 Dec 2004 17:43:24 +0000 (+0000) Subject: [project @ 2004-12-17 17:43:24 by simonpj] X-Git-Tag: Initial_conversion_from_CVS_complete~1334 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=39721a36d38d97571363a72aaecc43c30f5b2a72;p=ghc-hetmet.git [project @ 2004-12-17 17:43:24 by simonpj] Restore a test; fixes rnfail042 --- diff --git a/ghc/compiler/rename/RnEnv.lhs b/ghc/compiler/rename/RnEnv.lhs index dac2df7..9b0374d 100644 --- a/ghc/compiler/rename/RnEnv.lhs +++ b/ghc/compiler/rename/RnEnv.lhs @@ -79,10 +79,14 @@ newTopSrcBinder this_mod mb_parent (L loc rdr_name) -- the parser reads the special syntax and returns an Exact RdrName -- We are at a binding site for the name, so check first that it -- the current module is the correct one; otherwise GHC can get - -- very confused indeed. + -- very confused indeed. This test rejects code like + -- data T = (,) Int Int + -- unless we are in GHC.Tup ASSERT2( isExternalName name, ppr name ) - ASSERT2( this_mod == nameModule name, ppr name ) - returnM name + do checkErr (this_mod == nameModule name) + (badOrigBinding rdr_name) + returnM name + | isOrig rdr_name = do checkErr (rdr_mod == this_mod || rdr_mod == rOOT_MAIN)