diff options
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/pmcheck/should_compile/T18572.hs | 12 | ||||
-rw-r--r-- | testsuite/tests/pmcheck/should_compile/T18572.stderr | 16 | ||||
-rw-r--r-- | testsuite/tests/pmcheck/should_compile/all.T | 6 |
3 files changed, 32 insertions, 2 deletions
diff --git a/testsuite/tests/pmcheck/should_compile/T18572.hs b/testsuite/tests/pmcheck/should_compile/T18572.hs new file mode 100644 index 0000000000..9a37de4813 --- /dev/null +++ b/testsuite/tests/pmcheck/should_compile/T18572.hs @@ -0,0 +1,12 @@ +{-# OPTIONS_GHC -Wincomplete-uni-patterns -Wincomplete-patterns -fforce-recomp #-} +{-# LANGUAGE DataKinds, KindSignatures, GADTs #-} + +module T18572 where + +True = True + +data SBool (b :: Bool) where + STrue :: SBool True + SFalse :: SBool False + +STrue = SFalse diff --git a/testsuite/tests/pmcheck/should_compile/T18572.stderr b/testsuite/tests/pmcheck/should_compile/T18572.stderr new file mode 100644 index 0000000000..15d9f7c5b5 --- /dev/null +++ b/testsuite/tests/pmcheck/should_compile/T18572.stderr @@ -0,0 +1,16 @@ + +T18572.hs:12:1: warning: [-Winaccessible-code (in -Wdefault)] + • Couldn't match type ‘'False’ with ‘'True’ + Inaccessible code in + a pattern with constructor: STrue :: SBool 'True, + in a pattern binding + • In the pattern: STrue + In a pattern binding: STrue = SFalse + +T18572.hs:12:1: warning: [-Woverlapping-patterns (in -Wdefault)] + Pattern match is redundant + In a pattern binding: STrue = ... + +T18572.hs:12:1: warning: [-Wincomplete-uni-patterns] + Pattern match(es) are non-exhaustive + In a pattern binding: Patterns not matched: SFalse diff --git a/testsuite/tests/pmcheck/should_compile/all.T b/testsuite/tests/pmcheck/should_compile/all.T index 51fb76b078..ee69cf176a 100644 --- a/testsuite/tests/pmcheck/should_compile/all.T +++ b/testsuite/tests/pmcheck/should_compile/all.T @@ -102,6 +102,8 @@ test('T17234', normal, compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns']) test('T17248', normal, compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns']) +test('T17340', normal, compile, + ['-Wredundant-bang-patterns']) test('T17357', expect_broken(17357), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns']) test('T17376', normal, compile, @@ -124,8 +126,8 @@ test('T18478', collect_compiler_stats('bytes allocated',10), compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns']) test('T18533', normal, compile, ['-fwarn-incomplete-patterns -fwarn-overlapping-patterns']) -test('T17340', normal, compile, - ['-Wredundant-bang-patterns']) +test('T18572', normal, compile, + ['-fwarn-incomplete-patterns -fwarn-incomplete-uni-patterns -fwarn-overlapping-patterns']) # Other tests test('pmc001', [], compile, |