diff options
-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 + } + } } } } |