diff options
author | Richard Eisenberg <rae@richarde.dev> | 2019-12-11 15:58:56 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-01-12 21:29:27 -0500 |
commit | 350e2b78788d47255d27489dfc62d664498b5de4 (patch) | |
tree | 50f2f1982c9f120e6b8aac1970579d34333cd16a /testsuite/tests/polykinds | |
parent | 9129210f7e9937c1065330295f06524661575839 (diff) | |
download | haskell-350e2b78788d47255d27489dfc62d664498b5de4.tar.gz |
Don't zap to Any; error instead
This changes GHC's treatment of so-called Naughty Quantification
Candidates to issue errors, instead of zapping to Any.
Close #16775.
No new test cases, because existing ones cover this well.
Diffstat (limited to 'testsuite/tests/polykinds')
-rw-r--r-- | testsuite/tests/polykinds/T15795.stderr | 9 | ||||
-rw-r--r-- | testsuite/tests/polykinds/T15795a.stderr | 9 | ||||
-rw-r--r-- | testsuite/tests/polykinds/all.T | 4 |
3 files changed, 20 insertions, 2 deletions
diff --git a/testsuite/tests/polykinds/T15795.stderr b/testsuite/tests/polykinds/T15795.stderr new file mode 100644 index 0000000000..65bfdddecc --- /dev/null +++ b/testsuite/tests/polykinds/T15795.stderr @@ -0,0 +1,9 @@ + +T15795.hs:12:3: error: + • Cannot generalise type; skolem ‘k’ would escape its scope + if I tried to quantify (a0 :: k) in this type: + forall k (b :: k). T @k @a0 b + (Indeed, I sometimes struggle even printing this correctly, + due to its ill-scoped nature.) + • In the definition of data constructor ‘MkT’ + In the data declaration for ‘T’ diff --git a/testsuite/tests/polykinds/T15795a.stderr b/testsuite/tests/polykinds/T15795a.stderr new file mode 100644 index 0000000000..f4757137ce --- /dev/null +++ b/testsuite/tests/polykinds/T15795a.stderr @@ -0,0 +1,9 @@ + +T15795a.hs:9:3: error: + • Cannot generalise type; skolem ‘u’ would escape its scope + if I tried to quantify (cat10 :: u) in this type: + forall u (a :: u). F @u @cat10 a + (Indeed, I sometimes struggle even printing this correctly, + due to its ill-scoped nature.) + • In the definition of data constructor ‘Prod’ + In the data declaration for ‘F’ diff --git a/testsuite/tests/polykinds/all.T b/testsuite/tests/polykinds/all.T index 74ab266308..4312691755 100644 --- a/testsuite/tests/polykinds/all.T +++ b/testsuite/tests/polykinds/all.T @@ -204,8 +204,8 @@ test('T15817', normal, compile, ['']) test('T15874', normal, compile, ['']) test('T14887a', normal, compile, ['']) test('T14847', normal, compile, ['']) -test('T15795', normal, compile, ['']) -test('T15795a', normal, compile, ['']) +test('T15795', normal, compile_fail, ['']) +test('T15795a', normal, compile_fail, ['']) test('T16247', normal, compile_fail, ['']) test('T16247a', normal, compile_fail, ['']) test('KindVarOrder', normal, ghci_script, ['KindVarOrder.script']) |