Repository navigation
fix(resolve): follow Python receiver reassignments - #395
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (4)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (9)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughPython receiver resolution now selects the latest eligible binding in lexical scope for member calls and type inference. Unknown replacements do not reuse earlier types. Import resolution uses receiver-specific imports and preserves matching unaliased package imports. Tests and documentation cover assignment order, annotations, nested scopes, and imports. ChangesPython receiver resolution
Priority: ➖ Normal Merge Risk: 🔵 Low · up to Some calls inside captured functions may point to the wrong method after the outer variable changes. This bounded limitation does not prevent merging. 🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Python member calls could keep a receiver's original type after a later assignment. The following code linked
m.dump()toOther::dumpinstead ofModel::dump:Receiver lookup now follows the latest preceding value in the same lexical scope. Unknown replacements remain unresolved.
Bare annotations preserve an existing value, captured variables retain their closure resolution, and a newly assigned import alias resolves through its selected module. Unaliased package imports preserve sibling modules across function boundaries. Multiple statements on one line retain the existing limitation.
Validation on Node 24:
README rows checked: the name/call-resolution description in About this fork was updated; its benchmark numbers are unchanged. The Python language reference and changelog describe the corrected behavior.