Fix pre-subsumption and pre-matching
authorsimonpj@microsoft.com <unknown>
Tue, 8 Aug 2006 09:11:08 +0000 (09:11 +0000)
committersimonpj@microsoft.com <unknown>
Tue, 8 Aug 2006 09:11:08 +0000 (09:11 +0000)
commit3098d2143a5865f8f1fba1d7d72132b140f2de94
tree146affe2ec5de633a55c93b3cf00f028ec012a9e
parentd2b27dcd73c7d3aa21059e2a26ee7923fd7bca0a
Fix pre-subsumption and pre-matching

The pre-subsuption and pre-matching functions should NEVER make bogus
bindings of type variables, although they are free to bale out and make
too few bindings.

I hadn't been thiking carefully enough about this, and there were two
separate bugs.

- Firstly, in pre-subsumption we must ignore the 'theta'
  part of any overloaded type.

- Second, in pre-matching, we must return the empty subustition
  on a mis-match, rather than returning the substitution so far.

This bug showed up when compiling Data.Generics.Schemes.hs, and is
imortalised in test tc206
compiler/typecheck/TcUnify.lhs