We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
bind overload signature
Playground link with relevant code
method(x:number): string; method(x:string): number; method(x:string | number): string | number { if (typeof x === 'string') return 0; return ''; } method1: () => string; method2: () => number; constructor() { this.method1 = this.method.bind(this, 0); this.method2 = this.method.bind(this, ''); } }
in method1's definition, typescript only reads one of the two method signatures (the first one) when you use bind on it.
TypeScript should read all the available signatures when you call the bind method on your method. Because that's the purpose of method overloads.
The text was updated successfully, but these errors were encountered:
Duplicate of #38353. Used search terms: bind overloads in:title
bind overloads in:title
Sorry, something went wrong.
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.
No branches or pull requests
Bug Report
π Search Terms
bind overload signature
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
in method1's definition, typescript only reads one of the two method signatures (the first one) when you use bind on it.
π Expected behavior
TypeScript should read all the available signatures when you call the bind method on your method. Because that's the purpose of method overloads.
The text was updated successfully, but these errors were encountered: