summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/tcfail104.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/typecheck/should_fail/tcfail104.hs')
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail104.hs23
1 files changed, 23 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/tcfail104.hs b/testsuite/tests/typecheck/should_fail/tcfail104.hs
new file mode 100644
index 0000000000..292780541c
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/tcfail104.hs
@@ -0,0 +1,23 @@
+{-# LANGUAGE Rank2Types, ScopedTypeVariables #-}
+
+-- Test the handling of conditionals in rank-n stuff
+-- Should fail, regardless of branch ordering
+
+module ShouldFail where
+
+-- These two are ok
+f1 = (\ (x :: forall a. a->a) -> x)
+f2 = (\ (x :: forall a. a->a) -> x) id 'c'
+
+-- These fail
+f3 v = (if v then
+ (\ (x :: forall a. a->a) -> x)
+ else
+ (\ x -> x)
+ ) id 'c'
+
+f4 v = (if v then
+ (\ x -> x)
+ else
+ (\ (x :: forall a. a->a) -> x)
+ ) id 'c'