[ty] Fix bug in union builder optimization#22085
[ty] Fix bug in union builder optimization#22085zanieb wants to merge 3 commits intomicha/union-builder-sub-unionsfrom
Conversation
Diagnostic diff on typing conformance testsNo changes detected when running ty on typing conformance tests ✅ |
|
|
This looks wrong, I'll keep poking in the background. |
|
It looks "correct" in the sense that it fixes the bug in my PR |
|
Oh does it? It looked like it caused some new problems too :) |
It does. So I think you might be on to something but I honestly don't know enough about those union builder flags (or when we should set which flag) |
The optimization condition checked if `recursively_defined` flags matched, which would apply when both are Yes. However, unions with recursively_defined=Yes may have been built during cycle_recovery where simplification is incomplete. Change the condition to require both builder and union have recursively_defined=No, ensuring the optimization only applies to unions that are definitely fully simplified.
d96990c to
6a2f787
Compare
|
There is no direct relationship between the two. ruff/crates/ty_python_semantic/src/types.rs Lines 14075 to 14080 in 9809405 |
|
@MichaReiser CI is green now 🤔 |
Unfortunately, it doesn't remove the prefect diagnostics anymore. |
7b6d0a9 to
cf2259d
Compare
Just poking around...
Applied to #22071