testsuite: Add test for #12966
authorBen Gamari <bgamari.foss@gmail.com>
Thu, 15 Dec 2016 20:27:01 +0000 (15:27 -0500)
committerBen Gamari <ben@smart-cactus.org>
Thu, 15 Dec 2016 20:27:02 +0000 (15:27 -0500)
This isn't exactly a typechecker test, but it was the most appropriate
directory I could think of. The issue being tested is fixed.

Test Plan: Validate

Reviewers: austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2857

GHC Trac Issues: #12966

testsuite/tests/typecheck/should_fail/T12966.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/T12966.stderr [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/all.T

diff --git a/testsuite/tests/typecheck/should_fail/T12966.hs b/testsuite/tests/typecheck/should_fail/T12966.hs
new file mode 100644 (file)
index 0000000..27bcff6
--- /dev/null
@@ -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 (file)
index 0000000..dd63bf4
--- /dev/null
@@ -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’
index 6f99a94..9f578a0 100644 (file)
@@ -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