patch applied (ghc): Fix a bug in subsumption,
and tweak error messages
Simon Peyton Jones
simonpj at microsoft.com
Mon Sep 18 19:19:46 EDT 2006
Sun Sep 17 17:52:23 PDT 2006 simonpj at microsoft.com
* 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
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.
M ./compiler/typecheck/TcUnify.lhs -58 +88
More information about the Cvs-ghc