summaryrefslogtreecommitdiff
path: root/testsuite/tests/simplCore/should_compile/T23362.hs
blob: 5c096d9f8968d93663b2793be6dcb43b7239d1eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
module T23362 where

import Unsafe.Coerce
import Data.Kind

type Phantom :: Type -> Type
data Phantom a = MkPhantom

newtype Id a = MkId a
newtype First a = MkFirst (Id a)
data Second a = MkSecond (First a)
data Third a = MkThird !(Second a)

a :: Second (Phantom Int)
a = MkSecond (MkFirst (MkId MkPhantom))

uc :: Second (Phantom Int) -> Second (Phantom Bool)
uc = unsafeCoerce

b :: Third (Phantom Bool)
b = MkThird (uc a)