Skip to content
Snippets Groups Projects
Commit f163b15c authored by jbracker's avatar jbracker Committed by thoughtpolice
Browse files

Fix for ticket #10078: ensure that tcPluginStop is called even in case of type errors

Summary:
Remove unused variable that appeared through the fix for ticket #10078

Merge branch 'master' of git://git.haskell.org/ghc

Added comment with bug ID.

Reviewers: adamgundry, gridaphobe, austin

Reviewed By: austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D667

GHC Trac Issues: #10078

(cherry picked from commit fd581a73)
parent ad628657
No related branches found
No related tags found
No related merge requests found
......@@ -2127,9 +2127,14 @@ withTcPlugins hsc_env m =
case plugins of
[] -> m -- Common fast case
_ -> do (solvers,stops) <- unzip `fmap` mapM startPlugin plugins
res <- updGblEnv (\e -> e { tcg_tc_plugins = solvers }) m
-- This ensures that tcPluginStop is called even if a type
-- error occurs during compilation (Fix of #10078)
eitherRes <- tryM $ do
updGblEnv (\e -> e { tcg_tc_plugins = solvers }) m
mapM_ runTcPluginM stops
return res
case eitherRes of
Left _ -> failM
Right res -> return res
where
startPlugin (TcPlugin start solve stop) =
do s <- runTcPluginM start
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment