summaryrefslogtreecommitdiff
path: root/compiler/GHC/Plugins.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2022-04-18 10:27:09 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2022-04-19 09:28:18 +0100
commit000b7d3d2f9211c3243d34a47ce93eb985d0cc88 (patch)
tree8976e52f5522840b26b8ee7e5b6aa9d9ebd137d9 /compiler/GHC/Plugins.hs
parentd8392f6a714b5646d43ed54eee0d028f714da717 (diff)
downloadhaskell-wip/T21391.tar.gz
Fix substitution in bindAuxiliaryDictwip/T21391
In GHC.Core.Opt.Specialise.bindAuxiliaryDict we were unnecessarily calling `extendInScope` to bring into scope variables that were /already/ in scope. Worse, GHC.Core.Subst.extendInScope strangely deleted the newly-in-scope variables from the substitution -- and that was fatal in #21391. I removed the redundant calls to extendInScope. More ambitiously, I changed GHC.Core.Subst.extendInScope (and cousins) to stop deleting variables from the substitution. I even changed the names of the function to extendSubstInScope (and cousins) and audited all the calls to check that deleting from the substitution was wrong. In fact there are very few such calls, and they are all about introducing a fresh non-in-scope variable. These are "OutIds"; it is utterly wrong to mess with the "InId" substitution. I have not added a Note, because I'm deleting wrong code, and it'd be distracting to document a bug.
Diffstat (limited to 'compiler/GHC/Plugins.hs')
-rw-r--r--compiler/GHC/Plugins.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/GHC/Plugins.hs b/compiler/GHC/Plugins.hs
index e79362b9d1..9c384317d2 100644
--- a/compiler/GHC/Plugins.hs
+++ b/compiler/GHC/Plugins.hs
@@ -88,7 +88,7 @@ import GHC.Core.DataCon
import GHC.Core.Utils
import GHC.Core.Make
import GHC.Core.FVs
-import GHC.Core.Subst hiding( substTyVarBndr, substCoVarBndr, extendCvSubst, extendInScopeSet )
+import GHC.Core.Subst hiding( substTyVarBndr, substCoVarBndr, extendCvSubst, extendSubstInScopeSet )
-- These names are also exported by Type
import GHC.Core.Rules