Reset DynFlags properly in `withCmdFlags` teardown
This commit is contained in:
parent
6dd8b34e44
commit
4fcef0cb2b
|
@ -88,8 +88,8 @@ withCmdFlags :: GhcMonad m => [GHCOption] -> m a -> m a
|
|||
withCmdFlags flags body = G.gbracket setup teardown (\_ -> body)
|
||||
where
|
||||
setup = do
|
||||
dflags <- G.getSessionDynFlags >>= addCmdOpts flags
|
||||
void $ G.setSessionDynFlags dflags
|
||||
dflags <- G.getSessionDynFlags
|
||||
void $ G.setSessionDynFlags =<< addCmdOpts flags dflags
|
||||
return dflags
|
||||
teardown = void . G.setSessionDynFlags
|
||||
|
||||
|
|
Loading…
Reference in New Issue