Skip to content

Extract function breaks code with switch statement #18144

Closed
@dbaeumer

Description

@dbaeumer
function foo() {
	let x = 10;
	switch (x) {
		case 1:
			break;
	}
}
  • select break;
  • extract
  • you get
function foo() {
	let x = 10;
	switch (x) {
		case 1:
            newFunction();
	}
}
function newFunction() {
    break;
}

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: Refactoringse.g. extract to constant or function, rename symbolFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions