summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/dependent/should_fail/T15215.hs12
-rw-r--r--testsuite/tests/dependent/should_fail/T15215.stderr12
-rw-r--r--testsuite/tests/dependent/should_fail/all.T1
3 files changed, 25 insertions, 0 deletions
diff --git a/testsuite/tests/dependent/should_fail/T15215.hs b/testsuite/tests/dependent/should_fail/T15215.hs
new file mode 100644
index 0000000000..96fe04385b
--- /dev/null
+++ b/testsuite/tests/dependent/should_fail/T15215.hs
@@ -0,0 +1,12 @@
+{-# LANGUAGE GADTs #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE TypeInType #-}
+module T15215 where
+
+import Data.Kind
+
+data A :: Type -> Type where
+ MkA :: Show (Maybe a) => A a
+
+data SA :: forall a. A a -> Type where
+ SMkA :: SA MkA
diff --git a/testsuite/tests/dependent/should_fail/T15215.stderr b/testsuite/tests/dependent/should_fail/T15215.stderr
new file mode 100644
index 0000000000..80181b44bd
--- /dev/null
+++ b/testsuite/tests/dependent/should_fail/T15215.stderr
@@ -0,0 +1,12 @@
+
+T15215.hs:9:3: error:
+ • Non type-variable argument in the constraint: Show (Maybe a)
+ (Use FlexibleContexts to permit this)
+ • In the definition of data constructor ‘MkA’
+ In the data type declaration for ‘A’
+
+T15215.hs:12:14: error:
+ • Illegal constraint in a type: Show (Maybe a0)
+ • In the first argument of ‘SA’, namely ‘MkA’
+ In the type ‘SA MkA’
+ In the definition of data constructor ‘SMkA’
diff --git a/testsuite/tests/dependent/should_fail/all.T b/testsuite/tests/dependent/should_fail/all.T
index 5ae037dc54..8e5185f1ae 100644
--- a/testsuite/tests/dependent/should_fail/all.T
+++ b/testsuite/tests/dependent/should_fail/all.T
@@ -28,3 +28,4 @@ test('T14066g', normal, compile_fail, [''])
test('T14066h', normal, compile_fail, [''])
test('InferDependency', normal, compile_fail, [''])
test('T15245', normal, compile_fail, [''])
+test('T15215', normal, compile_fail, [''])