-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Regression in type inference? #12733
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
Comments
Previously the compiler silently gave you can work around this by specifying an explicit type annotation on |
Thanks! I'm surprised the compiler silently gave Wait, as I understand #11905, it should skip The workaround is no problem, just thought I'd let you know since this broke the unit tests of https://github.com/Azure/autorest/ today (thousands of errors). Note that we can not remove "the first signature", in our case this is owned by mochajs! For example, see https://github.com/Azure/autorest/blob/master/src/generator/AutoRest.NodeJS.Tests/AcceptanceTests/validationTests.ts#L34 Cheers from building 18. |
that was an earlier iteration of the fix. the final change did not do that.
I would change the definition in mocha.d.ts and send a PR to DT. so that other ppl do not have to run int this. the issue is the compiler does not handle overload on arity for callbacks now, which is this case. |
Ahhh I see, thanks! |
TypeScript Version: 2.1.1, 2.1.4
Code
Expected behavior:
Successfully compile, even if
--noImplicitAny
is set. This is the behavior we saw until2.0.10
(which appears reasonable, the second overload offunc
allows inferring thatargx: number
).Actual behavior:
error TS7006: Parameter 'argx' implicitly has an 'any' type
The text was updated successfully, but these errors were encountered: