Skip to content

Missing error when shadowing WeakMap/WeakSet in class private field's scope #2086

@RyanCavanaugh

Description

@RyanCavanaugh

Steps to reproduce

    function test() {
        let WeakMap;
            ~~~~~~~
!!! error TS18027: Compiler reserves name 'WeakMap' when emitting private identifier downlevel.
        let WeakSet;
            ~~~~~~~
!!! error TS18027: Compiler reserves name 'WeakSet' when emitting private identifier downlevel.
        class C {
            #x;
        }
    }

Behavior with typescript@5.8

As shown

Behavior with tsgo

No error

Likely just because this transform isn't implemented yet, but logging to document an accepted error delta

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions