summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam C. Foltzer <acfoltzer@galois.com>2016-08-31 16:02:53 -0400
committerBen Gamari <ben@smart-cactus.org>2016-08-31 16:34:46 -0400
commite9b0bf4ed52114852dbaf6af556514610a895f88 (patch)
tree95e1d91e223f5e14869abf463ecb795e8043c528
parent75321ffa25ad377fa200485a7d58ad32a87e7d65 (diff)
downloadhaskell-e9b0bf4ed52114852dbaf6af556514610a895f88.tar.gz
Remove redundant-constraints from -Wall (#10635)
Removes -Wredundant-constraints from -Wall, as per the discussion in #10635. Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2498 GHC Trac Issues: #10635
-rw-r--r--compiler/main/DynFlags.hs3
-rw-r--r--testsuite/tests/typecheck/should_compile/T10632.hs1
-rw-r--r--testsuite/tests/typecheck/should_compile/T10632.stderr2
-rw-r--r--testsuite/tests/typecheck/should_compile/T10635.hs22
-rw-r--r--testsuite/tests/typecheck/should_compile/T9939.hs1
-rw-r--r--testsuite/tests/typecheck/should_compile/T9939.stderr8
-rw-r--r--testsuite/tests/typecheck/should_compile/all.T1
-rw-r--r--testsuite/tests/warnings/should_compile/PluralS.stderr4
8 files changed, 33 insertions, 9 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 065a7329c6..fa471d38a1 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -3958,8 +3958,7 @@ minusWallOpts
Opt_WarnUnusedDoBind,
Opt_WarnTrustworthySafe,
Opt_WarnUntickedPromotedConstructors,
- Opt_WarnMissingPatternSynonymSignatures,
- Opt_WarnRedundantConstraints
+ Opt_WarnMissingPatternSynonymSignatures
]
-- | Things you get with -Weverything, i.e. *all* known warnings flags
diff --git a/testsuite/tests/typecheck/should_compile/T10632.hs b/testsuite/tests/typecheck/should_compile/T10632.hs
index 5c1a1778af..03478fc9d4 100644
--- a/testsuite/tests/typecheck/should_compile/T10632.hs
+++ b/testsuite/tests/typecheck/should_compile/T10632.hs
@@ -1,4 +1,5 @@
{-# LANGUAGE ImplicitParams #-}
+{-# OPTIONS_GHC -Wredundant-constraints #-}
f :: (?file1 :: String) => IO ()
f = putStrLn $ "f2: "
diff --git a/testsuite/tests/typecheck/should_compile/T10632.stderr b/testsuite/tests/typecheck/should_compile/T10632.stderr
index c3d112f6bf..1733f0ae7a 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: [-Wredundant-constraints (in -Wall)]
+T10632.hs:4: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/T10635.hs b/testsuite/tests/typecheck/should_compile/T10635.hs
new file mode 100644
index 0000000000..1382466f2a
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T10635.hs
@@ -0,0 +1,22 @@
+{-# LANGUAGE GADTs #-}
+
+module T9939 where
+
+f1 :: (Eq a, Ord a) => a -> a -> Bool
+-- Eq a redundant
+f1 x y = (x == y) && (x > y)
+
+f2 :: (Eq a, Ord a) => a -> a -> Bool
+-- Ord a redundant, but Eq a is reported
+f2 x y = (x == y)
+
+f3 :: (Eq a, a ~ b, Eq b) => a -> b -> Bool
+-- Eq b redundant
+f3 x y = x==y
+
+data Equal a b where
+ EQUAL :: Equal a a
+
+f4 :: (Eq a, Eq b) => a -> b -> Equal a b -> Bool
+-- Eq b redundant
+f4 x y EQUAL = y==y
diff --git a/testsuite/tests/typecheck/should_compile/T9939.hs b/testsuite/tests/typecheck/should_compile/T9939.hs
index 4ae370b147..3ceab5167a 100644
--- a/testsuite/tests/typecheck/should_compile/T9939.hs
+++ b/testsuite/tests/typecheck/should_compile/T9939.hs
@@ -1,4 +1,5 @@
{-# LANGUAGE GADTs #-}
+{-# OPTIONS_GHC -Wredundant-constraints #-}
module T9939 where
diff --git a/testsuite/tests/typecheck/should_compile/T9939.stderr b/testsuite/tests/typecheck/should_compile/T9939.stderr
index d10c51016d..c4866790c8 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: [-Wredundant-constraints (in -Wall)]
+T9939.hs:6: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: [-Wredundant-constraints (in -Wall)]
+T9939.hs:10: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: [-Wredundant-constraints (in -Wall)]
+T9939.hs:14: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: [-Wredundant-constraints (in -Wall)]
+T9939.hs:21: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/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index 4bebf97038..b9f452d15c 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -537,4 +537,5 @@ test('T12185', normal, compile, [''])
test('T12133', normal, compile, [''])
test('T12381', normal, compile, [''])
test('T12082', normal, compile, [''])
+test('T10635', normal, compile, [''])
test('T12170b', normal, compile, [''])
diff --git a/testsuite/tests/warnings/should_compile/PluralS.stderr b/testsuite/tests/warnings/should_compile/PluralS.stderr
index b1ceab6762..416ebb815b 100644
--- a/testsuite/tests/warnings/should_compile/PluralS.stderr
+++ b/testsuite/tests/warnings/should_compile/PluralS.stderr
@@ -14,12 +14,12 @@ PluralS.hs:17:24: warning: [-Wtype-defaults (in -Wall)]
In an equation for ‘defaultingNumAndShow’:
defaultingNumAndShow = show 123
-PluralS.hs:23:1: warning: [-Wredundant-constraints (in -Wall)]
+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: [-Wredundant-constraints (in -Wall)]
+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