diff options
author | alexbiehl <alexbiehl@gmail.com> | 2021-01-08 10:43:39 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-02-22 18:26:53 -0500 |
commit | b068103d60fd67708916ca5e778f5f833fcc34da (patch) | |
tree | 7e4441000a7664961b909a41a71207ec889dded2 | |
parent | e1f133bf5ee30f25a94b4f3bf4d26d1a9381f0d9 (diff) | |
download | haskell-b068103d60fd67708916ca5e778f5f833fcc34da.tar.gz |
Ensure tcg_env is up-to-date when running typechecker plugins
-rw-r--r-- | compiler/GHC/Tc/Module.hs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/compiler/GHC/Tc/Module.hs b/compiler/GHC/Tc/Module.hs index f250a8e82d..dfc867c80a 100644 --- a/compiler/GHC/Tc/Module.hs +++ b/compiler/GHC/Tc/Module.hs @@ -329,10 +329,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 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 tcg_env + ; -- Dump output and return + tcDump tcg_env + ; return tcg_env + } + } } } } |