Embrace -XTypeInType, add -XStarIsType
[ghc.git] / testsuite / tests / dependent / should_fail / T11473.hs
1 {-# LANGUAGE PolyKinds, TypeFamilies, MagicHash, DataKinds, RankNTypes #-}
2
3 module T11473 where
4
5 import GHC.Exts
6 import GHC.Types
7
8 type family Boxed (a :: k) :: *
9 type instance Boxed Char# = Char
10 type instance Boxed Char = Char
11
12 class BoxIt (a :: TYPE lev) where
13 boxed :: a -> Boxed a
14
15 instance BoxIt Char# where boxed x = C# x
16 instance BoxIt Char where boxed = id
17
18 hello :: forall (r :: RuntimeRep). forall (a :: TYPE r). BoxIt a => a -> Boxed a
19 hello x = boxed x
20 {-# NOINLINE hello #-}
21
22 main :: IO ()
23 main = do
24 print $ boxed 'c'#
25 print $ boxed 'c'
26 print $ hello 'c'
27 print $ hello 'c'#