Test Trac #9858 comment:101
authorSimon Peyton Jones <simonpj@microsoft.com>
Wed, 22 Apr 2015 13:18:56 +0000 (14:18 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Wed, 22 Apr 2015 13:18:56 +0000 (14:18 +0100)
testsuite/tests/typecheck/should_fail/T9858c.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/T9858c.stderr [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/all.T

diff --git a/testsuite/tests/typecheck/should_fail/T9858c.hs b/testsuite/tests/typecheck/should_fail/T9858c.hs
new file mode 100644 (file)
index 0000000..116a50b
--- /dev/null
@@ -0,0 +1,9 @@
+{-# LANGUAGE ImpredicativeTypes, FlexibleContexts #-}
+
+module T9858b where
+import Data.Typeable
+
+i :: (Typeable a, Typeable b) => Proxy (a b) -> TypeRep
+i p = typeRep p
+
+j = i (Proxy :: Proxy (Eq Int => Int))
diff --git a/testsuite/tests/typecheck/should_fail/T9858c.stderr b/testsuite/tests/typecheck/should_fail/T9858c.stderr
new file mode 100644 (file)
index 0000000..c2d0f22
--- /dev/null
@@ -0,0 +1,9 @@
+
+T9858c.hs:9:8: error:
+    Couldn't match type ‘Eq Int => Int’ with ‘a0 b0’
+    Expected type: Proxy (a0 b0)
+      Actual type: Proxy (Eq Int => Int)
+    In the first argument of ‘i’, namely
+      ‘(Proxy :: Proxy (Eq Int => Int))’
+    In the expression: i (Proxy :: Proxy (Eq Int => Int))
+    In an equation for ‘j’: j = i (Proxy :: Proxy (Eq Int => Int))
index 1590020..befe8e3 100644 (file)
@@ -358,3 +358,4 @@ test('T10194', normal, compile_fail, [''])
 test('T8030', normal, compile_fail, [''])
 test('T9858a', normal, compile_fail, [''])
 test('T9858b', normal, compile_fail, [''])
+test('T9858c', normal, compile_fail, [''])