summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornineonine <mail4chemik@gmail.com>2022-02-24 01:16:18 -0800
committernineonine <mail4chemik@gmail.com>2022-02-24 01:16:18 -0800
commitba52692e6e7edcbd5bead52eaff7998ff5f8bd3e (patch)
tree55b231b3ae407f12f35e53353b964d3b208207c8
parent0b36801f8eec9b9a7cc512135a13eaf89da370a2 (diff)
downloadhaskell-wip/T19271-test.tar.gz
Add test for #19271wip/T19271-test
-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])