summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2021-09-06 14:57:20 +0200
committerBen Gamari <ben@smart-cactus.org>2021-09-06 22:54:07 -0400
commit644424afc581569ed559f88af5b83e9473df5786 (patch)
tree2eeb4ecca70fd63a229195f2ffb51aefb2086a50
parent1571772e37b587495dea7f2e0c575c70141027d8 (diff)
downloadhaskell-644424afc581569ed559f88af5b83e9473df5786.tar.gz
GHCi: don't discard plugins on reload (#20335)
Fix regression introduced in ecfd0278 (cherry picked from commit 64c4f657dc2455043a18d112ad235c2c6c62aaf9)
-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 0d30d81de9..dd1d1b0267 100644
--- a/compiler/GHC/Driver/Make.hs
+++ b/compiler/GHC/Driver/Make.hs
@@ -730,17 +730,20 @@ discardProg hsc_env
= discardIC $ hsc_env { hsc_mod_graph = emptyMG
, hsc_HPT = emptyHomePackageTable }
--- | 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