Add test case for #8806.
authorErik de Castro Lopo <erikd@mega-nerd.com>
Thu, 20 Feb 2014 07:13:50 +0000 (18:13 +1100)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Thu, 20 Feb 2014 10:41:05 +0000 (21:41 +1100)
GHC 7.6.3 and earlier should fail to type check this but don't.
This was fixed some time between the 7.6.3 and the 7.8rc1 release, so
we're just adding a test to prevent future regressions.

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

diff --git a/testsuite/tests/typecheck/should_fail/T8806.hs b/testsuite/tests/typecheck/should_fail/T8806.hs
new file mode 100644 (file)
index 0000000..6b80f15
--- /dev/null
@@ -0,0 +1,9 @@
+-- Trac #8806
+
+module T8806 where
+
+f :: Int => Int
+f x = x + 1
+
+g :: (Int => Show a) => Int
+g = undefined
diff --git a/testsuite/tests/typecheck/should_fail/T8806.stderr b/testsuite/tests/typecheck/should_fail/T8806.stderr
new file mode 100644 (file)
index 0000000..cc1caa8
--- /dev/null
@@ -0,0 +1,8 @@
+
+T8806.hs:5:6:
+    Expected a constraint, but ‛Int’ has kind ‛*’
+    In the type signature for ‛f’: f :: Int => Int
+
+T8806.hs:8:7:
+    Expected a constraint, but ‛Int’ has kind ‛*’
+    In the type signature for ‛g’: g :: Int => Show a => Int
index faef063..9f5af09 100644 (file)
@@ -330,3 +330,4 @@ test('ContextStack2', normal, compile_fail, ['-ftype-function-depth=10'])
 test('T8570', extra_clean(['T85570a.o', 'T8570a.hi','T85570b.o', 'T8570b.hi']),
      multimod_compile_fail, ['T8570', '-v0'])
 test('T8603', normal, compile_fail, [''])
+test('T8806', normal, compile_fail, [''])