Fix API Annotations for unboxed sums
[ghc.git] / testsuite / tests / ghc-api / annotations / Test12417.hs
1 {-# LANGUAGE UnboxedSums, MagicHash #-}
2
3 module Test12417 where
4
5 import GHC.Prim
6 import GHC.Types
7
8 import System.Mem (performMajorGC)
9
10 type Either1 a b = (# a | b #)
11
12 showEither1 :: (Show a, Show b) => Either1 a b -> String
13 showEither1 (# left | #) = "Left " ++ show left
14 showEither1 (# | right #) = "Right " ++ show right
15
16 type T = (# Int | Bool | String | Char | Either Int Bool | Int# | Float# #)
17
18 showEither4 :: T -> String
19 showEither4 (# | b | | | | | #) = "Alt1: " ++ show b