diff --git a/java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt b/java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt index 42617078ff54f..5e3ca5b28ec7d 100644 --- a/java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt +++ b/java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt @@ -6274,7 +6274,13 @@ open class KotlinFileExtractor( val bLocId = tw.getLocation(b) tw.writeStmts_whenbranch(bId, id, i, callable) tw.writeHasLocation(bId, bLocId) - extractExpressionExpr(b.condition, callable, bId, 0, bId) + + val condId = tw.getFreshIdLabel() + val locId = tw.getLocation(b) + tw.writeStmts_whenbranchcondition(condId, bId, 0, callable) + tw.writeHasLocation(id, locId) + tw.writeWhen_branch_condition_with_expr(condId) + extractExpressionExpr(b.condition, callable, condId, 0, condId) extractExpressionStmt(b.result, callable, bId, 1) if (b is IrElseBranch) { tw.writeWhen_branch_else(bId)