diff options
author | alexbiehl <alexbiehl@gmail.com> | 2021-01-08 10:43:39 +0100 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2021-04-07 15:04:04 -0400 |
commit | eb10bdff8c4dc62aa53ec446ed2038311b169312 (patch) | |
tree | a474fea779e29d3c2fc8c0f156486340e4de33d2 | |
parent | 21c8e24b177683b4c71162d808ec6be3a843128c (diff) | |
download | haskell-eb10bdff8c4dc62aa53ec446ed2038311b169312.tar.gz |
Ensure tcg_env is up-to-date when running typechecker plugins
(cherry picked from commit b068103d60fd67708916ca5e778f5f833fcc34da)
-rw-r--r-- | compiler/typecheck/TcRnDriver.hs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/compiler/typecheck/TcRnDriver.hs b/compiler/typecheck/TcRnDriver.hs index e70037dede..822f522cb6 100644 --- a/compiler/typecheck/TcRnDriver.hs +++ b/compiler/typecheck/TcRnDriver.hs @@ -299,10 +299,14 @@ tcRnModuleTcRnM hsc_env mod_sum reportUnusedNames tcg_env hsc_src ; -- add extra source files to tcg_dependent_files addDependentFiles src_files - ; tcg_env <- runTypecheckerPlugin mod_sum hsc_env tcg_env - ; -- Dump output and return - tcDump tcg_env - ; return tcg_env } + -- Ensure plugins run with the same tcg_env that we pass in + ; setGblEnv tcg_env + $ do { tcg_env <- runTypecheckerPlugin mod_sum hsc_env tcg_env + ; -- Dump output and return + tcDump tcg_env + ; return tcg_env + } + } } } } |