Synchronize ClsInst.doTyConApp with TcTypeable validity checks (#15862)
[ghc.git] / testsuite / tests / typecheck / should_fail / T15862.hs
1 {-# LANGUAGE DataKinds #-}
2 {-# LANGUAGE GADTs #-}
3 {-# LANGUAGE ImpredicativeTypes #-}
4 {-# LANGUAGE PolyKinds #-}
5 {-# LANGUAGE RankNTypes #-}
6 {-# LANGUAGE TypeFamilies #-}
7 {-# LANGUAGE TypeApplications #-}
8 {-# LANGUAGE UnboxedSums #-}
9 module Bug where
10
11 import Data.Kind
12 import Type.Reflection
13
14 newtype Foo = MkFoo (forall a. a)
15
16 foo :: TypeRep MkFoo
17 foo = typeRep @MkFoo
18
19 type family F a
20 type instance F Int = Type
21
22 data Bar = forall (a :: F Int). MkBar a
23
24 bar :: TypeRep (MkBar True)
25 bar = typeRep
26
27 data Quux = MkQuux (# Bool | Int #)
28
29 quux :: TypeRep MkQuux
30 quux = typeRep
31
32 data Quuz :: (Type ~ Type) => Type where
33 MkQuuz :: Quuz
34
35 quuz :: TypeRep MkQuuz
36 quuz = typeRep