diff options
author | George Karachalias <george.karachalias@gmail.com> | 2016-02-25 15:50:35 +0100 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-02-25 17:18:27 +0100 |
commit | 67393977489942ef41f4f7d4a77076c15db18b92 (patch) | |
tree | e0be5926c048bb2fd1c8b6970723df9d08392b65 /testsuite/tests | |
parent | 073e20ebda73309173b6b6e3ea10164e8808cc79 (diff) | |
download | haskell-67393977489942ef41f4f7d4a77076c15db18b92.tar.gz |
(Alternative way to) address #8710
Issue a separate warning per redundant (or inaccessible) clause.
This way each warning can have more precice location information
(the location of the clause under consideration and not the whole
match).
I thought that this could be too much but actually the number of
such warnings is bound by the number of cases matched against (in
contrast to the non-exhaustive warnings which may be exponentially
more).
Test Plan: validate
Reviewers: simonpj, austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1920
GHC Trac Issues: #8710
Diffstat (limited to 'testsuite/tests')
19 files changed, 96 insertions, 80 deletions
diff --git a/testsuite/tests/deSugar/should_compile/T2395.stderr b/testsuite/tests/deSugar/should_compile/T2395.stderr index a2ed232e78..fe6498d790 100644 --- a/testsuite/tests/deSugar/should_compile/T2395.stderr +++ b/testsuite/tests/deSugar/should_compile/T2395.stderr @@ -1,4 +1,4 @@ -T2395.hs:12:1: warning: - Pattern match(es) are redundant +T2395.hs:13:1: warning: + Pattern match is redundant In an equation for ‘bar’: bar _ = ... diff --git a/testsuite/tests/deSugar/should_compile/T5117.stderr b/testsuite/tests/deSugar/should_compile/T5117.stderr index 954844d5f9..6ef44c81a3 100644 --- a/testsuite/tests/deSugar/should_compile/T5117.stderr +++ b/testsuite/tests/deSugar/should_compile/T5117.stderr @@ -1,4 +1,4 @@ -T5117.hs:15:1: Warning: - Pattern match(es) are redundant +T5117.hs:16:1: warning: + Pattern match is redundant In an equation for ‘f3’: f3 (MyString "a") = ... diff --git a/testsuite/tests/deSugar/should_compile/ds002.stderr b/testsuite/tests/deSugar/should_compile/ds002.stderr index 3810c1b77b..c48e532621 100644 --- a/testsuite/tests/deSugar/should_compile/ds002.stderr +++ b/testsuite/tests/deSugar/should_compile/ds002.stderr @@ -1,10 +1,12 @@ -ds002.hs:7:1: Warning: - Pattern match(es) are redundant - In an equation for ‘f’: - f y = ... - f z = ... +ds002.hs:8:1: warning: + Pattern match is redundant + In an equation for ‘f’: f y = ... -ds002.hs:11:1: Warning: - Pattern match(es) are redundant +ds002.hs:9:1: warning: + Pattern match is redundant + In an equation for ‘f’: f z = ... + +ds002.hs:14:1: warning: + Pattern match is redundant In an equation for ‘g’: g x y z = ... diff --git a/testsuite/tests/deSugar/should_compile/ds003.stderr b/testsuite/tests/deSugar/should_compile/ds003.stderr index fdde26f10e..4851f56b71 100644 --- a/testsuite/tests/deSugar/should_compile/ds003.stderr +++ b/testsuite/tests/deSugar/should_compile/ds003.stderr @@ -1,6 +1,8 @@ -ds003.hs:5:1: Warning: - Pattern match(es) are redundant - In an equation for ‘f’: - f (x : x1 : x2 : x3) ~(y, ys) z = ... - f x y True = ... +ds003.hs:7:1: warning: + Pattern match is redundant + In an equation for ‘f’: f (x : x1 : x2 : x3) ~(y, ys) z = ... + +ds003.hs:8:1: warning: + Pattern match is redundant + In an equation for ‘f’: f x y True = ... diff --git a/testsuite/tests/deSugar/should_compile/ds019.stderr b/testsuite/tests/deSugar/should_compile/ds019.stderr index 0a99306cd2..1761ad9606 100644 --- a/testsuite/tests/deSugar/should_compile/ds019.stderr +++ b/testsuite/tests/deSugar/should_compile/ds019.stderr @@ -1,7 +1,12 @@ -ds019.hs:5:1: Warning: - Pattern match(es) are redundant - In an equation for ‘f’: - f d (j, k) p = ... - f (e, f, g) l q = ... - f h (m, n) r = ... +ds019.hs:6:1: warning: + Pattern match is redundant + In an equation for ‘f’: f d (j, k) p = ... + +ds019.hs:7:1: warning: + Pattern match is redundant + In an equation for ‘f’: f (e, f, g) l q = ... + +ds019.hs:8:1: warning: + Pattern match is redundant + In an equation for ‘f’: f h (m, n) r = ... diff --git a/testsuite/tests/deSugar/should_compile/ds020.stderr b/testsuite/tests/deSugar/should_compile/ds020.stderr index 8775bc6d6e..85abaa4e2a 100644 --- a/testsuite/tests/deSugar/should_compile/ds020.stderr +++ b/testsuite/tests/deSugar/should_compile/ds020.stderr @@ -1,18 +1,20 @@ -ds020.hs:8:1: Warning: - Pattern match(es) are redundant +ds020.hs:9:1: warning: + Pattern match is redundant In an equation for ‘a’: a ~(~[], ~[], ~[]) = ... -ds020.hs:11:1: Warning: - Pattern match(es) are redundant +ds020.hs:12:1: warning: + Pattern match is redundant In an equation for ‘b’: b ~(~x : ~xs : ~ys) = ... -ds020.hs:16:1: Warning: - Pattern match(es) are redundant - In an equation for ‘d’: - d ~(n+43) = ... - d ~(n+999) = ... +ds020.hs:19:1: warning: + Pattern match is redundant + In an equation for ‘d’: d ~(n+43) = ... -ds020.hs:22:1: Warning: - Pattern match(es) are redundant +ds020.hs:20:1: warning: + Pattern match is redundant + In an equation for ‘d’: d ~(n+999) = ... + +ds020.hs:23:1: warning: + Pattern match is redundant In an equation for ‘f’: f x@(~[]) = ... diff --git a/testsuite/tests/deSugar/should_compile/ds022.stderr b/testsuite/tests/deSugar/should_compile/ds022.stderr index 17b62fee02..b5c33bfd5d 100644 --- a/testsuite/tests/deSugar/should_compile/ds022.stderr +++ b/testsuite/tests/deSugar/should_compile/ds022.stderr @@ -1,6 +1,8 @@ -ds022.hs:22:1: Warning: - Pattern match(es) are redundant - In an equation for ‘i’: - i 1 0.011e2 = ... - i 2 2.20000 = ... +ds022.hs:24:1: warning: + Pattern match is redundant + In an equation for ‘i’: i 1 0.011e2 = ... + +ds022.hs:25:1: warning: + Pattern match is redundant + In an equation for ‘i’: i 2 2.20000 = ... diff --git a/testsuite/tests/deSugar/should_compile/ds043.stderr b/testsuite/tests/deSugar/should_compile/ds043.stderr index 0339745bab..c6fb861300 100644 --- a/testsuite/tests/deSugar/should_compile/ds043.stderr +++ b/testsuite/tests/deSugar/should_compile/ds043.stderr @@ -1,4 +1,4 @@ -ds043.hs:8:2: warning: - Pattern match(es) are redundant +ds043.hs:10:3: warning: + Pattern match is redundant In a case alternative: B {e = True, f = False} -> ... diff --git a/testsuite/tests/deSugar/should_compile/ds051.stderr b/testsuite/tests/deSugar/should_compile/ds051.stderr index 4777dfcc2d..0cf4e1d34d 100644 --- a/testsuite/tests/deSugar/should_compile/ds051.stderr +++ b/testsuite/tests/deSugar/should_compile/ds051.stderr @@ -1,12 +1,12 @@ -ds051.hs:6:1: Warning: - Pattern match(es) are redundant +ds051.hs:7:1: warning: + Pattern match is redundant In an equation for ‘f1’: f1 "ab" = ... -ds051.hs:11:1: Warning: - Pattern match(es) are redundant +ds051.hs:12:1: warning: + Pattern match is redundant In an equation for ‘f2’: f2 ('a' : 'b' : []) = ... -ds051.hs:16:1: Warning: - Pattern match(es) are redundant +ds051.hs:17:1: warning: + Pattern match is redundant In an equation for ‘f3’: f3 "ab" = ... diff --git a/testsuite/tests/deSugar/should_compile/ds056.stderr b/testsuite/tests/deSugar/should_compile/ds056.stderr index bcea3fdb07..4d605c7af7 100644 --- a/testsuite/tests/deSugar/should_compile/ds056.stderr +++ b/testsuite/tests/deSugar/should_compile/ds056.stderr @@ -1,4 +1,4 @@ -ds056.hs:8:1: warning: - Pattern match(es) are redundant +ds056.hs:10:1: warning: + Pattern match is redundant In an equation for ‘g’: g _ = ... diff --git a/testsuite/tests/deSugar/should_compile/ds058.stderr b/testsuite/tests/deSugar/should_compile/ds058.stderr index 82f8141280..61aa219245 100644 --- a/testsuite/tests/deSugar/should_compile/ds058.stderr +++ b/testsuite/tests/deSugar/should_compile/ds058.stderr @@ -1,4 +1,4 @@ -ds058.hs:5:7: warning: - Pattern match(es) are redundant +ds058.hs:7:9: warning: + Pattern match is redundant In a case alternative: Just _ -> ... diff --git a/testsuite/tests/driver/werror.stderr b/testsuite/tests/driver/werror.stderr index a20dc5e689..00240a07b3 100644 --- a/testsuite/tests/driver/werror.stderr +++ b/testsuite/tests/driver/werror.stderr @@ -19,12 +19,12 @@ werror.hs:10:1: warning: f :: forall t t1. [t] -> [t1] werror.hs:10:1: warning: - Pattern match(es) are redundant - In an equation for ‘f’: f [] = ... - -werror.hs:10:1: warning: Pattern match(es) are non-exhaustive In an equation for ‘f’: Patterns not matched: (_:_) +werror.hs:11:1: warning: + Pattern match is redundant + In an equation for ‘f’: f [] = ... + <no location info>: error: Failing due to -Werror. diff --git a/testsuite/tests/gadt/T7294.stderr b/testsuite/tests/gadt/T7294.stderr index 94798403a5..a8ea17df80 100644 --- a/testsuite/tests/gadt/T7294.stderr +++ b/testsuite/tests/gadt/T7294.stderr @@ -1,12 +1,12 @@ - -T7294.hs:23:1: warning: - Pattern match(es) are redundant - In an equation for ‘nth’: nth Nil _ = ... - -T7294.hs:25:5: warning: - • Couldn't match type ‘'True’ with ‘'False’ - Inaccessible code in - a pattern with constructor: Nil :: forall a. Vec a 'Zero, - in an equation for ‘nth’ - • In the pattern: Nil - In an equation for ‘nth’: nth Nil _ = undefined +
+T7294.hs:25:1: warning:
+ Pattern match is redundant
+ In an equation for ‘nth’: nth Nil _ = ...
+
+T7294.hs:25:5: warning:
+ • Couldn't match type ‘'True’ with ‘'False’
+ Inaccessible code in
+ a pattern with constructor: Nil :: forall a. Vec a 'Zero,
+ in an equation for ‘nth’
+ • In the pattern: Nil
+ In an equation for ‘nth’: nth Nil _ = undefined
diff --git a/testsuite/tests/ghci/scripts/Defer02.stderr b/testsuite/tests/ghci/scripts/Defer02.stderr index 29feadd24b..87171e0441 100644 --- a/testsuite/tests/ghci/scripts/Defer02.stderr +++ b/testsuite/tests/ghci/scripts/Defer02.stderr @@ -18,7 +18,7 @@ In an equation for ‘b’: b x = x == x ../../typecheck/should_run/Defer01.hs:25:1: warning: - Pattern match(es) have inaccessible right hand side + Pattern match has inaccessible right hand side In an equation for ‘c’: c (C2 x) = ... ../../typecheck/should_run/Defer01.hs:25:4: warning: @@ -103,7 +103,7 @@ k :: (Int ~ Bool) => Int -> Bool ../../typecheck/should_run/Defer01.hs:46:1: warning: - Pattern match(es) are redundant + Pattern match is redundant In an equation for ‘k’: k x = ... ../../typecheck/should_run/Defer01.hs:49:5: warning: diff --git a/testsuite/tests/pmcheck/should_compile/pmc003.stderr b/testsuite/tests/pmcheck/should_compile/pmc003.stderr index 4006b0c042..f1561730a3 100644 --- a/testsuite/tests/pmcheck/should_compile/pmc003.stderr +++ b/testsuite/tests/pmcheck/should_compile/pmc003.stderr @@ -1,3 +1,4 @@ -pmc003.hs:6:1: warning: - Pattern match(es) have inaccessible right hand side + +pmc003.hs:7:1: warning: + Pattern match has inaccessible right hand side In an equation for ‘f’: f True False = ... diff --git a/testsuite/tests/pmcheck/should_compile/pmc004.stderr b/testsuite/tests/pmcheck/should_compile/pmc004.stderr index 53f590dd4e..37f85d5938 100644 --- a/testsuite/tests/pmcheck/should_compile/pmc004.stderr +++ b/testsuite/tests/pmcheck/should_compile/pmc004.stderr @@ -1,3 +1,4 @@ -pmc004.hs:15:1: warning: - Pattern match(es) have inaccessible right hand side + +pmc004.hs:16:1: warning: + Pattern match has inaccessible right hand side In an equation for ‘h’: h _ G1 = ... diff --git a/testsuite/tests/pmcheck/should_compile/pmc005.stderr b/testsuite/tests/pmcheck/should_compile/pmc005.stderr index 940dd3a1e9..ddb4af92ee 100644 --- a/testsuite/tests/pmcheck/should_compile/pmc005.stderr +++ b/testsuite/tests/pmcheck/should_compile/pmc005.stderr @@ -1,7 +1,8 @@ -pmc005.hs:11:1: warning: - Pattern match(es) have inaccessible right hand side - In an equation for ‘foo’: foo _ TList = ... pmc005.hs:11:1: warning: Pattern match(es) are non-exhaustive In an equation for ‘foo’: Patterns not matched: TBool TBool + +pmc005.hs:12:1: warning: + Pattern match has inaccessible right hand side + In an equation for ‘foo’: foo _ TList = ... diff --git a/testsuite/tests/th/TH_repUnboxedTuples.stderr b/testsuite/tests/th/TH_repUnboxedTuples.stderr index 4ae798c5b4..bd647aba19 100644 --- a/testsuite/tests/th/TH_repUnboxedTuples.stderr +++ b/testsuite/tests/th/TH_repUnboxedTuples.stderr @@ -5,5 +5,5 @@ case (# 'b', GHC.Types.False #) of (# _, _ #) -> (# "Three", 3 #) TH_repUnboxedTuples.hs:18:13: warning: - Pattern match(es) are redundant + Pattern match is redundant In a case alternative: (# 'a', True #) -> ... diff --git a/testsuite/tests/typecheck/should_compile/T5490.stderr b/testsuite/tests/typecheck/should_compile/T5490.stderr index 7a32e9d7ad..4a2bb1f887 100644 --- a/testsuite/tests/typecheck/should_compile/T5490.stderr +++ b/testsuite/tests/typecheck/should_compile/T5490.stderr @@ -1,8 +1,8 @@ -T5490.hs:245:15: warning: - Pattern match(es) are redundant +T5490.hs:246:5: warning: + Pattern match is redundant In a case alternative: HDropZero -> ... -T5490.hs:288:3: warning: - Pattern match(es) are redundant +T5490.hs:295:5: warning: + Pattern match is redundant In a case alternative: _ -> ... |