Skip to content

Better error messages when outer 'this' has the right type #26461

@DanielRosenwasser

Description

@DanielRosenwasser

From @Andy-MS at #26447

we should also have a good error message in the following situation:

class C {
    m() {
        this.m();
        function f() {
            this.m();
        }
    }
}

This is a common error and it's not obvious why this works in one place but not the other. The error message should indicate the place where this was shadowed.

Metadata

Metadata

Labels

Domain: Error MessagesThe issue relates to error messagingExperience EnhancementNoncontroversial enhancementsFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions