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
This one works as expected:
interface Array<T> { foo(): number; } Array.prototype.foo = function(): number { return 42; } var arr: string[] = ['a', 'b', 'c']; var x = arr.foo();
But tsc throws an error for this one:
tsc
interface Array<T> { foo(): number; } Array.prototype['foo'] = function(): number { return 42; } var arr: string[] = ['a', 'b', 'c']; var x = arr.foo(); export = x;
The error is: error TS2339: Property 'foo' does not exist on type 'string[]'.
error TS2339: Property 'foo' does not exist on type 'string[]'.
The text was updated successfully, but these errors were encountered:
See #4166
Sorry, something went wrong.
No branches or pull requests
This one works as expected:
But
tsc
throws an error for this one:The error is:
error TS2339: Property 'foo' does not exist on type 'string[]'.
The text was updated successfully, but these errors were encountered: