[project @ 2001-08-21 13:21:39 by simonpj]
authorsimonpj <unknown>
Tue, 21 Aug 2001 13:21:39 +0000 (13:21 +0000)
committersimonpj <unknown>
Tue, 21 Aug 2001 13:21:39 +0000 (13:21 +0000)
commita8d3e136e9bb989fde0ec655d291d3d2e7036fff
treec1b03c4b37a275c3ae74cae14e0db62fbe281107
parent8eb1577e8ba9df625cb56640c0d68b03da5f062f
[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.
ghc/compiler/typecheck/TcMatches.lhs