summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--testsuite/tests/typecheck/should_fail/T12966.hs4
-rw-r--r--testsuite/tests/typecheck/should_fail/T12966.stderr6
-rw-r--r--testsuite/tests/typecheck/should_fail/all.T1
3 files changed, 11 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T12966.hs b/testsuite/tests/typecheck/should_fail/T12966.hs
new file mode 100644
index 0000000000..27bcff6708
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T12966.hs
@@ -0,0 +1,4 @@
+{-# LANGUAGE RankNTypes #-}
+module T12966 where
+-- This should fail with a proper error message, not a compiler panic.
+type Maybeify c = forall d. (c d) => ((~) (Maybe d))
diff --git a/testsuite/tests/typecheck/should_fail/T12966.stderr b/testsuite/tests/typecheck/should_fail/T12966.stderr
new file mode 100644
index 0000000000..dd63bf47ca
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T12966.stderr
@@ -0,0 +1,6 @@
+
+T12966.hs:4:39: error:
+ • Expecting one more argument to ‘(~) (Maybe d)’
+ Expected a type, but ‘(~) (Maybe d)’ has kind ‘* -> Constraint’
+ • In the type ‘forall d. (c d) => ((~) (Maybe d))’
+ In the type declaration for ‘Maybeify’
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index 6f99a94ff4..9f578a02d2 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -432,3 +432,4 @@ test('T12529', normal, compile_fail, [''])
test('T12729', normal, compile_fail, [''])
test('T12803', normal, compile_fail, [''])
test('T12042', extra_clean(['T12042a.hi', 'T12042a.o', 'T12042.hi-boot', 'T12042.o-boot']), multimod_compile_fail, ['T12042', ''])
+test('T12966', normal, compile_fail, ['']) \ No newline at end of file