----------------------------------
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.
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"