diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2022-04-18 10:27:09 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-04-20 11:51:15 -0400 |
commit | 0c02c9199c26bebde17cd0afd378802c6d622a88 (patch) | |
tree | c60ecbcad4e45e14493668570dc38f6acf3b3900 /libraries/base | |
parent | 49bd758417fd539080469f2fc2a996ea6dc75d45 (diff) | |
download | haskell-0c02c9199c26bebde17cd0afd378802c6d622a88.tar.gz |
Fix substitution in bindAuxiliaryDict
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 'libraries/base')
0 files changed, 0 insertions, 0 deletions