-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
This typing for callbacks typed as any #10972
Comments
This works for me when I paste this into a VS Code instance running on a branch that I merged from master on Thursday. Let me try the current master...do you have another repro besides this snippet? |
Never mind, I was actually running code from July. It's broken once I point VS to the Thursday-updated branch. |
In case I want to |
I suspect this PR: #9746 |
So, interestingly, this is a bug only in quick info and listing members. Change the callback to return interface A {
a: string;
}
declare function noThis(callback: (this: A) => A): A;
noThis(function() { // error, 'string' is not assignable to 'A'
return this.a + this.nope; // error, 'nope' does not exist on 'A'
}); I still suspect #9746. |
I don't quite understand why below code is typed as
any
(I'm using nightly with--noImplicitThis
)?The text was updated successfully, but these errors were encountered: