[Git][ghc/ghc][master] Ensure TcM plugins are only initialised once
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 1350271b by sheaf at 2026-04-27T09:32:53-04:00 Ensure TcM plugins are only initialised once This commit ensures we keep TcM plugins (typechecker plugins, defaulting plugins and hole fit plugins) running all the way through desugaring, instead of stopping them at the end of typechecking. To do this, the "stop" actions of TcPlugin and DefaultingPlugin are split into two: one for the "post-typecheck" action, and one for the final shutdown action (after desugaring). This allows the plugins to be invoked by the pattern match checker (during desugaring) without having to be repeatedly re-initialised and stopped, fixing #26839. In the process, this commit modifies 'initTc' and 'initTcInteractive', adding an extra argument that describes whether to start/stop the 'TcM' plugins. See Note [Stop TcM plugins after desugaring] for an overview. - - - - - 58 changed files: - + changelog.d/tcplugin_init.md - + changelog.d/tcplugins-pmc.md - + changelog.d/typecheckModule-API.md - + changelog.d/withTcPlugins.md - compiler/GHC.hs - compiler/GHC/Driver/Env/Types.hs - compiler/GHC/Driver/Main.hs - compiler/GHC/Driver/Pipeline.hs - compiler/GHC/Driver/Pipeline/Execute.hs - compiler/GHC/Driver/Pipeline/Monad.hs - compiler/GHC/Driver/Pipeline/Phases.hs - compiler/GHC/HsToCore.hs - compiler/GHC/HsToCore/Monad.hs - compiler/GHC/HsToCore/Types.hs - compiler/GHC/Runtime/Eval.hs - compiler/GHC/Runtime/Heap/Inspect.hs - compiler/GHC/Runtime/Loader.hs - compiler/GHC/Tc/Errors/Hole.hs - compiler/GHC/Tc/Module.hs - compiler/GHC/Tc/Solver/Default.hs - compiler/GHC/Tc/Solver/Rewrite.hs - compiler/GHC/Tc/Solver/Solve.hs - compiler/GHC/Tc/Types.hs - compiler/GHC/Tc/Utils/Backpack.hs - compiler/GHC/Tc/Utils/Monad.hs - docs/users_guide/extending_ghc.rst - ghc/GHCi/UI/Info.hs - testsuite/tests/ghc-api/T26910.hs - testsuite/tests/ghc-api/T6145.hs - testsuite/tests/ghci/should_run/tc-plugin-ghci/TcPluginGHCi.hs - testsuite/tests/plugins/defaulting-plugin/DefaultInterference.hs - testsuite/tests/plugins/defaulting-plugin/DefaultInvalid.hs - testsuite/tests/plugins/defaulting-plugin/DefaultLifted.hs - testsuite/tests/plugins/defaulting-plugin/DefaultMultiParam.hs - testsuite/tests/plugins/echo-plugin/Echo.hs - testsuite/tests/quasiquotation/T7918.hs - testsuite/tests/tcplugins/Common.hs - testsuite/tests/tcplugins/RewritePerfPlugin.hs - testsuite/tests/tcplugins/T11462_Plugin.hs - testsuite/tests/tcplugins/T11525_Plugin.hs - testsuite/tests/tcplugins/T26395_Plugin.hs - + testsuite/tests/tcplugins/TcPlugin_InitStop_Ghci.hs - + testsuite/tests/tcplugins/TcPlugin_InitStop_Ghci.script - + testsuite/tests/tcplugins/TcPlugin_InitStop_Ghci.stderr - + testsuite/tests/tcplugins/TcPlugin_InitStop_Ghci.stdout - + testsuite/tests/tcplugins/TcPlugin_InitStop_NoCode.hs - + testsuite/tests/tcplugins/TcPlugin_InitStop_NoCode.hs-boot - + testsuite/tests/tcplugins/TcPlugin_InitStop_NoCode.stderr - + testsuite/tests/tcplugins/TcPlugin_InitStop_NoCode_aux.hs - + testsuite/tests/tcplugins/TcPlugin_InitStop_Warn.hs - + testsuite/tests/tcplugins/TcPlugin_InitStop_Warn.stderr - testsuite/tests/tcplugins/all.T - + testsuite/tests/tcplugins/tc-plugin-initstop/Makefile - + testsuite/tests/tcplugins/tc-plugin-initstop/Setup.hs - + testsuite/tests/tcplugins/tc-plugin-initstop/TcPlugin_InitStop_Plugin.hs - + testsuite/tests/tcplugins/tc-plugin-initstop/tc-plugin-initstop.cabal - testsuite/tests/wasm/should_run/control-flow/LoadCmmGroup.hs - utils/haddock/haddock-api/src/Haddock/Interface/AttachInstances.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1350271b55e30e8b4c3e7b61af889906... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1350271b55e30e8b4c3e7b61af889906... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)