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

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions