[commit: ghc] wip/type-app: Add another test case (9370e6f)

git at git.haskell.org git at git.haskell.org
Fri Aug 7 12:05:34 UTC 2015


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

On branch  : wip/type-app
Link       : http://ghc.haskell.org/trac/ghc/changeset/9370e6fcbdb3cdfc602a55d8cf5c59d57aab5762/ghc

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

commit 9370e6fcbdb3cdfc602a55d8cf5c59d57aab5762
Author: Richard Eisenberg <eir at cis.upenn.edu>
Date:   Fri Jul 10 12:48:39 2015 -0400

    Add another test case


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

9370e6fcbdb3cdfc602a55d8cf5c59d57aab5762
 testsuite/tests/typecheck/should_compile/Vta2.hs | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/testsuite/tests/typecheck/should_compile/Vta2.hs b/testsuite/tests/typecheck/should_compile/Vta2.hs
new file mode 100644
index 0000000..2851b06
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/Vta2.hs
@@ -0,0 +1,14 @@
+{-# LANGUAGE RankNTypes, TypeApplications #-}
+
+
+module Vta2 where
+
+checkIf :: Bool -> (forall a. a -> a) -> (Bool, Int)
+checkIf _ = if True
+            then \f -> (f True, f 5)
+            else \f -> (f False, f @Int 3)
+
+checkCase :: Bool -> (forall a. a -> a) -> (Bool, Int)
+checkCase _ = case True of
+                True -> \f -> (f True, f 5)
+                False -> \f -> (f False, f @Int 3)



More information about the ghc-commits mailing list