diff options
author | Simon Peyton Jones <simon.peytonjones@gmail.com> | 2023-01-12 23:08:07 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-01-13 16:52:07 -0500 |
commit | 496607fdb77baf12e2fe263104ba5d0d700eee3b (patch) | |
tree | 6b37b3ab1bf9375f61be2517ccaae54ada3c0ae0 /testsuite | |
parent | b6eb9bccd56a11b5e8c208bb5490309317fd5275 (diff) | |
download | haskell-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')
-rw-r--r-- | testsuite/tests/polykinds/T22743.hs | 10 | ||||
-rw-r--r-- | testsuite/tests/polykinds/T22743.stderr | 7 | ||||
-rw-r--r-- | testsuite/tests/polykinds/all.T | 1 |
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, ['']) |