-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[ty] Refactor if narrowing #18392
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?
[ty] Refactor if narrowing #18392
Conversation
Looks like there are still some failing tests here? Let me know if any of these are things you'd like a second pair of eyes on how to address; otherwise I'll mark this as draft, go ahead and put it back up for review when CI is green. |
Looks like we're green now, but mypy primer seems unhappy (sorry if that means I shouldn't have opened it, but I'm not sure how to proceed with primer failures) |
Thank you for working on this!
The mypy_primer run was failing due to a network error. I re-ran it now and it fails with
This might be related to astral-sh/ty#365 (comment). I am planning to fix that bug as soon as #18041 is merged (which makes significant changes to the semantic index builder, and has a much higher impact). I suggest that we wait with this PR until these two things have been resolved. |
Summary
Refactor the semantic index builder’s If statement analysis. This change also lets us detect more unreachable code paths.
Test Plan