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/deSugar/should_compile/T14546a.stderr | |
parent | fc644b1a643128041cfec25db84e417851e28bab (diff) | |
download | haskell-9667ab7d2fe7f115902003638a2a9e9a61576fb8.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/deSugar/should_compile/T14546a.stderr')
-rw-r--r-- | testsuite/tests/deSugar/should_compile/T14546a.stderr | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/testsuite/tests/deSugar/should_compile/T14546a.stderr b/testsuite/tests/deSugar/should_compile/T14546a.stderr index 5918a45cc7..684501223e 100644 --- a/testsuite/tests/deSugar/should_compile/T14546a.stderr +++ b/testsuite/tests/deSugar/should_compile/T14546a.stderr @@ -33,7 +33,7 @@ T14546a.hs:21:7: warning: [-Woverlapping-patterns (in -Wdefault)] T14546a.hs:23:4: warning: [-Wincomplete-patterns (in -Wextra)] Pattern match(es) are non-exhaustive - In a case alternative: Patterns not matched: 0 + In a case alternative: Patterns of type ‘Integer’ not matched: 0 T14546a.hs:24:7: warning: [-Woverlapping-patterns (in -Wdefault)] Pattern match is redundant @@ -45,7 +45,7 @@ T14546a.hs:25:7: warning: [-Woverlapping-patterns (in -Wdefault)] T14546a.hs:27:4: warning: [-Wincomplete-patterns (in -Wextra)] Pattern match(es) are non-exhaustive - In a case alternative: Patterns not matched: 3 + In a case alternative: Patterns of type ‘Integer’ not matched: 3 T14546a.hs:28:7: warning: [-Woverlapping-patterns (in -Wdefault)] Pattern match is redundant |