summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2021-09-06 14:57:20 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-09-06 22:59:10 -0400
commit3fb1afea019422292954785575902c62473e93e3 (patch)
tree4a2cc1d3cec4c814ac3999d540eed294d5f3dbfb
parent89820293c0559dc744704d0bf3370a035adb17ea (diff)
downloadhaskell-3fb1afea019422292954785575902c62473e93e3.tar.gz
GHCi: don't discard plugins on reload (#20335)
Fix regression introduced in ecfd0278
-rw-r--r--compiler/GHC/Driver/Make.hs11
1 files changed, 7 insertions, 4 deletions
diff --git a/compiler/GHC/Driver/Make.hs b/compiler/GHC/Driver/Make.hs
index e1ba4ea5d8..ef5ce36fef 100644
--- a/compiler/GHC/Driver/Make.hs
+++ b/compiler/GHC/Driver/Make.hs
@@ -658,17 +658,20 @@ discardProg hsc_env
$ hscUpdateHPT (const emptyHomePackageTable)
$ hsc_env { hsc_mod_graph = emptyMG }
--- | Discard the contents of the InteractiveContext, but keep the DynFlags.
--- It will also keep ic_int_print and ic_monad if their names are from
--- external packages.
+-- | Discard the contents of the InteractiveContext, but keep the DynFlags and
+-- the loaded plugins. It will also keep ic_int_print and ic_monad if their
+-- names are from external packages.
discardIC :: HscEnv -> HscEnv
discardIC hsc_env
= hsc_env { hsc_IC = empty_ic { ic_int_print = new_ic_int_print
- , ic_monad = new_ic_monad } }
+ , ic_monad = new_ic_monad
+ , ic_plugins = old_plugins
+ } }
where
-- Force the new values for ic_int_print and ic_monad to avoid leaking old_ic
!new_ic_int_print = keep_external_name ic_int_print
!new_ic_monad = keep_external_name ic_monad
+ !old_plugins = ic_plugins old_ic
dflags = ic_dflags old_ic
old_ic = hsc_IC hsc_env
empty_ic = emptyInteractiveContext dflags