Skip to content
Snippets Groups Projects
Commit ec1e12b3 authored by Simon Marlow's avatar Simon Marlow Committed by Ian Lynagh
Browse files

show warning flags in :set (lost in the recent dopt->wopt change,

noticed by test ghci024)
parent a754466d
Branches
Tags
No related merge requests found
...@@ -1609,16 +1609,28 @@ setCmd "" ...@@ -1609,16 +1609,28 @@ setCmd ""
)) ))
dflags <- getDynFlags dflags <- getDynFlags
liftIO $ putStrLn (showSDoc ( liftIO $ putStrLn (showSDoc (
vcat (text "GHCi-specific dynamic flag settings:" text "GHCi-specific dynamic flag settings:" $$
:map (flagSetting dflags) ghciFlags) nest 2 (vcat (map (flagSetting dflags) ghciFlags))
)) ))
liftIO $ putStrLn (showSDoc ( liftIO $ putStrLn (showSDoc (
vcat (text "other dynamic, non-language, flag settings:" text "other dynamic, non-language, flag settings:" $$
:map (flagSetting dflags) others) nest 2 (vcat (map (flagSetting dflags) others))
)) ))
liftIO $ putStrLn (showSDoc (
text "warning settings:" $$
nest 2 (vcat (map (warnSetting dflags) DynFlags.fWarningFlags))
))
where flagSetting dflags (str, _, f, _) where flagSetting dflags (str, _, f, _)
| dopt f dflags = text " " <> text "-f" <> text str | dopt f dflags = fstr str
| otherwise = text " " <> text "-fno-" <> text str | otherwise = fnostr str
warnSetting dflags (str, _, f, _)
| wopt f dflags = fstr str
| otherwise = fnostr str
fstr str = text "-f" <> text str
fnostr str = text "-fno-" <> text str
(ghciFlags,others) = partition (\(_, _, f, _) -> f `elem` flags) (ghciFlags,others) = partition (\(_, _, f, _) -> f `elem` flags)
DynFlags.fFlags DynFlags.fFlags
flags = [Opt_PrintExplicitForalls flags = [Opt_PrintExplicitForalls
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment