-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Strange this
parameter behaviour
#9648
Comments
//cc @sandersn |
The problem is that it's confusing when contextual typing applies or doesn't apply. Let's look at your examples in order:
Overall, the system is behaving as expected. I'd recommend dropping all type annotations and letting contextual typing and return type inference take care of it. However, the existing string methods should also have |
#4241 is tracking changing this behavior so that one argument type annotation does not block inference for the rest unannotated ones. |
TypeScript Version: 2.0.0 beta with
"noImplicitThis": true
Code
Look like once you type some parameters you have to type all of them, including the
this
.What's the reason?
The text was updated successfully, but these errors were encountered: