diff options
Diffstat (limited to 'testsuite/tests/pmcheck/should_compile/T18533.hs')
-rw-r--r-- | testsuite/tests/pmcheck/should_compile/T18533.hs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/testsuite/tests/pmcheck/should_compile/T18533.hs b/testsuite/tests/pmcheck/should_compile/T18533.hs new file mode 100644 index 0000000000..3b4fdf8b89 --- /dev/null +++ b/testsuite/tests/pmcheck/should_compile/T18533.hs @@ -0,0 +1,24 @@ +{-# OPTIONS_GHC -Wincomplete-patterns -fforce-recomp #-} +{-# LANGUAGE GADTs, DataKinds, TypeFamilies, BangPatterns #-} + +module T18533 where + +data SBool (b :: Bool) where + STrue :: SBool 'True + SFalse :: SBool 'False + +type family Fam (b :: Bool) +type instance Fam 'True = T + +data T = T Bool + +f :: Fam b -> SBool b -> Bool +f !t s = case s of + STrue -> a where a = case t of T a -> a + _ -> False + + +g :: Bool -> Bool +g x = case x of + True -> a where a = case x of True -> False + False -> True |