We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
Looks like that in 1.7.5 overloading order became significant in some cases
declare class A { f(x:string): any; f(x:{[key: string]: any}): A; } var a: A; var x = a.f("A") + 1; // OK in both TS 1.7.5 and TS 1.5.3
declare class A { f(x:{[key: string]: any}): A; f(x:string): any; } var a: A; var x = a.f("A") + 1; // Fails on TS 1.7.5 (Worked on 1.5.3). Inferred f result as A
Is it by design?
The text was updated successfully, but these errors were encountered:
Yes, it is by design. Specifically, it is an effect of the change in #4074.
Sorry, something went wrong.
Overloading has always been order-sensitive -- the first signature that matches is the one that's selected.
Recommended fix would be to replace [key: string]: any with [key: string]: {}
[key: string]: any
[key: string]: {}
@ahejlsberg, @RyanCavanaugh - thank you for explanation
No branches or pull requests
Looks like that in 1.7.5 overloading order became significant in some cases
Is it by design?
The text was updated successfully, but these errors were encountered: