ruff
4fdb4e82 - [ty] avoid unions of generic aliases of the same class in fixpoint (#21909)

Commit
1 day ago
[ty] avoid unions of generic aliases of the same class in fixpoint (#21909) Partially addresses https://github.com/astral-sh/ty/issues/1732 Fixes https://github.com/astral-sh/ty/issues/1800 ## Summary At each fixpoint iteration, we union the "previous" and "current" iteration types, to ensure that the type can only widen at each iteration. This prevents oscillation and ensures convergence. But some unions triggered by this behavior (in particular, unions of differently-specialized generic-aliases of the same class) never simplify, and cause spurious errors. Since we haven't seen examples of oscillating types involving class-literal or generic-alias types, just don't union those. There may be more thorough/principled ways to avoid undesirable unions in fixpoint iteration, but this narrow change seems like it results in strict improvement. ## Test Plan Removes two false positive `unsupported-class-base` in mdtests, and several in the ecosystem, without causing other regression.
Author
Parents
Loading