diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2021-02-15 22:36:16 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-03-01 17:30:21 -0500 |
commit | 7730713b747e66c93b4fe45478981a6e2ebfc7e2 (patch) | |
tree | 64301948eb33d227cfc01aa57be2fdda60a2c13c /testsuite/tests/typecheck/should_fail/T1899.stderr | |
parent | 8c425bd83b3d622cd055ad015daca3539a6670de (diff) | |
download | haskell-7730713b747e66c93b4fe45478981a6e2ebfc7e2.tar.gz |
Unify result type earlier to improve error messages
Ticket #19364 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
This change generally improves error messages, but it made one worse:
typecheck/should_fail/T16204c. That led me to the realisation that
a good error can be replaced by a less-good one, which provoked
me to change GHC.Tc.Solver.Interact.inertsCanDischarge. It's
explained in the new Note [Combining equalities]
One other refactoring: I discovered that KindEqOrigin didn't need a
Maybe in its type -- a nice simplification.
Diffstat (limited to 'testsuite/tests/typecheck/should_fail/T1899.stderr')
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T1899.stderr | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T1899.stderr b/testsuite/tests/typecheck/should_fail/T1899.stderr index bd4aceed9e..ceb5f69c66 100644 --- a/testsuite/tests/typecheck/should_fail/T1899.stderr +++ b/testsuite/tests/typecheck/should_fail/T1899.stderr @@ -1,15 +1,15 @@ -T1899.hs:15:36: error: - • Couldn't match type ‘a’ with ‘Proposition a0’ - Expected: [Proposition a0] - Actual: [a] +T1899.hs:15:26: error: + • Couldn't match expected type ‘a’ + with actual type ‘Proposition a0’ ‘a’ is a rigid type variable bound by the type signature for: transRHS :: forall a. [a] -> Int -> Constraint a at T1899.hs:9:2-39 - • In the first argument of ‘Auxiliary’, namely ‘varSet’ - In the first argument of ‘Prop’, namely ‘(Auxiliary varSet)’ + • In the first argument of ‘Prop’, namely ‘(Auxiliary varSet)’ In the expression: Prop (Auxiliary varSet) + In the expression: + [Prop (Auxiliary varSet), Prop (Auxiliary varSet)] • Relevant bindings include varSet :: [a] (bound at T1899.hs:10:11) transRHS :: [a] -> Int -> Constraint a (bound at T1899.hs:10:2) |