diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2020-07-16 14:35:42 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-09-24 13:16:32 -0400 |
commit | 9fa26aa16f9eee0b56b5d9e65c16367d7b789996 (patch) | |
tree | a7b27876018129d93bdb3e91f7b1762e30e37f5b /testsuite/tests/th | |
parent | 97cff9190d346c3b51c32c88fd145fcf1e6678f1 (diff) | |
download | haskell-9fa26aa16f9eee0b56b5d9e65c16367d7b789996.tar.gz |
Improve kind generalisation, error messages
This patch does two things:
* It refactors GHC.Tc.Errors a bit. In debugging Quick Look I was
forced to look in detail at error messages, and ended up doing a bit
of refactoring, esp in mkTyVarEqErr'. It's still quite a mess, but
a bit better, I think.
* It makes a significant improvement to the kind checking of type and
class declarations. Specifically, we now ensure that if kind
checking fails with an unsolved constraint, all the skolems are in
scope. That wasn't the case before, which led to some obscure error
messages; and occasional failures with "no skolem info" (eg #16245).
Both of these, and the main Quick Look patch itself, affect a /lot/ of
error messages, as you can see from the number of files changed. I've
checked them all; I think they are as good or better than before.
Smaller things
* I documented the various instances of VarBndr better.
See Note [The VarBndr tyep and its uses] in GHC.Types.Var
* Renamed GHC.Tc.Solver.simpl_top to simplifyTopWanteds
* A bit of refactoring in bindExplicitTKTele, to avoid the
footwork with Either. Simpler now.
* Move promoteTyVar from GHC.Tc.Solver to GHC.Tc.Utils.TcMType
Fixes #16245 (comment 211369), memorialised as
typecheck/polykinds/T16245a
Also fixes the three bugs in #18640
Diffstat (limited to 'testsuite/tests/th')
-rw-r--r-- | testsuite/tests/th/T10267.stderr | 6 | ||||
-rw-r--r-- | testsuite/tests/th/T15321.stderr | 3 |
2 files changed, 3 insertions, 6 deletions
diff --git a/testsuite/tests/th/T10267.stderr b/testsuite/tests/th/T10267.stderr index 6262bf72ff..2f5598fa1d 100644 --- a/testsuite/tests/th/T10267.stderr +++ b/testsuite/tests/th/T10267.stderr @@ -5,8 +5,7 @@ T10267.hs:8:1: error: the type signature for: j :: forall a. a -> a at T10267.hs:(8,1)-(12,14) - • In the expression: _ - In an equation for ‘j’: j x = _ + • In an equation for ‘j’: j x = _ • Relevant bindings include x :: a (bound at T10267.hs:8:1) j :: a -> a (bound at T10267.hs:8:1) @@ -19,8 +18,7 @@ T10267.hs:8:1: error: i :: forall a. a -> a at T10267.hs:(8,1)-(12,14) Or perhaps ‘_foo’ is mis-spelled, or not in scope - • In the expression: _foo - In an equation for ‘i’: i = _foo + • In an equation for ‘i’: i = _foo • Relevant bindings include i :: a -> a (bound at T10267.hs:8:1) Valid hole fits include i :: a -> a (bound at T10267.hs:8:1) diff --git a/testsuite/tests/th/T15321.stderr b/testsuite/tests/th/T15321.stderr index 3054f02afc..1de67decef 100644 --- a/testsuite/tests/th/T15321.stderr +++ b/testsuite/tests/th/T15321.stderr @@ -1,8 +1,7 @@ T15321.hs:9:9: error: • Found hole: _ :: String -> Language.Haskell.TH.Lib.Internal.ExpQ - • In the expression: _ - In the expression: _ "baz" + • In the expression: _ "baz" In the untyped splice: $(_ "baz") • Valid hole fits include fail :: forall (m :: * -> *) a. MonadFail m => String -> m a |