Commit 027bfeb5 authored by simonpj@microsoft.com's avatar simonpj@microsoft.com
Browse files

Improve error message for deprecated flags (Trac #2513)

parent e42d6cb4
...@@ -1464,9 +1464,11 @@ mkFlag turnOn flagPrefix f (name, dynflag, deprecated) ...@@ -1464,9 +1464,11 @@ mkFlag turnOn flagPrefix f (name, dynflag, deprecated)
= Flag (flagPrefix ++ name) (NoArg (f dynflag)) (deprecated turnOn) = Flag (flagPrefix ++ name) (NoArg (f dynflag)) (deprecated turnOn)
deprecatedForLanguage :: String -> Bool -> Deprecated deprecatedForLanguage :: String -> Bool -> Deprecated
deprecatedForLanguage lang turnOn = deprecatedForLanguage lang turn_on
Deprecated ("Use the " ++ prefix ++ lang ++ " language instead") = Deprecated ("use -X" ++ flag ++ " or pragma {-# LANGUAGE " ++ flag ++ "#-} instead")
where prefix = if turnOn then "" else "No" where
flag | turn_on = lang
| otherwise = "No"++lang
-- | These @-f\<blah\>@ flags can all be reversed with @-fno-\<blah\>@ -- | These @-f\<blah\>@ flags can all be reversed with @-fno-\<blah\>@
fFlags :: [(String, DynFlag, Bool -> Deprecated)] fFlags :: [(String, DynFlag, Bool -> Deprecated)]
......
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