You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeScript Version: 2.1.4
In typescript 2.1.4 the compiler fails to narrow the correct signature overloading of a function when a arguments is a function which can optionally take an argument. Code
Expected behavior:
Compile without errors, like previous version of typescript. Actual behavior:
When compiling with --noImplicitAny I get the error error TS7006: Parameter 'x' implicitly has an 'any' type.
Also VSCode selects the correct overload:
but the type of x is any:
The text was updated successfully, but these errors were encountered:
Sorry, I did not find that issue before opening this.
It's strange that the order of the overloads changes the compiler resolution. Still reading the other issue it seems that also before this example was not working correctly.
TypeScript Version: 2.1.4
In typescript 2.1.4 the compiler fails to narrow the correct signature overloading of a function when a arguments is a function which can optionally take an argument.
Code
Expected behavior:
Compile without errors, like previous version of typescript.
Actual behavior:
When compiling with --noImplicitAny I get the error
error TS7006: Parameter 'x' implicitly has an 'any' type.
Also VSCode selects the correct overload:


but the type of x is any:
The text was updated successfully, but these errors were encountered: