summaryrefslogtreecommitdiff
path: root/testsuite/tests/impredicative
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2020-07-16 14:35:42 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-09-24 13:16:32 -0400
commit9fa26aa16f9eee0b56b5d9e65c16367d7b789996 (patch)
treea7b27876018129d93bdb3e91f7b1762e30e37f5b /testsuite/tests/impredicative
parent97cff9190d346c3b51c32c88fd145fcf1e6678f1 (diff)
downloadhaskell-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/impredicative')
-rw-r--r--testsuite/tests/impredicative/boxy.hs10
1 files changed, 8 insertions, 2 deletions
diff --git a/testsuite/tests/impredicative/boxy.hs b/testsuite/tests/impredicative/boxy.hs
index 475b5c1c5e..ec42d38fa5 100644
--- a/testsuite/tests/impredicative/boxy.hs
+++ b/testsuite/tests/impredicative/boxy.hs
@@ -29,6 +29,9 @@ t2 = sing id
t3 :: forall a. a -> a
t3 = head ids
+t4 :: forall b. (forall a. a->a, b->b)
+t4 = (id, id)
+
{--------------- Examples from QMLF paper -------------------}
qF :: (forall a. a -> a -> a) -> (Bool, Char)
@@ -46,8 +49,11 @@ choose x y = x
impred1 :: (Bool, Char)
impred1 = ($) qF choose --- impredicative instantiation for $
-impred2 :: (forall a. a -> a -> a) -> (Bool, Char)
-impred2 = id qF
+impred2 :: (Bool, Char)
+impred2 = qF $ choose --- impredicative instantiation for $
+
+impred3 :: (forall a. a -> a -> a) -> (Bool, Char)
+impred3 = id qF
{------ Examples for Garrique/Remy paper -------}