[project @ 2003-03-11 09:16:02 by simonpj]
authorsimonpj <unknown>
Tue, 11 Mar 2003 09:16:02 +0000 (09:16 +0000)
committersimonpj <unknown>
Tue, 11 Mar 2003 09:16:02 +0000 (09:16 +0000)
----------------------------------
      Fix a long-standing egregious parser bug
----------------------------------

*** MERGE TO STABLE ***

*** NB: the important part of this commit
*** got committed by accident with an
*** unrelated message.  This commit
*** should be from rev 1.50 to 1.52 of RdrHsSyn

GHC has parsed

data T String = T String

without complaint, ever since day 1!  This led to consequential
incomprehensible messages.  The fix is easy.

ghc/compiler/parser/RdrHsSyn.lhs

index eb9a8a4..cdb59b7 100644 (file)
@@ -519,6 +519,7 @@ checkTyVars :: [RdrNameHsType] -> P [RdrNameHsTyVar]
 checkTyVars tvs 
   = mapP chk tvs
   where
+       --  Check that the name space is correct!
     chk (HsKindSig (HsTyVar tv) k) | isRdrTyVar tv = returnP (IfaceTyVar tv k)
     chk (HsTyVar tv)              | isRdrTyVar tv = returnP (UserTyVar tv)
     chk other                     = parseError "Type found where type variable expected"