summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornineonine <mail4chemik@gmail.com>2022-02-24 01:16:18 -0800
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-02-25 21:13:23 -0500
commit140438a81be65d068f555788c4da2ce32182530b (patch)
treeec2cd7a4676cb4522995ef7fd0f85898b15c929d
parent7f9f49c3319ce0fbcbc728f3ff04b7cc1f74de24 (diff)
downloadhaskell-140438a81be65d068f555788c4da2ce32182530b.tar.gz
Add test for #19271
-rw-r--r--testsuite/tests/pmcheck/should_compile/T19271.hs11
-rw-r--r--testsuite/tests/pmcheck/should_compile/T19271.stderr9
-rw-r--r--testsuite/tests/pmcheck/should_compile/all.T2
3 files changed, 21 insertions, 1 deletions
diff --git a/testsuite/tests/pmcheck/should_compile/T19271.hs b/testsuite/tests/pmcheck/should_compile/T19271.hs
new file mode 100644
index 0000000000..1c96d67d6e
--- /dev/null
+++ b/testsuite/tests/pmcheck/should_compile/T19271.hs
@@ -0,0 +1,11 @@
+{-# OPTIONS_GHC -Wincomplete-patterns #-}
+module T19271 where
+
+data Roles = RolesUnsubscribed Bool
+ | RolesPartner Int
+ | RolesAnonymousClient Char
+ | RolesAnonymousVendor ()
+
+doingThing :: Roles -> ()
+doingThing roles =
+ case roles of
diff --git a/testsuite/tests/pmcheck/should_compile/T19271.stderr b/testsuite/tests/pmcheck/should_compile/T19271.stderr
new file mode 100644
index 0000000000..6ca6ebdadd
--- /dev/null
+++ b/testsuite/tests/pmcheck/should_compile/T19271.stderr
@@ -0,0 +1,9 @@
+
+T19271.hs:11:5: warning: [-Wincomplete-patterns (in -Wextra)]
+ Pattern match(es) are non-exhaustive
+ In a case alternative:
+ Patterns of type ‘Roles’ not matched:
+ RolesUnsubscribed _
+ RolesPartner _
+ RolesAnonymousClient _
+ RolesAnonymousVendor _
diff --git a/testsuite/tests/pmcheck/should_compile/all.T b/testsuite/tests/pmcheck/should_compile/all.T
index 59937f9291..9f55966ae8 100644
--- a/testsuite/tests/pmcheck/should_compile/all.T
+++ b/testsuite/tests/pmcheck/should_compile/all.T
@@ -154,4 +154,4 @@ test('EmptyCase007', [], compile, [overlapping_incomplete])
test('EmptyCase008', [], compile, [overlapping_incomplete])
test('EmptyCase009', [], compile, [overlapping_incomplete])
test('EmptyCase010', [], compile, [overlapping_incomplete])
-
+test('T19271', [], compile, [overlapping_incomplete])