Repository navigation
Resolve call receivers through declared and inferred types - #728
Open
jaywyawhare wants to merge 1 commit into
Open
jaywyawhare wants to merge 1 commit into
jaywyawhare wants to merge 1 commit into
Conversation
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.
Summary
Resolve
variable.method()calls whose receiver type is plain from the code: constructors, declared return types, annotations, typed attributes and class fields, call results, and short typed chains, with member lookup through bases and mixins. Ambiguous receivers still resolve to nothing, and precision holds on every corpus root. Stacked on #727.Implementation details
Decisions
self.x: Tattributes, properties and getters by return type, TS private#fields, both arms of a conditional, walrus bindings, arrow and function expression return types,Final[...]andClassVar[...], and quoted types such aslist["Text"].Base[int]),export { X as Y }aliases, and TS type aliases are followed for member lookup.new Foo().bar()andFoo(x).run()chains resolve.tests/fixtures/code-types, has exact-edge tests in both SDKs and acode_typesconformance case.benchmarks/code/README.mdresults are rerun withrun_corpus.py --self; notes for fixed causes are removed and the rest rewritten.Results on the pinned corpus (precision / recall, %, after #727 then here)
typescript/srcrequests, ky, and
src/selfgraphare unchanged. Strict precision dips slightly in sanic and aiohttp because of new calls through declared abstract types and blueprint mixins that Jedi finds no in-root target for; there are no new disagreements.Validation
scripts/precheck.pypasses (498 changed lines, clean trial merge).Limits
No flow-sensitive narrowing, destructured names, classes built by a function call, or conditional imports. hono's
router.matchstays a reference difference: the checker follows a function assigned to a class field, the resolver the declaredRouterinterface. rich keeps one subclass-override pick.Linked issue
Closes #726
AI Assistance
AI tools helped write and test parts of this. I reviewed and ran every change.
Checklist
/approved.AGENTS.md). No new codes.Breaking changes
None. Some calls that resolved to nothing now get a
CALLSorCONSTRUCTSedge, and zod-style calls now link to the value instead of the same-named type.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.