Skip to content

'use before declaration' error is not reported for block scoped variables in case block #5174

@vladima

Description

@vladima
declare function use(x: any);

function f(x) {
    switch(x) {
        case 1:
            let x = 1;
        case 2:
            x = 2; // should be error because of TDZ
    }
}

probably lo-pri, should be fixed if / when we add definite assignment check

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDuplicateAn existing issue was already created

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions