summaryrefslogtreecommitdiff
path: root/testsuite/tests/patsyn
diff options
context:
space:
mode:
authorTobias Dammers <tdammers@gmail.com>2018-09-13 09:56:02 +0200
committerRichard Eisenberg <rae@cs.brynmawr.edu>2018-10-28 23:17:47 -0400
commit5e45ad10ffca1ad175b10f6ef3327e1ed8ba25f3 (patch)
tree41449e2a558385d2b290d0005fec353e6c9c88dd /testsuite/tests/patsyn
parente8a652f65318cf60e856f7c2777a003eba10ddc6 (diff)
downloadhaskell-5e45ad10ffca1ad175b10f6ef3327e1ed8ba25f3.tar.gz
Finish fix for #14880.
The real change that fixes the ticket is described in Note [Naughty quantification candidates] in TcMType. Fixing this required reworking candidateQTyVarsOfType, the function that extracts free variables as candidates for quantification. One consequence is that we now must be more careful when quantifying: any skolems around must be quantified manually, and quantifyTyVars will now only quantify over metavariables. This makes good sense, as skolems are generally user-written and are listed in the AST. As a bonus, we now have more control over the ordering of such skolems. Along the way, this commit fixes #15711 and refines the fix to #14552 (by accepted a program that was previously rejected, as we can now accept that program by zapping variables to Any). This commit also does a fair amount of rejiggering kind inference of datatypes. Notably, we now can skip the generalization step in kcTyClGroup for types with CUSKs, because we get the kind right the first time. This commit also thus fixes #15743 and #15592, which both concern datatype kind generalisation. (#15591 is also very relevant.) For this aspect of the commit, see Note [Required, Specified, and Inferred in types] in TcTyClsDecls. Test cases: dependent/should_fail/T14880{,-2}, dependent/should_fail/T15743[cd] dependent/should_compile/T15743{,e} ghci/scripts/T15743b polykinds/T15592 dependent/should_fail/T15591[bc] ghci/scripts/T15591
Diffstat (limited to 'testsuite/tests/patsyn')
-rw-r--r--testsuite/tests/patsyn/should_compile/T14394.stdout2
-rw-r--r--testsuite/tests/patsyn/should_compile/T14552.hs (renamed from testsuite/tests/patsyn/should_fail/T14552.hs)0
-rw-r--r--testsuite/tests/patsyn/should_compile/all.T1
-rw-r--r--testsuite/tests/patsyn/should_fail/T14552.stderr9
-rw-r--r--testsuite/tests/patsyn/should_fail/all.T1
5 files changed, 2 insertions, 11 deletions
diff --git a/testsuite/tests/patsyn/should_compile/T14394.stdout b/testsuite/tests/patsyn/should_compile/T14394.stdout
index 557b8f4a74..f59f62cb78 100644
--- a/testsuite/tests/patsyn/should_compile/T14394.stdout
+++ b/testsuite/tests/patsyn/should_compile/T14394.stdout
@@ -1,7 +1,7 @@
pattern Foo :: () => (b ~ a) => a :~~: b
-- Defined at <interactive>:5:1
pattern Bar
- :: forall k2 k1 (a :: k1) (b :: k2).
+ :: forall k1 k2 (a :: k1) (b :: k2).
() =>
(k2 ~ k1, b ~~ a) =>
a :~~: b
diff --git a/testsuite/tests/patsyn/should_fail/T14552.hs b/testsuite/tests/patsyn/should_compile/T14552.hs
index a4a7493530..a4a7493530 100644
--- a/testsuite/tests/patsyn/should_fail/T14552.hs
+++ b/testsuite/tests/patsyn/should_compile/T14552.hs
diff --git a/testsuite/tests/patsyn/should_compile/all.T b/testsuite/tests/patsyn/should_compile/all.T
index 19c9eaafae..54775a80a2 100644
--- a/testsuite/tests/patsyn/should_compile/all.T
+++ b/testsuite/tests/patsyn/should_compile/all.T
@@ -75,3 +75,4 @@ test('T14058', [extra_files(['T14058.hs', 'T14058a.hs'])],
multimod_compile, ['T14058', '-v0'])
test('T14326', normal, compile, [''])
test('T14394', normal, ghci_script, ['T14394.script'])
+test('T14552', normal, compile, [''])
diff --git a/testsuite/tests/patsyn/should_fail/T14552.stderr b/testsuite/tests/patsyn/should_fail/T14552.stderr
deleted file mode 100644
index 1723b325fa..0000000000
--- a/testsuite/tests/patsyn/should_fail/T14552.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-
-T14552.hs:22:9: error:
- • Universal type variable ‘aa’ has existentially bound kind:
- aa :: k
- Existentially-bound variables:
- k :: *
- w :: k --> *
- Probable fix: give the pattern synonym a type signature
- • In the declaration for pattern synonym ‘FOO’
diff --git a/testsuite/tests/patsyn/should_fail/all.T b/testsuite/tests/patsyn/should_fail/all.T
index 099e9059d9..7cdef908a6 100644
--- a/testsuite/tests/patsyn/should_fail/all.T
+++ b/testsuite/tests/patsyn/should_fail/all.T
@@ -41,7 +41,6 @@ test('T14112', normal, compile_fail, [''])
test('T14114', normal, compile_fail, [''])
test('T14380', normal, compile_fail, [''])
test('T14498', normal, compile_fail, [''])
-test('T14552', normal, compile_fail, [''])
test('T14507', normal, compile_fail, ['-dsuppress-uniques'])
test('T15289', normal, compile_fail, [''])
test('T15685', normal, compile_fail, [''])