summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simon.peytonjones@gmail.com>2023-03-03 08:21:22 +0000
committerSimon Peyton Jones <simon.peytonjones@gmail.com>2023-03-04 00:05:43 +0000
commitc7c1a73b6e93e505b06736cbb6f8be79fdca32c1 (patch)
treeea841a201ceb23f88d33de16e37a55dd3ab497be
parentbd0536afee5d5f91d99af2ab193b6eee5b1da07a (diff)
downloadhaskell-wip/t22707.tar.gz
Add test for T22793wip/t22707
-rw-r--r--testsuite/tests/polykinds/T22793.hs17
-rw-r--r--testsuite/tests/polykinds/T22793.stderr44
-rw-r--r--testsuite/tests/polykinds/all.T1
3 files changed, 62 insertions, 0 deletions
diff --git a/testsuite/tests/polykinds/T22793.hs b/testsuite/tests/polykinds/T22793.hs
new file mode 100644
index 0000000000..3864748c49
--- /dev/null
+++ b/testsuite/tests/polykinds/T22793.hs
@@ -0,0 +1,17 @@
+{-# LANGUAGE PolyKinds #-}
+{-# LANGUAGE StandaloneKindSignatures #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+
+module T22793 where
+
+import Data.Kind
+
+type Foo :: forall k. k -> k -> Constraint
+
+class Foo s a
+
+bob :: forall {k1} {ks} {ka} q (p :: k1 -> q -> Type)
+ (f :: ka -> q) (s :: ks) (t :: ks)
+ (a :: ka) (b :: ka). Foo s a
+ => p a (f b) -> p s (f t)
+bob f = undefined
diff --git a/testsuite/tests/polykinds/T22793.stderr b/testsuite/tests/polykinds/T22793.stderr
new file mode 100644
index 0000000000..8082fa5be0
--- /dev/null
+++ b/testsuite/tests/polykinds/T22793.stderr
@@ -0,0 +1,44 @@
+
+T22793.hs:15:42: error: [GHC-25897]
+ • Couldn't match kind ‘ka’ with ‘k1’
+ Expected kind ‘ks’, but ‘a’ has kind ‘ka’
+ ‘ka’ is a rigid type variable bound by
+ the type signature for ‘bob’
+ at T22793.hs:13:26-27
+ ‘k1’ is a rigid type variable bound by
+ the type signature for ‘bob’
+ at T22793.hs:13:16-17
+ • In the second argument of ‘Foo’, namely ‘a’
+ In the type signature:
+ bob :: forall {k1}
+ {ks}
+ {ka}
+ q
+ (p :: k1 -> q -> Type)
+ (f :: ka -> q)
+ (s :: ks)
+ (t :: ks)
+ (a :: ka)
+ (b :: ka). Foo s a => p a (f b) -> p s (f t)
+
+T22793.hs:16:11: error: [GHC-25897]
+ • Couldn't match kind ‘ks’ with ‘k1’
+ Expected kind ‘k1’, but ‘a’ has kind ‘ka’
+ ‘ks’ is a rigid type variable bound by
+ the type signature for ‘bob’
+ at T22793.hs:13:21-22
+ ‘k1’ is a rigid type variable bound by
+ the type signature for ‘bob’
+ at T22793.hs:13:16-17
+ • In the first argument of ‘p’, namely ‘a’
+ In the type signature:
+ bob :: forall {k1}
+ {ks}
+ {ka}
+ q
+ (p :: k1 -> q -> Type)
+ (f :: ka -> q)
+ (s :: ks)
+ (t :: ks)
+ (a :: ka)
+ (b :: ka). Foo s a => p a (f b) -> p s (f t)
diff --git a/testsuite/tests/polykinds/all.T b/testsuite/tests/polykinds/all.T
index a73508858c..e16789136f 100644
--- a/testsuite/tests/polykinds/all.T
+++ b/testsuite/tests/polykinds/all.T
@@ -243,3 +243,4 @@ test('T22379a', normal, compile, [''])
test('T22379b', normal, compile, [''])
test('T22743', normal, compile_fail, [''])
test('T22742', normal, compile_fail, [''])
+test('T22793', normal, compile_fail, [''])