fix(hir): preserve class captures across loop iterations (#9528) - #9548
fix(hir): preserve class captures across loop iterations (#9528)#9548proggeramlug wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe loop lowering pass now creates fresh capture cells for lexical classic- ChangesLoop class capture freshening
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The change corrects lexical class captures across classic-for loop iterations while preserving var-loop behavior, preventing methods and initializers from observing the wrong loop value. No actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description explains the problem, lists the implementation and test changes, identifies issue Full details: Linked Issues checkExplanation The changes address issue Full details: Docstring CoverageExplanation Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Landed via merge train # (rebase-merge, your authorship preserved). |
|
Correction: the landing PR is #9549 — merged (rebase-merge, authorship preserved). |
Fixes lexical classic-for class captures that shared the final loop value across every evaluated class instance.
What changed
Verification
Closes #9528
Summary by CodeRabbit
Bug Fixes
for (let …)loops so each iteration retains its own captured value.for (var …)loops.forandfor-ofloops, including delayed methods and field initializers.Tests
varloop capture behavior.