Skip to content

forEach: The 'this' context of type 'void' is not assignable to method's 'this' of type 'undefined'. #15184

@mjbvz

Description

@mjbvz

TypeScript Version: 2.3.1-insiders.20170413

Code

['x'].forEach(function foo(x: string) {
        foo(x)
})

Bug:

[ts] The 'this' context of type 'void' is not assignable to method's 'this' of type 'undefined'.

This makes some sense given the typeSignature of forEach. I'm not sure if this is a by-design change with 2.3 or not

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issueVS Code TrackedThere is a VS Code equivalent to this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions