[ty] Fix is_disjoint_from with @final classes#21167
Merged
ibraheemdev merged 1 commit intomainfrom Oct 31, 2025
Merged
Conversation
Contributor
Diagnostic diff on typing conformance testsNo changes detected when running ty on typing conformance tests ✅ |
Contributor
|
AlexWaygood
approved these changes
Oct 31, 2025
crates/ty_python_semantic/resources/mdtest/type_properties/is_disjoint_from.md
Show resolved
Hide resolved
4c4587d to
7a40153
Compare
This was referenced Dec 3, 2025
ibraheemdev
added a commit
that referenced
this pull request
Dec 10, 2025
## Summary This was left unfinished in #21167. This is required to fix our disjointness checks with type-of a final class, which is currently broken, and blocking astral-sh/ty#159.
ibraheemdev
added a commit
that referenced
this pull request
Dec 10, 2025
## Summary We currently perform a subtyping check, similar to what we were doing for `@final` instances before #21167, which is incorrect, e.g. we currently consider `type[X[Any]]` and `type[X[T]]]` disjoint (where `X` is `@final`).
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
We currently perform a subtyping check instead of the intended subclass check (and the subtyping check is confusingly named
is_subclass_of). This showed up in #21070.