diff options
Diffstat (limited to 'testsuite/tests/pmcheck/should_compile/T18049.hs')
-rw-r--r-- | testsuite/tests/pmcheck/should_compile/T18049.hs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/testsuite/tests/pmcheck/should_compile/T18049.hs b/testsuite/tests/pmcheck/should_compile/T18049.hs new file mode 100644 index 0000000000..b63ffdf751 --- /dev/null +++ b/testsuite/tests/pmcheck/should_compile/T18049.hs @@ -0,0 +1,29 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE KindSignatures #-} +{-# LANGUAGE GADTs #-} +{-# LANGUAGE RankNTypes #-} +{-# OPTIONS_GHC -Wincomplete-patterns -fforce-recomp #-} +module Bug where + +import Data.Kind + +data SBool :: Bool -> Type where + SFalse :: SBool False + STrue :: SBool True + +f :: SBool b + -> (b ~ True => SBool b -> r) + -> (b ~ False => SBool b -> r) + -> r +f x t f = + case x of + SFalse -> f x + STrue -> t x + +g :: forall b. SBool b -> () +g x = f x + (\x' -> + case x' of + -- SFalse -> () + STrue -> ()) + (\_ -> ()) |