-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[ty] use "referable" definitions in implicit attribute inference #21822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Diagnostic diff on typing conformance testsNo changes detected when running ty on typing conformance tests ✅ |
CodSpeed Performance ReportMerging #21822 will degrade performances by 4.46%Comparing Summary
Benchmarks breakdown
Footnotes
|
|
Oh, severe performance degradation and iteration count mismatch panics... |
|
Summary
This PR improves implicit attribute inference.
Specifically, reachability checks for definitions within method bodies, which are used to infer implicit attributes, are now more accurate.
Currently, all definitions within a method body are treated as reachable, i.e., reachability constraints are simply ignored (#18955), because after the control flow is transferred, all definitions within the method body are marked as unreachable.
However, definitions before transfer can be included in the candidates for implicit attribute type inference if they are reachable. Let's call such definitions "referable" and consider them in the implicit attribute inference.
Test Plan
Some TODOs in
mdtest/attributes.mdhave been resolved.