-
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
Extra arguments with defaults get implicit any even with noImplicitAny #17904
Comments
We need a contextual type before evaluating the expression, since the type of the expression can be impacted by that. we got one from the declaration of |
Giving |
that is fair. an error should have been raised here. there is parallel to this case in #11905 already detected as a no-implicit-any error if the contextual type failed to be applied. |
it is, thought this issue is to track raising an error under noImplicitAny, rather than changing the behavior. |
Just looking at old issues; given #17904 (comment) and the fact that the behavior was changed, the implication is that an implicit any is no longer the desired behavior and therefore no error should appear (so this issue can be closed). |
TypeScript Version: 2.4.2
Code
Tested in Playground with
noImplicitAny
on.Expected behavior:
Type of
arg
is inferred to beboolean
, or an error is thrown ("arg implicitly has 'any' type").Actual behavior:
Type of
arg
isany
, and no error is thrown.The text was updated successfully, but these errors were encountered: