Skip to content
  • Simon Peyton Jones's avatar
    Fail fast in solveLocalEqualities · ce6a492b
    Simon Peyton Jones authored
    This patch makes us fail fast in TcSimplify.solveLocalEqualities,
    and in TcHsType.tc_hs_sig_type, if there are insoluble constraints.
    
    Previously we ploughed on even if there were insoluble constraints,
    leading to a cascade of hard-to-understand type errors. Failing
    eagerly is much better; hence a lot of testsuite error message
    changes.  Eg if we have
              f :: [Maybe] -> blah
              f xs = e
    then trying typecheck 'f x = e' with an utterly bogus type
    is just asking for trouble.
    
    I can't quite remember what provoked me to make this change,
    but I think the error messages are notably improved, by
    removing confusing clutter and focusing on the real error.
    
    (cherry picked from commit 5c1f268e)
    ce6a492b