New J2K: Do not throw away incorrect code in switch statements
This commit is contained in:
@@ -828,8 +828,13 @@ class JavaToJKTreeBuilder constructor(
|
||||
emptyList()
|
||||
).withAssignedNonCodeElements(statement)
|
||||
else ->
|
||||
//TODO Handle case then there is no last case
|
||||
cases.lastOrNull()?.also { it.statements = it.statements + statement.toJK() }
|
||||
?: run {
|
||||
cases += JKJavaLabelSwitchCaseImpl(
|
||||
JKStubExpressionImpl(),
|
||||
listOf(statement.toJK())
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
JKJavaSwitchStatementImpl(with(expressionTreeMapper) { expression.toJK() }, cases)
|
||||
|
||||
Reference in New Issue
Block a user