summaryrefslogtreecommitdiff
path: root/testsuite/tests/pmcheck/should_compile/T4139.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/pmcheck/should_compile/T4139.hs')
-rw-r--r--testsuite/tests/pmcheck/should_compile/T4139.hs28
1 files changed, 28 insertions, 0 deletions
diff --git a/testsuite/tests/pmcheck/should_compile/T4139.hs b/testsuite/tests/pmcheck/should_compile/T4139.hs
new file mode 100644
index 0000000000..4f6d4abab5
--- /dev/null
+++ b/testsuite/tests/pmcheck/should_compile/T4139.hs
@@ -0,0 +1,28 @@
+{-# LANGUAGE GADTs #-}
+{-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
+
+module T4139 where
+
+data F a where
+ FInt :: F Int
+ FBool :: F Bool
+
+class Baz a where
+ baz :: F a -> G a
+instance Baz Int where
+ baz _ = GInt
+instance Baz Bool where
+ baz _ = GBool
+
+data G a where
+ GInt :: G Int
+ GBool :: G Bool
+
+bar :: Baz a => F a -> ()
+bar a@(FInt) =
+ case baz a of
+ GInt -> ()
+ -- GBool -> ()
+bar _ = ()
+
+