Skip to content

Global 'this' capture logic is slightly wrong in --noImplicitThis #63001

@DanielRosenwasser

Description

@DanielRosenwasser
// @strict: true
function f(this: typeof globalThis) {
    return () => this;
}

Expected: no error
Actual:

The containing arrow function captures the global value of 'this'.

I think we just need to add an isSourceFile(container) check or something.

Metadata

Metadata

Labels

Needs InvestigationThis issue needs a team member to investigate its status.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions