[commit: ghc] master: Test Trac #9858 comment:101 (932f086)

git at git.haskell.org git at git.haskell.org
Wed Apr 22 13:18:29 UTC 2015


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/932f08677ca07f1793398e4c3456b81359728483/ghc

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

commit 932f08677ca07f1793398e4c3456b81359728483
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Wed Apr 22 14:18:56 2015 +0100

    Test Trac #9858 comment:101


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

932f08677ca07f1793398e4c3456b81359728483
 testsuite/tests/typecheck/should_fail/T9858c.hs     | 9 +++++++++
 testsuite/tests/typecheck/should_fail/T9858c.stderr | 9 +++++++++
 testsuite/tests/typecheck/should_fail/all.T         | 1 +
 3 files changed, 19 insertions(+)

diff --git a/testsuite/tests/typecheck/should_fail/T9858c.hs b/testsuite/tests/typecheck/should_fail/T9858c.hs
new file mode 100644
index 0000000..116a50b
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T9858c.hs
@@ -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
index 0000000..c2d0f22
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T9858c.stderr
@@ -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))
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index 1590020..befe8e3 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -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, [''])



More information about the ghc-commits mailing list