diff options
-rw-r--r-- | testsuite/tests/pmcheck/should_compile/T19271.hs | 11 | ||||
-rw-r--r-- | testsuite/tests/pmcheck/should_compile/T19271.stderr | 9 | ||||
-rw-r--r-- | testsuite/tests/pmcheck/should_compile/all.T | 2 |
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]) |