[project @ 2004-12-17 17:43:24 by simonpj]
authorsimonpj <unknown>
Fri, 17 Dec 2004 17:43:24 +0000 (17:43 +0000)
committersimonpj <unknown>
Fri, 17 Dec 2004 17:43:24 +0000 (17:43 +0000)
Restore a test; fixes rnfail042

ghc/compiler/rename/RnEnv.lhs

index dac2df7..9b0374d 100644 (file)
@@ -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)