Skip to content
  • Simon Peyton Jones's avatar
    Fix a bug in subsumption, and tweak error messages · e33c65e1
    Simon Peyton Jones authored
    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.
    e33c65e1