fix(transform): preserve exported aggregate carriers - #9054
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 8 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughThe aggregate scalar pass now treats exported bindings as externally referenced. It preserves exported aggregate carriers and adds unit and integration tests for named exports, exported objects, cross-module imports, array identity, iteration, and element values. ChangesExported aggregate preservation
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This change preserves exported aggregate values across modules without altering runtime APIs or deployment behavior, with regression coverage for length, iteration, property access, and identity. No actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Linked Issues checkExplanation The PR addresses issue Full details: Out of Scope Changes checkExplanation The implementation, transform tests, integration regression test, and changelog fragment are directly related to preserving exported aggregate carriers and resolving issue Full details: Docstring CoverageExplanation Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 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 |
Summary
Prevents aggregate scalar replacement from deleting arrays of object literals whose bindings are consumed from another module.
Changes
Module.exportsorexported_objectsas references from a virtual external HIR region.Related issue
Closes #9053
Test plan
cargo build --releaseclean (not run)cargo fmt --all -- --checkpython3 scripts/check_test_registration.py./scripts/pre-tag-check.sh --quickcargo test -p perry-transform(120 passed)cargo test -p perry --test issue_9053_exported_aggregate -- --nocaptureScreenshots / output
The two-module fixture now prints:
Checklist
Summary by CodeRabbit