fix(indexing): classify string receivers behind array claims (#7891) - #7904
Conversation
|
Important Review skippedNo new commits to review since the last review. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 (7)
📝 WalkthroughWalkthroughThe change fixes numeric string-key reads when a runtime string passes through an erased array declaration. Code generation preserves boxed SSO string handling, runtime lookup classifies heap strings, and regression tests cover both compiler IR and end-to-end behavior. ChangesDeclared array string-key indexing
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant DeclaredArrayRead
participant CodegenDispatch
participant RuntimeArrayLookup
participant RuntimeStringIndexing
DeclaredArrayRead->>CodegenDispatch: Lower declared-array key read
CodegenDispatch->>RuntimeStringIndexing: SSO receiver with numeric string key
CodegenDispatch->>RuntimeArrayLookup: Other receiver or fallback property lookup
RuntimeArrayLookup->>RuntimeStringIndexing: Heap string with numeric key
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
|
@coderabbitai review |
|
Closes #7891.
What changed
Reproduction
On current main, the new fixture printed
undefined/sfor the declared receiver while Node printeds/s. The directanycontrol already printeds/sin both.Validation
cargo test -p perry-codegen: passed, including integration and doc tests-p perry -p perry-runtime-static -p perry-stdlib-staticSummary by CodeRabbit
Bug Fixes
lengthproperty behavior across declared, nullable, parsed, and dynamic values.Tests