Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Switch causes Unreachable code #17

Closed
osimicek opened this issue Aug 21, 2013 · 0 comments
Closed

Switch causes Unreachable code #17

osimicek opened this issue Aug 21, 2013 · 0 comments

Comments

@osimicek
Copy link

When I write this code:

var trySwitch = function(num) {
    switch (num) {
        case 1:
            console.log("OK", 1);
            break;
        case 2:
            console.log("OK", 2);
            break;
        case 3:
            console.log("OK", 3);
            break;
        case 4:
            console.log("OK", 4);
            break;
    }
};

on the lines 6,9,12 tslint shows error:
"Unreachable code"
This is caused by break statements.

I found this error only in tslint@0.2.4

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant