-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[ty] Fix subtyping of type[Any] / type[T] and protocols
#21678
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
Conversation
Diagnostic diff on typing conformance testsNo changes detected when running ty on typing conformance tests ✅ |
|
| # TODO: no errors here | ||
| # error: [invalid-type-arguments] "Type `typing.TypeVar` is not assignable to upper bound `generic[Any]` of type variable `_ScalarT_co@dtype`" | ||
| # error: [invalid-type-arguments] "Type `typing.TypeVar` is not assignable to upper bound `generic[Any]` of type variable `_ScalarT_co@dtype`" |
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.
These errors prevent us from running into the problem on main. But on #21553, these errors will go away, and then we need to properly understand all of this code here, or otherwise we see np.array calls failing all over the place.
AlexWaygood
left a comment
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.
Some suggestions, but they're untested, so accept them with care 😄
7cadc6f to
80bc86e
Compare
|
| Lint rule | Added | Removed | Changed |
|---|---|---|---|
invalid-argument-type |
0 | 28 | 4 |
no-matching-overload |
0 | 11 | 0 |
invalid-assignment |
0 | 0 | 3 |
invalid-parameter-default |
0 | 3 | 0 |
unused-ignore-comment |
2 | 0 | 0 |
| Total | 2 | 42 | 7 |
80bc86e to
2be7bbe
Compare
dtypetype[Any] / type[T] and protocols
Summary
This is a bugfix for subtyping of
type[Any]/type[T]and protocols.Test Plan
Regression test that will only be really meaningful once #21553 lands.