summaryrefslogtreecommitdiff
path: root/testsuite/tests/quantified-constraints
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/quantified-constraints')
-rw-r--r--testsuite/tests/quantified-constraints/T15918.hs19
-rw-r--r--testsuite/tests/quantified-constraints/T15918.stderr7
-rw-r--r--testsuite/tests/quantified-constraints/all.T1
3 files changed, 27 insertions, 0 deletions
diff --git a/testsuite/tests/quantified-constraints/T15918.hs b/testsuite/tests/quantified-constraints/T15918.hs
new file mode 100644
index 0000000000..16e1e356d3
--- /dev/null
+++ b/testsuite/tests/quantified-constraints/T15918.hs
@@ -0,0 +1,19 @@
+{-# Language PolyKinds #-}
+{-# Language TypeFamilies #-}
+{-# Language ConstraintKinds #-}
+{-# Language FlexibleContexts #-}
+{-# Language QuantifiedConstraints #-}
+{-# Language UndecidableInstances #-}
+module T15918 where
+
+import Data.Kind
+
+class Rev f where
+ rev :: f a
+
+instance (forall xx. cls xx => Rev xx) => Rev (Build cls) where
+ rev = undefined
+
+data Build :: ((k -> Type) -> Constraint) -> (k -> Type)
+
+uu = rev :: Build [] a
diff --git a/testsuite/tests/quantified-constraints/T15918.stderr b/testsuite/tests/quantified-constraints/T15918.stderr
new file mode 100644
index 0000000000..fa06b0e3f4
--- /dev/null
+++ b/testsuite/tests/quantified-constraints/T15918.stderr
@@ -0,0 +1,7 @@
+
+T15918.hs:19:19: error:
+ • Expected kind ‘(k0 -> *) -> Constraint’,
+ but ‘[]’ has kind ‘* -> *’
+ • In the first argument of ‘Build’, namely ‘[]’
+ In an expression type signature: Build [] a
+ In the expression: rev :: Build [] a
diff --git a/testsuite/tests/quantified-constraints/all.T b/testsuite/tests/quantified-constraints/all.T
index 1e2eca8358..da585823b2 100644
--- a/testsuite/tests/quantified-constraints/all.T
+++ b/testsuite/tests/quantified-constraints/all.T
@@ -20,3 +20,4 @@ test('T15359', normal, compile, [''])
test('T15359a', normal, compile, [''])
test('T15625', normal, compile, [''])
test('T15625a', normal, compile, [''])
+test('T15918', normal, compile_fail, [''])