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
The 'this' context of type 'void' is not assignable to method's 'this' of type 'undefined'.
With nothing on the left side of the call, undefined should be what is passed to the callback for this.
π Expected behavior
Able to call the method normally.
Why don't you use (this: void)?
When writing a library, one easy mistake is to expose internal objects via this. This can mean that changes you expected to be non-breaking can end up breaking consumers. By typing all public API functions using this: undefined, type checking gives an error to keep us from leaking internal objects.
Bug Report
π Search Terms
"this: undefined"
π Version & Regression Information
I tried it with Nightly and 3.3.3333.
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
Unable to call the method without using
.call
.The 'this' context of type 'void' is not assignable to method's 'this' of type 'undefined'.
With nothing on the left side of the call, undefined should be what is passed to the callback for
this
.π Expected behavior
Able to call the method normally.
Why don't you use
(this: void)
?When writing a library, one easy mistake is to expose internal objects via
this
. This can mean that changes you expected to be non-breaking can end up breaking consumers. By typing all public API functions usingthis: undefined
, type checking gives an error to keep us from leaking internal objects.Playground Link
The text was updated successfully, but these errors were encountered: