Fix lookupIdSubst call during RULE matching
As #20200 showed, there was a call to lookupIdSubst during RULE matching, where the variable being looked up wasn't in the InScopeSet. This patch fixes the problem at source, by dealing separately with nested and non-nested binders. As a result we can change the trace call in lookupIdSubst to a proper panic -- if it happens, we really want to know. (cherry picked from commit 149bce42)
Showing
- compiler/GHC/Core/Rules.hs 17 additions, 8 deletionscompiler/GHC/Core/Rules.hs
- compiler/GHC/Core/Subst.hs 3 additions, 5 deletionscompiler/GHC/Core/Subst.hs
- testsuite/tests/simplCore/should_compile/T20200.hs 6 additions, 0 deletionstestsuite/tests/simplCore/should_compile/T20200.hs
- testsuite/tests/simplCore/should_compile/all.T 1 addition, 0 deletionstestsuite/tests/simplCore/should_compile/all.T
Loading
Please register or sign in to comment