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)
|
withCmdFlags flags body = G.gbracket setup teardown (\_ -> body)
|
||||||
where
|
where
|
||||||
setup = do
|
setup = do
|
||||||
dflags <- G.getSessionDynFlags >>= addCmdOpts flags
|
dflags <- G.getSessionDynFlags
|
||||||
void $ G.setSessionDynFlags dflags
|
void $ G.setSessionDynFlags =<< addCmdOpts flags dflags
|
||||||
return dflags
|
return dflags
|
||||||
teardown = void . G.setSessionDynFlags
|
teardown = void . G.setSessionDynFlags
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user