-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Type inference for method overrides in derived classes #16590
Comments
My apologies if this either isn't a bug (or feature request) or it's already been closed in a separate ticket. I wasn't able to really find anything related to this in search, and it seemed sort of like a bug to me. |
It's not easy to find - check out #1373. Unfortunately we weren't able to solve this, but I think we're still considering some ideas here. |
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed. |
TypeScript Version: 2.4.0
Code
Expected behavior:
The method override in
Page
should be inferred typestring | number
.Actual behavior:
The method override in
Page
is implicitly theany
type.This seems like it should instead infer the parent type, because
window.onmousedown
), andmethod(e: object): any
, there would be an error that says the class wasn't matching the interface's signature. (Class 'Page' incorrectly implements interface 'IPage'.
)The text was updated successfully, but these errors were encountered: