summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/tcfail104.hs
blob: 292780541c87d36b8ff291779435a34439de9113 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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'