[commit: ghc] ghc-7.10: Test Trac #9858 comment:101 (da6199d)

git at git.haskell.org git at git.haskell.org
Mon May 11 11:47:26 UTC 2015


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

On branch  : ghc-7.10
Link       : http://ghc.haskell.org/trac/ghc/changeset/da6199d0f6d7589224b420f81b33ac03388b09b5/ghc

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

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

    Test Trac #9858 comment:101
    
    (cherry picked from commit 932f08677ca07f1793398e4c3456b81359728483)


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

da6199d0f6d7589224b420f81b33ac03388b09b5
 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 de01268..6402dc4 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -361,3 +361,4 @@ test('T10285',
      multimod_compile_fail, ['T10285', '-v0'])
 test('T9858a', normal, compile_fail, [''])
 test('T9858b', normal, compile_fail, [''])
+test('T9858c', normal, compile_fail, [''])



More information about the ghc-commits mailing list