summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
authorSimon Peyton Jones <simon.peytonjones@gmail.com>2023-01-12 23:08:07 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-01-13 16:52:07 -0500
commit496607fdb77baf12e2fe263104ba5d0d700eee3b (patch)
tree6b37b3ab1bf9375f61be2517ccaae54ada3c0ae0 /testsuite/tests
parentb6eb9bccd56a11b5e8c208bb5490309317fd5275 (diff)
downloadhaskell-496607fdb77baf12e2fe263104ba5d0d700eee3b.tar.gz
Add a missing checkEscapingKind
Ticket #22743 pointed out that there is a missing check, for type-inferred bindings, that the inferred type doesn't have an escaping kind. The fix is easy.
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/polykinds/T22743.hs10
-rw-r--r--testsuite/tests/polykinds/T22743.stderr7
-rw-r--r--testsuite/tests/polykinds/all.T1
3 files changed, 18 insertions, 0 deletions
diff --git a/testsuite/tests/polykinds/T22743.hs b/testsuite/tests/polykinds/T22743.hs
new file mode 100644
index 0000000000..55ed0f4a24
--- /dev/null
+++ b/testsuite/tests/polykinds/T22743.hs
@@ -0,0 +1,10 @@
+{-# LANGUAGE DataKinds #-}
+module M where
+
+import GHC.Exts
+import Data.Kind
+
+f :: forall f (g :: Type) (a :: TYPE (f g)). Int -> a
+f = f
+
+x = f 0
diff --git a/testsuite/tests/polykinds/T22743.stderr b/testsuite/tests/polykinds/T22743.stderr
new file mode 100644
index 0000000000..cb097568e4
--- /dev/null
+++ b/testsuite/tests/polykinds/T22743.stderr
@@ -0,0 +1,7 @@
+
+T22743.hs:10:1: error: [GHC-31147]
+ • Quantified type's kind mentions quantified type variable
+ type: ‘forall {f :: * -> RuntimeRep} {g} {a :: TYPE (f g)}. a’
+ where the body of the forall has this kind: ‘TYPE (f g)’
+ • When checking the inferred type
+ x :: forall {f :: * -> RuntimeRep} {g} {a :: TYPE (f g)}. a
diff --git a/testsuite/tests/polykinds/all.T b/testsuite/tests/polykinds/all.T
index 721e41cebd..b23e76c025 100644
--- a/testsuite/tests/polykinds/all.T
+++ b/testsuite/tests/polykinds/all.T
@@ -241,3 +241,4 @@ test('T19739c', normal, compile, [''])
test('T19739d', normal, compile, [''])
test('T22379a', normal, compile, [''])
test('T22379b', normal, compile, [''])
+test('T22743', normal, compile_fail, [''])