Fail fast in solveLocalEqualities

Authored by simonpj on Feb 14 2019, 2:28 AM.

Description

Fail fast in solveLocalEqualities

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.

Details

Committed
simonpjFeb 14 2019, 2:40 AM
Parents
rGHC682783828275: Make a smart mkAppTyM
Branches
Unknown
Tags
Unknown