Skip to content

Wrong error message for this in function #26447

@ghost

Description

TypeScript Version: 3.1.0-dev.20180810

Code

function f() {
    this.x;
}

Expected behavior:

Error that this is implicitly any.

Actual behavior:

src/a.ts:2:5 - error TS7041: The containing arrow function captures the global value of 'this' which implicitly has type 'any'.

...what arrow function?
(Ref: #25978)

Metadata

Metadata

Labels

BugA bug in TypeScriptDomain: Error MessagesThe issue relates to error messagingFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions