hadrian: Add support for bindist compressors other than Xz
[ghc.git] / testsuite / tests / typecheck / should_compile / T1123.hs
1 {-# LANGUAGE RankNTypes #-}
2
3 module Bug where
4
5 data T a = MkT
6
7 out :: forall a. T a -> ()
8 out MkT = ()
9
10 inHoisted :: forall r. () -> (forall a. T a -> r) -> r
11 inHoisted _ foo = foo MkT
12
13 inUnhoisted :: () -> forall r. (forall a. T a -> r) -> r
14 inUnhoisted _ foo = foo MkT
15
16 testHoisted :: ()
17 testHoisted = inHoisted () out
18
19 testUnhoisted :: ()
20 testUnhoisted = inUnhoisted () out
21
22
23 ----------------
24
25 data A s = A { unA :: () }
26
27 runA1 :: (forall s. A s) -> ()
28 runA1 a = unA a
29
30 -- doesn't work :(
31 runA2 :: (forall s. A s) -> ()
32 runA2 (A a) = a
33
34 runA3 :: (forall s. A s) -> ()
35 runA3 a = case a of A x -> x
36
37 runA4 :: (forall s. A s) -> ()
38 runA4 a = let A x = a in x
39
40 runA5 :: (forall s. A s) -> ()
41 runA5 a = go a
42 where go (A a) = a