[commit: testsuite] master: Test Trac #7368 (second example) (452ccd5)

Simon Peyton Jones <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/452ccd5bff032bd3da73f730c607e077ef8dace2

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

commit 452ccd5bff032bd3da73f730c607e077ef8dace2
Author: Simon Peyton Jones <[email protected]>
Date:   Thu Dec 20 21:08:59 2012 +0000

    Test Trac #7368 (second example)

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

 tests/typecheck/should_fail/T7368a.hs     |   14 ++++++++++++++
 tests/typecheck/should_fail/T7368a.stderr |   10 ++++++++++
 tests/typecheck/should_fail/all.T         |    1 +
 3 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/tests/typecheck/should_fail/T7368a.hs b/tests/typecheck/should_fail/T7368a.hs
new file mode 100644
index 0000000..7b11313
--- /dev/null
+++ b/tests/typecheck/should_fail/T7368a.hs
@@ -0,0 +1,14 @@
+{-# LANGUAGE Rank2Types, KindSignatures #-}
+module T7368 where
+
+newtype Bad w = Bad (forall a. (w a -> a))
+-- Bad :: forall w. (forall a. w a -> a) -> Bad w
+
+fun :: forall (f :: * -> *). f (Bad f) -> Bool
+fun (Bad x) = True 
+
+{-  f (Bad f) ~ Bad w
+-->
+    f ~ Bad
+    Bad f ~ w
+-}
diff --git a/tests/typecheck/should_fail/T7368a.stderr b/tests/typecheck/should_fail/T7368a.stderr
new file mode 100644
index 0000000..db0f69f
--- /dev/null
+++ b/tests/typecheck/should_fail/T7368a.stderr
@@ -0,0 +1,10 @@
+
+T7368a.hs:8:6:
+    Couldn't match kind `*' with `* -> *'
+    When matching types
+      f :: * -> *
+      Bad :: (* -> *) -> *
+    Expected type: f (Bad f)
+      Actual type: Bad t0
+    In the pattern: Bad x
+    In an equation for `fun': fun (Bad x) = True
diff --git a/tests/typecheck/should_fail/all.T b/tests/typecheck/should_fail/all.T
index 2e1ec6e..5899413 100644
--- a/tests/typecheck/should_fail/all.T
+++ b/tests/typecheck/should_fail/all.T
@@ -289,3 +289,4 @@ test('T6069', normal, compile_fail, [''])
 test('T7220', normal, compile_fail, [''])
 test('T7410', normal, compile_fail, [''])
 test('T7453', normal, compile_fail, [''])
+test('T7368a', normal, compile_fail, [''])
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.