Embrace -XTypeInType, add -XStarIsType
[ghc.git] / testsuite / tests / codeGen / should_fail / T13233.hs
1 {-# LANGUAGE ScopedTypeVariables #-}
2 {-# LANGUAGE PolyKinds #-}
3 {-# LANGUAGE UnboxedTuples #-}
4 {-# LANGUAGE RankNTypes #-}
5 {-# LANGUAGE MagicHash #-}
6 module Bug where
7
8 import GHC.Exts (TYPE, RuntimeRep, Weak#, State#, RealWorld, mkWeak# )
9
10 class Foo (a :: TYPE rep) where
11 bar :: forall (b :: TYPE rep2). (a -> a -> b) -> a -> a -> b
12
13 baz :: forall (a :: TYPE rep). Foo a => a -> a -> (# a, a #)
14 baz = bar (#,#)
15
16 obscure :: (forall (rep1 :: RuntimeRep) (rep2 :: RuntimeRep)
17 (a :: TYPE rep1) (b :: TYPE rep2).
18 a -> b -> (# a, b #)) -> ()
19 obscure _ = ()
20
21 quux :: ()
22 quux = obscure (#,#)
23
24 primop :: forall (rep :: RuntimeRep) (a :: TYPE rep) b c.
25 a -> b -> (State# RealWorld -> (# State# RealWorld, c #))
26 -> State# RealWorld -> (# State# RealWorld, Weak# b #)
27 primop = mkWeak#