Test Trac #7368 (second example)
authorSimon Peyton Jones <simonpj@microsoft.com>
Thu, 20 Dec 2012 21:08:59 +0000 (21:08 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Thu, 20 Dec 2012 21:08:59 +0000 (21:08 +0000)
testsuite/tests/typecheck/should_fail/T7368a.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/T7368a.stderr [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/all.T

diff --git a/testsuite/tests/typecheck/should_fail/T7368a.hs b/testsuite/tests/typecheck/should_fail/T7368a.hs
new file mode 100644 (file)
index 0000000..7b11313
--- /dev/null
@@ -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/testsuite/tests/typecheck/should_fail/T7368a.stderr b/testsuite/tests/typecheck/should_fail/T7368a.stderr
new file mode 100644 (file)
index 0000000..db0f69f
--- /dev/null
@@ -0,0 +1,10 @@
+\r
+T7368a.hs:8:6:\r
+    Couldn't match kind `*' with `* -> *'\r
+    When matching types\r
+      f :: * -> *\r
+      Bad :: (* -> *) -> *\r
+    Expected type: f (Bad f)\r
+      Actual type: Bad t0\r
+    In the pattern: Bad x\r
+    In an equation for `fun': fun (Bad x) = True\r
index 2e1ec6e..5899413 100644 (file)
@@ -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, [''])