-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[ty] Fix disjointness checks with type-of @final classes
#21770
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: ibraheem/final-class-disjointness
Are you sure you want to change the base?
[ty] Fix disjointness checks with type-of @final classes
#21770
Conversation
964fc95 to
38334c8
Compare
Diagnostic diff on typing conformance testsNo changes detected when running ty on typing conformance tests ✅ |
1a0174d to
394be60
Compare
|
CodSpeed Performance ReportMerging #21770 will not alter performanceComparing Summary
Footnotes
|
345583e to
b7a9f44
Compare
b7a9f44 to
05560fb
Compare
| static_assert(not is_subtype_of(type[InvSub[bool]], type[InvSub[int]])) | ||
| static_assert(not is_subtype_of(type[InvSub[int]], type[InvSub[bool]])) | ||
| static_assert(is_disjoint_from(type[InvSub[int]], type[InvSub[str]])) | ||
| static_assert(not is_disjoint_from(type[InvSub[bool]], type[InvSub[int]])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a couple false negatives here, including this one (see #21769 (comment)).
Summary
We currently perform a subtyping check, similar to what we were doing for
@finalinstances before #21167, which is incorrect, e.g. we currently considertype[X[Any]]andtype[X[T]]]disjoint (whereXis@final).Stacked on #21769.