[commit: ghc] master: Add test case for #8806. (55cc01a)

git at git.haskell.org git at git.haskell.org
Thu Feb 20 10:43:22 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/55cc01a95328667e5e26f1e3062a45059cc3cbec/ghc

>---------------------------------------------------------------

commit 55cc01a95328667e5e26f1e3062a45059cc3cbec
Author: Erik de Castro Lopo <erikd at mega-nerd.com>
Date:   Thu Feb 20 18:13:50 2014 +1100

    Add test case for #8806.
    
    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.


>---------------------------------------------------------------

55cc01a95328667e5e26f1e3062a45059cc3cbec
 testsuite/tests/typecheck/should_fail/T8806.hs     |    9 +++++++++
 testsuite/tests/typecheck/should_fail/T8806.stderr |    8 ++++++++
 testsuite/tests/typecheck/should_fail/all.T        |    1 +
 3 files changed, 18 insertions(+)

diff --git a/testsuite/tests/typecheck/should_fail/T8806.hs b/testsuite/tests/typecheck/should_fail/T8806.hs
new file mode 100644
index 0000000..6b80f15
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T8806.hs
@@ -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
index 0000000..cc1caa8
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T8806.stderr
@@ -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
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index faef063..9f5af09 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -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, [''])



More information about the ghc-commits mailing list