diff options
author | Sebastian Graf <sebastian.graf@kit.edu> | 2020-11-18 10:29:25 +0100 |
---|---|---|
committer | Sebastian Graf <sebastian.graf@kit.edu> | 2020-11-18 13:53:43 +0100 |
commit | 9667ab7d2fe7f115902003638a2a9e9a61576fb8 (patch) | |
tree | c6cc6b7c0ff87f41468f16d51727f4009d035d6c /testsuite/tests/pmcheck/complete_sigs/T14059a.stderr | |
parent | fc644b1a643128041cfec25db84e417851e28bab (diff) | |
download | haskell-wip/T18932.tar.gz |
PmCheck: Print types of uncovered patterns (#18932)wip/T18932
In order to avoid confusion as in #18932, we display the type of the
match variables in the non-exhaustiveness warning, e.g.
```
T18932.hs:14:1: warning: [-Wincomplete-patterns]
Pattern match(es) are non-exhaustive
In an equation for ‘g’:
Patterns of type ‘T a’, ‘T a’, ‘T a’ not matched:
(MkT2 _) (MkT1 _) (MkT1 _)
(MkT2 _) (MkT1 _) (MkT2 _)
(MkT2 _) (MkT2 _) (MkT1 _)
(MkT2 _) (MkT2 _) (MkT2 _)
...
|
14 | g (MkT1 x) (MkT1 _) (MkT1 _) = x
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
It also allows us to omit the type signature on wildcard matches which
we previously showed in only some situations, particularly
`-XEmptyCase`.
Fixes #18932.
Diffstat (limited to 'testsuite/tests/pmcheck/complete_sigs/T14059a.stderr')
-rw-r--r-- | testsuite/tests/pmcheck/complete_sigs/T14059a.stderr | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/testsuite/tests/pmcheck/complete_sigs/T14059a.stderr b/testsuite/tests/pmcheck/complete_sigs/T14059a.stderr index 4a52c97dfe..47a92504fb 100644 --- a/testsuite/tests/pmcheck/complete_sigs/T14059a.stderr +++ b/testsuite/tests/pmcheck/complete_sigs/T14059a.stderr @@ -1,8 +1,10 @@ T14059a.hs:20:1: warning: [-Wincomplete-patterns (in -Wextra)] Pattern match(es) are non-exhaustive - In an equation for ‘wibble’: Patterns not matched: SFalse + In an equation for ‘wibble’: + Patterns of type ‘SBool z’ not matched: SFalse T14059a.hs:23:1: warning: [-Wincomplete-patterns (in -Wextra)] Pattern match(es) are non-exhaustive - In an equation for ‘wobble’: Patterns not matched: SFalse + In an equation for ‘wobble’: + Patterns of type ‘SBool z’ not matched: SFalse |