Update Hadrian
[ghc.git] / testsuite / tests / polykinds / T10670.hs
1 {-# LANGUAGE ScopedTypeVariables, RankNTypes, GADTs, PolyKinds #-}
2
3 module T10670 where
4
5 import Unsafe.Coerce
6
7 data TypeRepT (a::k) where
8 TRCon :: TypeRepT a
9
10 data G2 c a where
11 G2 :: TypeRepT a -> TypeRepT b -> G2 c (c a b)
12
13 getT2 :: TypeRepT (c :: k2 -> k1 -> k) -> TypeRepT (a :: k) -> Maybe (G2 c a)
14 {-# NOINLINE getT2 #-}
15 getT2 c t = Nothing
16
17 tyRepTArr :: TypeRepT (->)
18 {-# NOINLINE tyRepTArr #-}
19 tyRepTArr = TRCon
20
21 s :: forall a x. TypeRepT (a :: *) -> Maybe x
22 s tf = case getT2 tyRepTArr tf :: Maybe (G2 (->) a) of
23 Just (G2 _ _) -> Nothing
24 _ -> Nothing