diff options
author | Ömer Sinan Ağacan <omeragacan@gmail.com> | 2017-07-11 15:41:20 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-07-11 16:32:43 -0400 |
commit | 4befb415d7ee63d2b0ecdc2384310dc4b3ccc90a (patch) | |
tree | f0baf272b60c130ca4fe4eaf9e7c39c3fa123abb /testsuite/tests/overloadedrecflds/should_fail | |
parent | 3a163aabe7948d382393e9e81f1239f3e06b222b (diff) | |
download | haskell-4befb415d7ee63d2b0ecdc2384310dc4b3ccc90a.tar.gz |
Mention which -Werror promoted a warning to an error
Previously -Werror or -Werror=flag printed warnings as usual and then
printed
these two lines:
<no location info>: error:
Failing due to -Werror.
This is not ideal: first, it's not clear which flag made one of the
warnings an
error. Second, warning messages are not modified in any way, so there's
no way
to know which warnings caused this error.
With this patch we (1) promote warning messages to error messages if a
relevant
-Werror is enabled (2) mention which -Werror is used during this
promotion.
Previously:
[1 of 1] Compiling Main ( test.hs, test.o )
test.hs:9:10: warning: [-Wincomplete-patterns]
Pattern match(es) are non-exhaustive
In a case alternative: Patterns not matched: (C2 _)
|
9 | sInt s = case s of
| ^^^^^^^^^...
test.hs:12:14: warning: [-Wmissing-fields]
• Fields of ‘Rec’ not initialised: f2
• In the first argument of ‘print’, namely ‘Rec {f1 =
1}’
In the expression: print Rec {f1 = 1}
In an equation for ‘main’: main = print Rec {f1 = 1}
|
12 | main = print Rec{ f1 = 1 }
| ^^^^^^^^^^^^^
<no location info>: error:
Failing due to -Werror.
Now:
[1 of 1] Compiling Main ( test.hs, test.o )
test.hs:9:10: error: [-Wincomplete-patterns,
-Werror=incomplete-patterns]
Pattern match(es) are non-exhaustive
In a case alternative: Patterns not matched: (C2 _)
|
9 | sInt s = case s of
| ^^^^^^^^^...
test.hs:12:14: error: [-Wmissing-fields, -Werror=missing-fields]
• Fields of ‘Rec’ not initialised: f2
• In the first argument of ‘print’, namely ‘Rec {f1 =
1}’
In the expression: print Rec {f1 = 1}
In an equation for ‘main’: main = print Rec {f1 = 1}
|
12 | main = print Rec{ f1 = 1 }
| ^^^^^^^^^^^^^
Test Plan: - Update old tests, add new tests if there aren't any
relevant tests
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3709
Diffstat (limited to 'testsuite/tests/overloadedrecflds/should_fail')
4 files changed, 9 insertions, 21 deletions
diff --git a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail05.stderr b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail05.stderr index e3fbbcfd9e..9dc7af2782 100644 --- a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail05.stderr +++ b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail05.stderr @@ -1,6 +1,3 @@ -overloadedrecfldsfail05.hs:7:16: warning: [-Wunused-top-binds (in -Wextra, -Wunused-binds)] +overloadedrecfldsfail05.hs:7:16: error: [-Wunused-top-binds (in -Wextra, -Wunused-binds), -Werror=unused-top-binds] Defined but not used: ‘foo’ - -<no location info>: error: -Failing due to -Werror. diff --git a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail06.stderr b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail06.stderr index dc8a9d6bbc..3aae5c5061 100644 --- a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail06.stderr +++ b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail06.stderr @@ -10,22 +10,19 @@ OverloadedRecFldsFail06_A.hs:9:59: warning: [-Wunused-top-binds (in -Wextra, -Wu Defined but not used: ‘used_locally’ [2 of 2] Compiling Main ( overloadedrecfldsfail06.hs, overloadedrecfldsfail06.o ) -overloadedrecfldsfail06.hs:7:1: warning: [-Wunused-imports (in -Wextra)] +overloadedrecfldsfail06.hs:7:1: error: [-Wunused-imports (in -Wextra), -Werror=unused-imports] The import of ‘Unused(unused), V(x), U(y), MkV, Unused’ from module ‘OverloadedRecFldsFail06_A’ is redundant -overloadedrecfldsfail06.hs:8:1: warning: [-Wunused-imports (in -Wextra)] +overloadedrecfldsfail06.hs:8:1: error: [-Wunused-imports (in -Wextra), -Werror=unused-imports] The qualified import of ‘OverloadedRecFldsFail06_A’ is redundant except perhaps to import instances from ‘OverloadedRecFldsFail06_A’ To import instances alone, use: import OverloadedRecFldsFail06_A() -overloadedrecfldsfail06.hs:9:1: warning: [-Wunused-imports (in -Wextra)] +overloadedrecfldsfail06.hs:9:1: error: [-Wunused-imports (in -Wextra), -Werror=unused-imports] The qualified import of ‘V(y)’ from module ‘OverloadedRecFldsFail06_A’ is redundant -overloadedrecfldsfail06.hs:10:1: warning: [-Wunused-imports (in -Wextra)] +overloadedrecfldsfail06.hs:10:1: error: [-Wunused-imports (in -Wextra), -Werror=unused-imports] The qualified import of ‘U(x), U’ from module ‘OverloadedRecFldsFail06_A’ is redundant - -<no location info>: error: -Failing due to -Werror. diff --git a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail11.stderr b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail11.stderr index dac6d29ef2..0aa41a2962 100644 --- a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail11.stderr +++ b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail11.stderr @@ -1,9 +1,6 @@ [1 of 2] Compiling OverloadedRecFldsFail11_A ( OverloadedRecFldsFail11_A.hs, OverloadedRecFldsFail11_A.o ) [2 of 2] Compiling Main ( overloadedrecfldsfail11.hs, overloadedrecfldsfail11.o ) -overloadedrecfldsfail11.hs:5:15: warning: [-Wdeprecations (in -Wdefault)] +overloadedrecfldsfail11.hs:5:15: error: [-Wdeprecations (in -Wdefault), -Werror=deprecations] In the use of ‘foo’ (imported from OverloadedRecFldsFail11_A): "Warning on a record field" - -<no location info>: error: -Failing due to -Werror. diff --git a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail12.stderr b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail12.stderr index 7cd9151c56..e17c9f8573 100644 --- a/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail12.stderr +++ b/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail12.stderr @@ -1,17 +1,14 @@ [1 of 2] Compiling OverloadedRecFldsFail12_A ( OverloadedRecFldsFail12_A.hs, OverloadedRecFldsFail12_A.o ) [2 of 2] Compiling Main ( overloadedrecfldsfail12.hs, overloadedrecfldsfail12.o ) -overloadedrecfldsfail12.hs:10:11: warning: [-Wdeprecations (in -Wdefault)] +overloadedrecfldsfail12.hs:10:11: error: [-Wdeprecations (in -Wdefault), -Werror=deprecations] In the use of ‘foo’ (imported from OverloadedRecFldsFail12_A): "Deprecated foo" -overloadedrecfldsfail12.hs:10:20: warning: [-Wdeprecations (in -Wdefault)] +overloadedrecfldsfail12.hs:10:20: error: [-Wdeprecations (in -Wdefault), -Werror=deprecations] In the use of ‘bar’ (imported from OverloadedRecFldsFail12_A): "Deprecated bar" -overloadedrecfldsfail12.hs:13:5: warning: [-Wdeprecations (in -Wdefault)] +overloadedrecfldsfail12.hs:13:5: error: [-Wdeprecations (in -Wdefault), -Werror=deprecations] In the use of ‘foo’ (imported from OverloadedRecFldsFail12_A): "Deprecated foo" - -<no location info>: error: -Failing due to -Werror. |