Default the kind of unconstrained meta-type variables before tcSimplifyTop
authorsimonpj@microsoft.com <unknown>
Wed, 1 Nov 2006 17:33:25 +0000 (17:33 +0000)
committersimonpj@microsoft.com <unknown>
Wed, 1 Nov 2006 17:33:25 +0000 (17:33 +0000)
commit335bc125303a226a78b20be8a7b8fec5b6c59d2b
treef76291eb34985657405c61ecf943dad4d364666f
parentd5e78cc70dc29cb59687156486e2acaaa444c029
Default the kind of unconstrained meta-type variables before tcSimplifyTop

This patch fixes a long standing bug, Trac #179,
and a recently reported one, Trac #963.

The problem in both cases was an unconstrained type variable 'a', of kind
argTypeKind (printed "??") or openTypeKind ("?").  At top level we now default
the kind of such variables to liftedTypeKind ("*").  This is important because
then instance declarations can match it. The defaulting function is called
TcMType.zonkTopTyVar, and is commented.  (Most of the extra lines in the
patch are comments!)
compiler/typecheck/TcMType.lhs
compiler/typecheck/TcSimplify.lhs