-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Quick FixesEditor-provided fixes, often called code actions.Editor-provided fixes, often called code actions.FixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
TypeScript Version: 2.9.1, 3.0-rc
Search Terms: unreachable remove fix
Code
while (true) {
console.log(1);
break;
console.log(2); // unreachable
}
Expected behavior:
"Remove unreachable code" fix should only remove the code after "break".
Actual behavior:
The fix removes the whole loop.
I guess the idea was that the body of an if (false)
or while (false)
is considered unreachable, and in that case the whole thing can be removed. But, that's not the case here.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Quick FixesEditor-provided fixes, often called code actions.Editor-provided fixes, often called code actions.FixedA PR has been merged for this issueA PR has been merged for this issue