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