diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2021-02-15 22:36:16 +0000 |
---|---|---|
committer | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2021-02-28 14:57:14 +0100 |
commit | b5c68d3430da5ab30972a4b9ee52199c6f5f2461 (patch) | |
tree | f2969a180d9ede160af6a94455a231c094fcdfa9 /testsuite/tests/ghci.debugger/scripts/T14628.stderr | |
parent | 035d983dfa217bf8784b86e78d6024a3ca1a3f4f (diff) | |
download | haskell-wip/T19364.tar.gz |
Unify result type earlier to improve error messageswip/T19364
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/ghci.debugger/scripts/T14628.stderr')
-rw-r--r-- | testsuite/tests/ghci.debugger/scripts/T14628.stderr | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/testsuite/tests/ghci.debugger/scripts/T14628.stderr b/testsuite/tests/ghci.debugger/scripts/T14628.stderr index fbce771874..0eb90fde1f 100644 --- a/testsuite/tests/ghci.debugger/scripts/T14628.stderr +++ b/testsuite/tests/ghci.debugger/scripts/T14628.stderr @@ -1,9 +1,9 @@ -<interactive>:4:7: error: +<interactive>:4:17: error: • Couldn't match type ‘m’ with ‘(,) a0’ - Expected: (a0, ((), Int)) - Actual: m ((), Int) + Expected: StateT Int ((,) a0) () + Actual: StateT Int m () ‘m’ is an interactive-debugger skolem - • In the second argument of ‘($)’, namely ‘runStateT _result 0’ + • In the first argument of ‘runStateT’, namely ‘_result’ + In the second argument of ‘($)’, namely ‘runStateT _result 0’ In the expression: snd $ runStateT _result 0 - In an equation for ‘it’: it = snd $ runStateT _result 0 |