[project @ 2002-02-07 12:51:34 by simonpj]
----------------------------------------------------
Make TcType.match and TcUnify.uUnboundVar kind-aware
----------------------------------------------------
George Russel had apparently-overlapping (ha) instance decls like
instance .. => C (a b) where
instance .. => C (x y) where
But the a,b and x,y were different kinds! Turned out that TcType.unify
was kind-aware (so we didn't report a duplicate instance decl, but TcType.match
was not (so we simply selected the wrong one, and got a mis-kinded constraint
popping up from the ".." part. Very exciting to track down.
I also make the ordinary unification kind-aware in the same way. It's
quite legitimate to attempt to unify, say,
(a b) with (c d)
but the unification should fail if a's kind differs from c's.
(There was a kind of debug warning before, but it's actually not an error
in the compiler... so it should just make unification fail gracefully.)