diff options
author | George Karachalias <george.karachalias@gmail.com> | 2017-02-02 13:51:33 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-02-02 14:20:45 -0500 |
commit | b10353216f5ff5d5e410334e4c118b6695b628d0 (patch) | |
tree | 3568dc551cc049e1c0a4901dbe76e062ef4b16ed /testsuite/tests/pmcheck/should_compile/EmptyCase010.stderr | |
parent | d8ac64e782b8543e5a525c7bb738620bd09aa398 (diff) | |
download | haskell-b10353216f5ff5d5e410334e4c118b6695b628d0.tar.gz |
Exhaustiveness check for EmptyCase (Trac #10746)
Empty case expressions have strict semantics so the problem boils down
to inhabitation checking for the type of the scrutinee. 3 main functions
added:
- pmTopNormaliseType_maybe for the normalisation of the scrutinee type
- inhabitationCandidates for generating the possible patterns of the
appropriate type
- checkEmptyCase' to filter out the candidates that give rise to
unsatisfiable constraints.
See Note [Checking EmptyCase Expressions] in Check
and Note [Type normalisation for EmptyCase] in FamInstEnv
Test Plan: validate
Reviewers: simonpj, goldfire, dfeuer, austin, bgamari
Reviewed By: bgamari
Subscribers: mpickering, thomie
Differential Revision: https://phabricator.haskell.org/D2105
GHC Trac Issues: #10746
Diffstat (limited to 'testsuite/tests/pmcheck/should_compile/EmptyCase010.stderr')
-rw-r--r-- | testsuite/tests/pmcheck/should_compile/EmptyCase010.stderr | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/testsuite/tests/pmcheck/should_compile/EmptyCase010.stderr b/testsuite/tests/pmcheck/should_compile/EmptyCase010.stderr new file mode 100644 index 0000000000..d4ccce34bb --- /dev/null +++ b/testsuite/tests/pmcheck/should_compile/EmptyCase010.stderr @@ -0,0 +1,41 @@ +EmptyCase010.hs:22:7: warning: [-Wincomplete-patterns (in -Wextra)] + Pattern match(es) are non-exhaustive + In a case alternative: + Patterns not matched: + (Baz MkGC1) + (Baz (MkGC2 _)) + +EmptyCase010.hs:26:7: warning: [-Wincomplete-patterns (in -Wextra)] + Pattern match(es) are non-exhaustive + In a case alternative: Patterns not matched: (Baz MkGC1) + +EmptyCase010.hs:35:7: warning: [-Wincomplete-patterns (in -Wextra)] + Pattern match(es) are non-exhaustive + In a case alternative: + Patterns not matched: + (Baz MkGD1) + (Baz MkGD3) + +EmptyCase010.hs:39:9: warning: [-Wincomplete-patterns (in -Wextra)] + Pattern match(es) are non-exhaustive + In a case alternative: Patterns not matched: (Baz MkGD3) + +EmptyCase010.hs:43:7: warning: [-Wincomplete-patterns (in -Wextra)] + Pattern match(es) are non-exhaustive + In a case alternative: + Patterns not matched: + (Baz MkGD1) + (Baz MkGD2) + (Baz MkGD3) + +EmptyCase010.hs:55:7: warning: [-Wincomplete-patterns (in -Wextra)] + Pattern match(es) are non-exhaustive + In a case alternative: Patterns not matched: _ :: Baz (DC ()) a + +EmptyCase010.hs:67:7: warning: [-Wincomplete-patterns (in -Wextra)] + Pattern match(es) are non-exhaustive + In a case alternative: Patterns not matched: (Baz MkDC2) + +EmptyCase010.hs:71:9: warning: [-Wincomplete-patterns (in -Wextra)] + Pattern match(es) are non-exhaustive + In a case alternative: Patterns not matched: _ :: Baz f a |