Commit e9b0bf4e authored by Adam C. Foltzer's avatar Adam C. Foltzer Committed by Ben Gamari

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
parent 75321ffa
......@@ -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
......
{-# LANGUAGE ImplicitParams #-}
{-# OPTIONS_GHC -Wredundant-constraints #-}
f :: (?file1 :: String) => IO ()
f = putStrLn $ "f2: "
......
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 ()
{-# 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
{-# LANGUAGE GADTs #-}
{-# OPTIONS_GHC -Wredundant-constraints #-}
module T9939 where
......
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
......@@ -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, [''])
......@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment