[commit: testsuite] no-pred-ty: Test unreasonable tuple kind error messages (43585b7)

Max Bolingbroke batterseapower at hotmail.com
Sun Sep 4 13:54:27 CEST 2011


Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : no-pred-ty

http://hackage.haskell.org/trac/ghc/changeset/43585b70c9019eb22601f376f5b8719188d31e32

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

commit 43585b70c9019eb22601f376f5b8719188d31e32
Author: Max Bolingbroke <batterseapower at hotmail.com>
Date:   Fri Sep 2 18:07:56 2011 +0100

    Test unreasonable tuple kind error messages

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

 tests/typecheck/should_fail/all.T            |    1 +
 tests/typecheck/should_fail/tcfail212.hs     |   14 ++++++++++++++
 tests/typecheck/should_fail/tcfail212.stderr |    8 ++++++++
 3 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/tests/typecheck/should_fail/all.T b/tests/typecheck/should_fail/all.T
index f56e3e8..6811c6a 100644
--- a/tests/typecheck/should_fail/all.T
+++ b/tests/typecheck/should_fail/all.T
@@ -241,6 +241,7 @@ test('tcfail208', normal, compile_fail, [''])
 test('tcfail209', normal, compile_fail, [''])
 test('tcfail210', normal, compile_fail, [''])
 test('tcfail211', normal, compile_fail, [''])
+test('tcfail212', normal, compile_fail, [''])
 
 test('FailDueToGivenOverlapping', normal, compile_fail, [''])
 test('LongWayOverlapping', normal, compile_fail, [''])
diff --git a/tests/typecheck/should_fail/tcfail212.hs b/tests/typecheck/should_fail/tcfail212.hs
new file mode 100644
index 0000000..9ebc242
--- /dev/null
+++ b/tests/typecheck/should_fail/tcfail212.hs
@@ -0,0 +1,14 @@
+{-# LANGUAGE ConstraintKind, MagicHash #-}
+module ShouldFail where
+
+import GHC.Exts
+
+-- If we turn on ConstraintKind the typing rule for
+-- tuple types is generalised. This test checks that
+-- we get a reasonable error for unreasonable tuples.
+
+f :: (Maybe, Either Int)
+f = (Just 1, Left 1)
+
+g :: (Int#, Int#)
+g = (1#, 2#)
\ No newline at end of file
diff --git a/tests/typecheck/should_fail/tcfail212.stderr b/tests/typecheck/should_fail/tcfail212.stderr
new file mode 100644
index 0000000..1e24032
--- /dev/null
+++ b/tests/typecheck/should_fail/tcfail212.stderr
@@ -0,0 +1,8 @@
+
+tcfail212.hs:10:1:
+    Unexpected tuple component kind: * -> *
+    In the type signature for `f': f :: (Maybe, Either Int)
+
+tcfail212.hs:13:1:
+    Unexpected tuple component kind: #
+    In the type signature for `g': g :: (Int#, Int#)





More information about the Cvs-ghc mailing list