Repository navigation
Conversation
Follow the lexical receiver binding to the declared parameter property type and verify the exact method owner before adding the call edge. Fixes Graphify-Labs#5529 Co-authored-by: Codex <[email protected]>
|
Thanks for the pull request, @rvitaliy. A maintainer will review it soon. Want to talk it through while it is in review? Come join us on our Discord server. For longer-form discussion there is also GitHub Discussions. A couple of things that speed up review: make sure the test suite passes on Python 3.11 and 3.13, and that the change keeps extraction deterministic. |
There was a problem hiding this comment.
Graphify review 
3 possible issues to check · High impact
This change adds call resolution for TypeScript aliases initialized from explicitly typed object properties.
3 possible issues we couldn't confirm
- Typed property receivers whose type no file declares are silently dropped instead of parked for the merged graph ·
graphify/extract.py:6934 - Property-alias calls lose the normalized method-name fallback, so a call like
repo.update_hash()missesupdateHash·graphify/extract.py:6981 - Incremental test helper loses class owners of methods defined in the tested file, so expected owners can silently become None ·
tests/test_ts_typed_property_receivers.py:25
They don't change the score.
What this review covered
- We didn't review 1 file that isn't source code, such as docs, config, images, or generated or third-party code.
- A changed file's diff was too long to show in full, so the review may not have seen every changed line in it.
- 4 of 4 changed files inspected. This is scope, not a correctness guarantee.
Code graph · 6258 functions depend on this change
- 3 functions became more coupled.
extract()(1395 callers),_js_receiver_binding_scope()(3 callers),walk_calls()(1 callers). - 643 of 643 test files are affected by this change.
- Gate, test list and every flagged function: in the Graphify check.
Reviewed 85252f3
Member
|
Shipped in v0.9.122, landed via authorship-preserving cherry-pick so your commits keep your name. Thanks @rvitaliy! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Resolve calls through a local
constinitialized from one explicitly typed parameter property, such asconst authority = ports.authority. Follow the lexical binding at the call and at the initializer, including through closures. Use the declared property type and its exact method to add anINFERREDedge.In our offboarding factory this recovers calls to the authority's
inspect,redeem, andrecheckcontract methods. The same method declarations were already present in the base graph.On a 102-file TypeScript sample containing that factory, a cold extraction preserved all 1,893 nodes and 6,227 existing edges and added those three calls.
Verification & Invariants
Readonly, and a simple same-file object type alias. The same cases run with unchanged contract files supplied as incremental resolver context.const. It leaves destructuring, chained properties, and complex type expressions to future work. AST cache schema 58 retires old receiver facts.How was this tested?
The minimal CLI reproduction in the issue resolves both the directly annotated receiver and its property-alias counterpart on this branch.
Pyright reports the same 782 diagnostics on the base and on this branch.
Fixes #5529