diff options
Diffstat (limited to 'testsuite/tests/simplCore/should_compile/T23362.hs')
-rw-r--r-- | testsuite/tests/simplCore/should_compile/T23362.hs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/testsuite/tests/simplCore/should_compile/T23362.hs b/testsuite/tests/simplCore/should_compile/T23362.hs new file mode 100644 index 0000000000..5c096d9f89 --- /dev/null +++ b/testsuite/tests/simplCore/should_compile/T23362.hs @@ -0,0 +1,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) |