diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2022-04-18 10:27:09 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2022-04-19 09:28:18 +0100 |
commit | 000b7d3d2f9211c3243d34a47ce93eb985d0cc88 (patch) | |
tree | 8976e52f5522840b26b8ee7e5b6aa9d9ebd137d9 /compiler/GHC/Core/Opt/Arity.hs | |
parent | d8392f6a714b5646d43ed54eee0d028f714da717 (diff) | |
download | haskell-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/Core/Opt/Arity.hs')
-rw-r--r-- | compiler/GHC/Core/Opt/Arity.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/GHC/Core/Opt/Arity.hs b/compiler/GHC/Core/Opt/Arity.hs index c78285c6f9..6c0729ec5b 100644 --- a/compiler/GHC/Core/Opt/Arity.hs +++ b/compiler/GHC/Core/Opt/Arity.hs @@ -45,7 +45,7 @@ import GHC.Core.Multiplicity -- We have two sorts of substitution: -- GHC.Core.Subst.Subst, and GHC.Core.TyCo.TCvSubst -- Both have substTy, substCo Hence need for qualification -import GHC.Core.Subst as Core hiding ( extendInScopeSet ) +import GHC.Core.Subst as Core import GHC.Core.Type as Type import GHC.Core.Coercion as Type |