Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
vladima opened this issue Oct 8, 2015 · 1 comment
Assignees
Labels
Bug A bug in TypeScript Duplicate An existing issue was already created

Comments

@vladima
Copy link
Contributor

vladima commented Oct 8, 2015

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

@vladima vladima added the Bug A bug in TypeScript label Oct 8, 2015
@mhegazy mhegazy added this to the TypeScript 2.0 milestone Oct 8, 2015
@mhegazy
Copy link
Contributor

mhegazy commented Oct 12, 2015

subsumed by #5207

@mhegazy mhegazy closed this as completed Oct 12, 2015
@mhegazy mhegazy added the Duplicate An existing issue was already created label Oct 12, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants