Commit f3be304a authored by Martin Ceresa's avatar Martin Ceresa Committed by Matthew Pickering

Don't suggest deprecated flags in error messages

When looking up flags, we make sure to lookup the non-deprecated flags first
by ordering the list of flags.

Reviewers: bgamari, austin, mpickering

Reviewed By: mpickering

Subscribers: mpickering, thomie

Differential Revision:

GHC Trac Issues: #12574
parent e41b9c61
......@@ -3236,7 +3236,15 @@ flagSpecOf flag = listToMaybe $ filter check wWarningFlags
-- | These @-W\<blah\>@ flags can all be reversed with @-Wno-\<blah\>@
wWarningFlags :: [FlagSpec WarningFlag]
wWarningFlags = map snd wWarningFlagsDeps
wWarningFlags = wWarningFlagsDepsCurrent ++ wWarningFlagsDepsDeprecated
deprecatedWFlags = filter (not . isCurr) wWarningFlagsDeps
currentWFlags = filter isCurr wWarningFlagsDeps
wWarningFlagsDepsCurrent = map snd currentWFlags
wWarningFlagsDepsDeprecated = map snd deprecatedWFlags
isCurr ( Deprecated , _ ) = False
isCurr _ = True
wWarningFlagsDeps :: [(Deprecation, FlagSpec WarningFlag)]
wWarningFlagsDeps = [
T11077.hs:3:1: warning: [-Wmissing-exported-sigs]
T11077.hs:3:1: warning: [-Wmissing-exported-signatures]
Top-level binding with no type signature: foo :: a
T12574.hs:3:1: warning: [-Wmissing-local-signatures]
Polymorphic local binding with no type signature: :: forall t. t -> t
T2526.hs:4:1: warning: [-Wmissing-exported-sigs]
T2526.hs:4:1: warning: [-Wmissing-exported-signatures]
Top-level binding with no type signature: foo :: Integer
......@@ -13,6 +13,9 @@ test('T11128', normal, compile, [''])
test('T11128b', normal, compile, [''])
test('PluralS', normal, compile, [''])
# T12574 Test that suggest current flag over deprecated
test('T12574',normal, compile, ['-fwarn-missing-local-signatures'])
'DeprM.o', 'DeprU.o',
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