From 39721a36d38d97571363a72aaecc43c30f5b2a72 Mon Sep 17 00:00:00 2001 From: simonpj Date: Fri, 17 Dec 2004 17:43:24 +0000 Subject: [PATCH] [project @ 2004-12-17 17:43:24 by simonpj] Restore a test; fixes rnfail042 --- ghc/compiler/rename/RnEnv.lhs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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) -- 1.7.10.4