[project @ 2001-08-21 13:21:39 by simonpj]
-----------------------
Fix a tyvar scoping bug
-----------------------
This program:
data T = forall a. T a (a->Int)
f :: T -> T
f (T (x::a) f) = T (undefined::a) f
gave the error
Inferred type is less polymorphic than expected
Quantified type variable `a' is unified with another quantified type variable `a'
When checking a pattern that binds f :: a -> Int
In the definition of `f': f (T (x :: a) f) = T (undefined :: a) f
This is of course bogus. The fix is in TcMatches.tcMatchPats, where the
in-scope tyvars should be un-extended before calling tcCheckExistentialPat.