blob: 7a6a50547c3de5c568f752fb33be3a01cfca0f6d (
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 RankNTypes, 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'
|