-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
lib.d.ts Function.bind with this #28571
Comments
I'm a little bit confused over what's being suggested here, but is it covered by #27028 which is coming in TypeScript 3.2? |
i think it not same, in but in export interface t4 extends Function2
{
(): string
}
export declare let t5: t4
export let t6 = t5.bind([] as string[])
t6 = function ()
{
this.includes('') // => this is string[]
// ts will and should show error
this.padEnd(1, '0')
return ''
}
export interface t7 extends Function
{
(): string
}
export declare let t8: t7
export let t9 = t8.bind([] as string[])
t9 = function ()
{
this.includes('') // => this is string[]
// ts didn't show error
this.padEnd(1, '0')
return ''
} |
I think that's because you extended |
my version is 3.2.0-dev.20181114 export interface t10
{
(): string
}
export declare let t11: t10
export let t12 = t11.bind([] as string[])
t12 = function ()
{
this.includes('') // => this is string[]
// ts didn't show error
this.padEnd(1, '0')
return ''
}
export declare function t13()
export let t14 = t13.bind([] as string[])
t14 = function ()
{
this.includes('') // => this is string[]
// ts didn't show error
this.padEnd(1, '0')
return ''
} |
I can't tell what's going on here. The posted code is full of errors and I don't see which ones are supposed to be good or bad. Please open a new issue with a clear description if needed. Thanks! |
Search Terms
Suggestion
i don't know what is better name for
ITSOverwriteThisFunction
Use Cases
fn.bind
, know who isthis
Examples
Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: