summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2016-02-27 18:26:32 +0100
committerHerbert Valerio Riedel <hvr@gnu.org>2016-02-27 18:27:35 +0100
commit82f200b74ac1ea8c5593e2909c0033eb251eeaf2 (patch)
tree9722557ea4b404a31c3041c4929b4e2e31f21bb7
parent869d9c62d8329022f9f5504a92d2d74efec4f2e8 (diff)
downloadhaskell-82f200b74ac1ea8c5593e2909c0033eb251eeaf2.tar.gz
Annotate `[-Wredundant-constraints]` in warnings (re #10752)
This was missed in bb5afd3c274011c5ea302210b4c290ec1f83209c
-rw-r--r--compiler/typecheck/TcErrors.hs4
-rw-r--r--testsuite/tests/typecheck/should_compile/T10632.stderr2
-rw-r--r--testsuite/tests/typecheck/should_compile/T9939.stderr8
-rw-r--r--testsuite/tests/warnings/should_compile/PluralS.stderr4
4 files changed, 9 insertions, 9 deletions
diff --git a/compiler/typecheck/TcErrors.hs b/compiler/typecheck/TcErrors.hs
index a17e80af07..c78f07381f 100644
--- a/compiler/typecheck/TcErrors.hs
+++ b/compiler/typecheck/TcErrors.hs
@@ -343,13 +343,13 @@ warnRedundantConstraints ctxt env info ev_vars
addErrCtxt (text "In" <+> ppr info) $
do { env <- getLclEnv
; msg <- mkErrorReport ctxt env (important doc)
- ; reportWarning NoReason msg }
+ ; reportWarning (Reason Opt_WarnRedundantConstraints) msg }
| otherwise -- But for InstSkol there already *is* a surrounding
-- "In the instance declaration for Eq [a]" context
-- and we don't want to say it twice. Seems a bit ad-hoc
= do { msg <- mkErrorReport ctxt env (important doc)
- ; reportWarning NoReason msg }
+ ; reportWarning (Reason Opt_WarnRedundantConstraints) msg }
where
doc = text "Redundant constraint" <> plural redundant_evs <> colon
<+> pprEvVarTheta redundant_evs
diff --git a/testsuite/tests/typecheck/should_compile/T10632.stderr b/testsuite/tests/typecheck/should_compile/T10632.stderr
index 8e72f42971..211972df0a 100644
--- a/testsuite/tests/typecheck/should_compile/T10632.stderr
+++ b/testsuite/tests/typecheck/should_compile/T10632.stderr
@@ -1,5 +1,5 @@
-T10632.hs:3:1: warning:
+T10632.hs:3:1: warning: [-Wredundant-constraints]
• Redundant constraint: ?file1::String
• In the type signature for:
f :: (?file1::String) => IO ()
diff --git a/testsuite/tests/typecheck/should_compile/T9939.stderr b/testsuite/tests/typecheck/should_compile/T9939.stderr
index 106335e8ba..a10066b606 100644
--- a/testsuite/tests/typecheck/should_compile/T9939.stderr
+++ b/testsuite/tests/typecheck/should_compile/T9939.stderr
@@ -1,20 +1,20 @@
-T9939.hs:5:1: warning:
+T9939.hs:5:1: warning: [-Wredundant-constraints]
• Redundant constraint: Eq a
• In the type signature for:
f1 :: (Eq a, Ord a) => a -> a -> Bool
-T9939.hs:9:1: warning:
+T9939.hs:9:1: warning: [-Wredundant-constraints]
• Redundant constraint: Eq a
• In the type signature for:
f2 :: (Eq a, Ord a) => a -> a -> Bool
-T9939.hs:13:1: warning:
+T9939.hs:13:1: warning: [-Wredundant-constraints]
• Redundant constraint: Eq b
• In the type signature for:
f3 :: (Eq a, a ~ b, Eq b) => a -> b -> Bool
-T9939.hs:20:1: warning:
+T9939.hs:20:1: warning: [-Wredundant-constraints]
• Redundant constraint: Eq a
• In the type signature for:
f4 :: (Eq a, Eq b) => a -> b -> Equal a b -> Bool
diff --git a/testsuite/tests/warnings/should_compile/PluralS.stderr b/testsuite/tests/warnings/should_compile/PluralS.stderr
index a06ab5eb6c..9289a0ba9a 100644
--- a/testsuite/tests/warnings/should_compile/PluralS.stderr
+++ b/testsuite/tests/warnings/should_compile/PluralS.stderr
@@ -15,12 +15,12 @@ PluralS.hs:17:29: warning: [-Wtype-defaults (in -Wall)]
In an equation for ‘defaultingNumAndShow’:
defaultingNumAndShow = show 123
-PluralS.hs:23:1: warning:
+PluralS.hs:23:1: warning: [-Wredundant-constraints]
• Redundant constraint: Num a
• In the type signature for:
redundantNum :: (Num a, Num a) => a
-PluralS.hs:26:1: warning:
+PluralS.hs:26:1: warning: [-Wredundant-constraints]
• Redundant constraints: (Show a, Num a, Eq a, Eq a)
• In the type signature for:
redundantMultiple :: (Num a, Show a, Num a, Eq a, Eq a) => a