Skip to content

This typing for callbacks typed as any #10972

Closed
@tinganho

Description

@tinganho

I don't quite understand why below code is typed as any(I'm using nightly with --noImplicitThis)?

interface A {
    a: string;
}
declare function test(callback: (this: A) => void): void;
test(function() {
    this.a;// typed as any?
});

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions