Improve error messages for skolems
In error messages like this • Couldn't match type ‘c’ with ‘f0 (a -> b)’ ‘c’ is a rigid type variable bound by the type signature for: f :: ((a -> b) -> b) -> forall c. c -> a we need to take case both to actually show that 'forall c', and to make sure that its name lines with the 'c' in the error message. This has been shaky for some time, and this commit puts it on solid ground. See TcRnTypes: Note [SigSkol SkolemInfo] The main changes are * SigSkol gets an extra field that records the way in which the type signature was skolemised. * The type in SigSkol is now the /un/-skolemised version * pprSkolemInfo uses the info to make the tidy type line up nicely Lots of error message wibbles!
Showing
- compiler/typecheck/Inst.hs 29 additions, 23 deletionscompiler/typecheck/Inst.hs
- compiler/typecheck/TcBinds.hs 2 additions, 2 deletionscompiler/typecheck/TcBinds.hs
- compiler/typecheck/TcErrors.hs 8 additions, 11 deletionscompiler/typecheck/TcErrors.hs
- compiler/typecheck/TcExpr.hs 2 additions, 2 deletionscompiler/typecheck/TcExpr.hs
- compiler/typecheck/TcMType.hs 42 additions, 16 deletionscompiler/typecheck/TcMType.hs
- compiler/typecheck/TcRnDriver.hs 1 addition, 1 deletioncompiler/typecheck/TcRnDriver.hs
- compiler/typecheck/TcRnTypes.hs 38 additions, 7 deletionscompiler/typecheck/TcRnTypes.hs
- compiler/typecheck/TcSimplify.hs 1 addition, 1 deletioncompiler/typecheck/TcSimplify.hs
- compiler/typecheck/TcUnify.hs 7 additions, 10 deletionscompiler/typecheck/TcUnify.hs
- compiler/types/TyCoRep.hs 2 additions, 1 deletioncompiler/types/TyCoRep.hs
- testsuite/tests/ado/ado005.stderr 23 additions, 19 deletionstestsuite/tests/ado/ado005.stderr
- testsuite/tests/backpack/should_fail/bkpfail24.stderr 1 addition, 1 deletiontestsuite/tests/backpack/should_fail/bkpfail24.stderr
- testsuite/tests/backpack/should_fail/bkpfail44.stderr 1 addition, 1 deletiontestsuite/tests/backpack/should_fail/bkpfail44.stderr
- testsuite/tests/deriving/should_fail/T5287.stderr 1 addition, 1 deletiontestsuite/tests/deriving/should_fail/T5287.stderr
- testsuite/tests/indexed-types/should_compile/PushedInAsGivens.stderr 1 addition, 1 deletion...ests/indexed-types/should_compile/PushedInAsGivens.stderr
- testsuite/tests/indexed-types/should_compile/T3208b.stderr 3 additions, 1 deletiontestsuite/tests/indexed-types/should_compile/T3208b.stderr
- testsuite/tests/indexed-types/should_fail/T2664.stderr 2 additions, 1 deletiontestsuite/tests/indexed-types/should_fail/T2664.stderr
- testsuite/tests/indexed-types/should_fail/T4093a.stderr 1 addition, 1 deletiontestsuite/tests/indexed-types/should_fail/T4093a.stderr
- testsuite/tests/indexed-types/should_fail/T4093b.stderr 2 additions, 1 deletiontestsuite/tests/indexed-types/should_fail/T4093b.stderr
- testsuite/tests/indexed-types/should_fail/T7194.stderr 1 addition, 1 deletiontestsuite/tests/indexed-types/should_fail/T7194.stderr
Loading
Please register or sign in to comment