Fix a bug in subsumption, and tweak error messages
authorsimonpj@microsoft.com <unknown>
Mon, 18 Sep 2006 00:52:23 +0000 (00:52 +0000)
committersimonpj@microsoft.com <unknown>
Mon, 18 Sep 2006 00:52:23 +0000 (00:52 +0000)
commite33c65e18c77b1c21bd3b10a594b6ad61171ecb0
tree36b2c66fe163e796e3235944b0cba16188ea7ea9
parentc5d2d92ce6295d7236c9e8a66a47e741d6f5388b
Fix a bug in subsumption, and tweak error messages

This commit does two largely-unrelated things, but they hit the same code.

First, I tweaked the error messages a bit, to give better errors
for impredicative polymorphism.  This added the mb_fun argument to
tc_sub.

Second, I fixed a long-standing bug in tc_sub.  In the isBoxyTyVar case
of tc_sub (rule F2) I was not recursing to tc_sub as the rule suggests,
but rather calling u_tys.  This is plain wrong, because the first
arugment might have more foralls.

The solution is to recurse to tc_sub, but that in turn requires a parameter,
exp_ib, which says when we are inside a box.

Test is tc210.
compiler/typecheck/TcUnify.lhs