Skip to content

Unify result type earlier to improve error messages

Simon Peyton Jones requested to merge wip/T19364 into master

Ticket #19364 (closed) helpfully points out that we do not currently take advantage of pushing the result type of an application into the arguments. This makes error messages notably less good.

The fix is rather easy: move the result-type unification step earlier. It's even a bit more efficient; in the the checking case we now do one less zonk.

See Note [Unify with expected type before typechecking arguments] in GHC.Tc.Gen.App

Merge request reports