summaryrefslogtreecommitdiff
path: root/testsuite/tests/polykinds/T10670.hs
blob: 5b9cc72e21ca5c80b00c47c045e04735c6618d69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{-# LANGUAGE ScopedTypeVariables, RankNTypes, GADTs, PolyKinds #-}

module T10670 where

import Unsafe.Coerce

data TypeRepT (a::k) where
  TRCon :: TypeRepT a

data G2 c a where
  G2 :: TypeRepT a -> TypeRepT b -> G2 c (c a b)

getT2 :: TypeRepT (c :: k2 -> k1 -> k) -> TypeRepT (a :: k) -> Maybe (G2 c a)
{-# NOINLINE getT2 #-}
getT2 c t = Nothing

tyRepTArr :: TypeRepT (->)
{-# NOINLINE tyRepTArr #-}
tyRepTArr = TRCon

s :: forall a x. TypeRepT (a :: *) -> Maybe x
s tf = case getT2 tyRepTArr tf :: Maybe (G2 (->) a) of
          Just (G2 _ _) -> Nothing
          _ -> Nothing