-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Refactoringse.g. extract to constant or function, rename symbole.g. extract to constant or function, rename symbolFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
function foo(i: number) {
let x = 10;
for (let i = 0; i < 10; i++) {
x++;
return;
}
}
- select
x++;
return;
- extract
- you get
function foo(i: number) {
let x = 10;
for (let i = 0; i < 10; i++) {
x = newFunction(x);
}
}
function newFunction(x: number) {
x++;
return x;
}
which is not sematic preserving.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Refactoringse.g. extract to constant or function, rename symbole.g. extract to constant or function, rename symbolFixedA PR has been merged for this issueA PR has been merged for this issue