From 17e6099b53d71c72013aff19f6cec257ecca4cbd Mon Sep 17 00:00:00 2001 From: "vladislav.grechko" Date: Wed, 1 Mar 2023 20:15:41 +0100 Subject: [PATCH] Initialize 'source' property of FirCatch objects properly ^KT-56923: Fixed ^KT-56755: Fixed --- ...FirLightTreeBytecodeTextTestGenerated.java | 6 + .../FirPsiBytecodeTextTestGenerated.java | 6 + .../converter/ExpressionsConverter.kt | 9 +- .../testData/codegen/bytecodeText/kt56923.kt | 7 + .../debug/localVariables/catchClause.kt | 30 ++-- .../debug/localVariables/tryFinally11.kt | 44 +++-- .../debug/localVariables/tryFinally12.kt | 44 +++-- .../debug/localVariables/tryFinally13.kt | 40 ++--- .../debug/localVariables/tryFinally7.kt | 60 +++---- .../debug/localVariables/tryFinally8.kt | 64 ++++--- .../testData/debug/stepping/throwException.kt | 30 ++-- compiler/testData/debug/stepping/tryCatch.kt | 44 +++-- .../debug/stepping/tryCatchExpression.kt | 166 +++++++++--------- .../debug/stepping/tryCatchFinally.kt | 140 ++++++++------- .../codegen/BytecodeTextTestGenerated.java | 6 + .../codegen/IrBytecodeTextTestGenerated.java | 6 + 16 files changed, 357 insertions(+), 345 deletions(-) create mode 100644 compiler/testData/codegen/bytecodeText/kt56923.kt diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBytecodeTextTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBytecodeTextTestGenerated.java index a9a0bf91ecd..5f3dbc62c06 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBytecodeTextTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBytecodeTextTestGenerated.java @@ -349,6 +349,12 @@ public class FirLightTreeBytecodeTextTestGenerated extends AbstractFirLightTreeB runTest("compiler/testData/codegen/bytecodeText/kt5016intOrNull.kt"); } + @Test + @TestMetadata("kt56923.kt") + public void testKt56923() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/kt56923.kt"); + } + @Test @TestMetadata("kt7188.kt") public void testKt7188() throws Exception { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBytecodeTextTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBytecodeTextTestGenerated.java index fb3a20e18a5..e9d8dd1a4b3 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBytecodeTextTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBytecodeTextTestGenerated.java @@ -349,6 +349,12 @@ public class FirPsiBytecodeTextTestGenerated extends AbstractFirPsiBytecodeTextT runTest("compiler/testData/codegen/bytecodeText/kt5016intOrNull.kt"); } + @Test + @TestMetadata("kt56923.kt") + public void testKt56923() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/kt56923.kt"); + } + @Test @TestMetadata("kt7188.kt") public void testKt7188() throws Exception { diff --git a/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/ExpressionsConverter.kt b/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/ExpressionsConverter.kt index 7e408ffeb0b..b84bf58bd80 100644 --- a/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/ExpressionsConverter.kt +++ b/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/ExpressionsConverter.kt @@ -1191,7 +1191,7 @@ class ExpressionsConverter( */ private fun convertTryExpression(tryExpression: LighterASTNode): FirExpression { lateinit var tryBlock: FirBlock - val catchClauses = mutableListOf>() + val catchClauses = mutableListOf>() var finallyBlock: FirBlock? = null tryExpression.forEachChildren { when (it.tokenType) { @@ -1204,7 +1204,7 @@ class ExpressionsConverter( source = tryExpression.toFirSourceElement() this.tryBlock = tryBlock this.finallyBlock = finallyBlock - for ((parameter, block) in catchClauses) { + for ((parameter, block, clauseSource) in catchClauses) { if (parameter == null) continue catches += buildCatch { this.parameter = buildProperty { @@ -1222,6 +1222,7 @@ class ExpressionsConverter( it.isCatchParameter = true } this.block = block + this.source = clauseSource } } } @@ -1230,7 +1231,7 @@ class ExpressionsConverter( /** * @see org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parseTry */ - private fun convertCatchClause(catchClause: LighterASTNode): Pair? { + private fun convertCatchClause(catchClause: LighterASTNode): Triple? { var valueParameter: ValueParameter? = null var blockNode: LighterASTNode? = null catchClause.forEachChildren { @@ -1241,7 +1242,7 @@ class ExpressionsConverter( } } - return Pair(valueParameter, declarationsConverter.convertBlock(blockNode)) + return Triple(valueParameter, declarationsConverter.convertBlock(blockNode), catchClause.toFirSourceElement()) } /** diff --git a/compiler/testData/codegen/bytecodeText/kt56923.kt b/compiler/testData/codegen/bytecodeText/kt56923.kt new file mode 100644 index 00000000000..6ae66911ae1 --- /dev/null +++ b/compiler/testData/codegen/bytecodeText/kt56923.kt @@ -0,0 +1,7 @@ +fun foo() { + try { + } catch (e: Exception) { + } +} + +// 1 LINENUMBER 3 \ No newline at end of file diff --git a/compiler/testData/debug/localVariables/catchClause.kt b/compiler/testData/debug/localVariables/catchClause.kt index c82dd2dc6cb..4e91ae77141 100644 --- a/compiler/testData/debug/localVariables/catchClause.kt +++ b/compiler/testData/debug/localVariables/catchClause.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND_K2_LIGHT_TREE: JVM_IR -// Reason: KT-56755 // FILE: test.kt fun box() { try { @@ -13,20 +11,20 @@ fun box() { } // EXPECTATIONS JVM JVM_IR -// test.kt:5 box: -// test.kt:6 box: -// test.kt:7 box: a:int=1:int -// test.kt:8 box: a:int=0:int -// test.kt:10 box: -// test.kt:11 box: e:java.lang.Throwable=java.lang.ArithmeticException -// test.kt:13 box: +// test.kt:3 box: +// test.kt:4 box: +// test.kt:5 box: a:int=1:int +// test.kt:6 box: a:int=0:int +// test.kt:8 box: +// test.kt:9 box: e:java.lang.Throwable=java.lang.ArithmeticException +// test.kt:11 box: // EXPECTATIONS JS_IR -// test.kt:6 box: -// test.kt:7 box: a=1:number -// test.kt:7 box: a=1:number +// test.kt:4 box: +// test.kt:5 box: a=1:number +// test.kt:5 box: a=1:number +// test.kt:6 box: a=0:number +// test.kt:7 box: a=0:number // test.kt:8 box: a=0:number -// test.kt:9 box: a=0:number -// test.kt:10 box: a=0:number -// test.kt:10 box: a=0:number -// test.kt:11 box: a=0:number, e=kotlin.ArithmeticException +// test.kt:8 box: a=0:number +// test.kt:9 box: a=0:number, e=kotlin.ArithmeticException diff --git a/compiler/testData/debug/localVariables/tryFinally11.kt b/compiler/testData/debug/localVariables/tryFinally11.kt index 806c2e28956..85c1156b8d0 100644 --- a/compiler/testData/debug/localVariables/tryFinally11.kt +++ b/compiler/testData/debug/localVariables/tryFinally11.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND_K2_LIGHT_TREE: JVM_IR -// Reason: KT-56755 // The local variables `z` and `y` are visible in the finally block with old backend. // IGNORE_BACKEND: JVM // WITH_STDLIB @@ -26,29 +24,29 @@ fun box(): String { } // EXPECTATIONS JVM JVM_IR -// test.kt:9 box: -// test.kt:10 box: -// test.kt:11 box: i:int=0:int +// test.kt:7 box: +// test.kt:8 box: +// test.kt:9 box: i:int=0:int +// test.kt:10 box: i:int=0:int +// test.kt:11 box: i:int=0:int, x:java.lang.String="x":java.lang.String // test.kt:12 box: i:int=0:int -// test.kt:13 box: i:int=0:int, x:java.lang.String="x":java.lang.String -// test.kt:14 box: i:int=0:int -// test.kt:15 box: i:int=0:int, e:java.lang.Exception=java.lang.RuntimeException -// test.kt:16 box: i:int=0:int, e:java.lang.Exception=java.lang.RuntimeException, y:java.lang.String="y":java.lang.String -// test.kt:17 box: i:int=0:int, e:java.lang.Exception=java.lang.RuntimeException, y:java.lang.String="y":java.lang.String, z:java.lang.String="z":java.lang.String -// test.kt:19 box: i:int=0:int -// test.kt:23 box: +// test.kt:13 box: i:int=0:int, e:java.lang.Exception=java.lang.RuntimeException +// test.kt:14 box: i:int=0:int, e:java.lang.Exception=java.lang.RuntimeException, y:java.lang.String="y":java.lang.String +// test.kt:15 box: i:int=0:int, e:java.lang.Exception=java.lang.RuntimeException, y:java.lang.String="y":java.lang.String, z:java.lang.String="z":java.lang.String +// test.kt:17 box: i:int=0:int +// test.kt:21 box: // EXPECTATIONS JS_IR -// test.kt:10 box: -// test.kt:10 box: -// test.kt:10 box: +// test.kt:8 box: +// test.kt:8 box: +// test.kt:8 box: +// test.kt:8 box: i=0:number // test.kt:10 box: i=0:number -// test.kt:12 box: i=0:number -// test.kt:13 box: i=0:number, x="x":kotlin.String -// test.kt:14 box: i=0:number, x="x":kotlin.String -// test.kt:14 box: i=0:number, x="x":kotlin.String -// test.kt:15 box: i=0:number, x="x":kotlin.String, e=kotlin.RuntimeException -// test.kt:16 box: i=0:number, x="x":kotlin.String, e=kotlin.RuntimeException, y="y":kotlin.String +// test.kt:11 box: i=0:number, x="x":kotlin.String +// test.kt:12 box: i=0:number, x="x":kotlin.String +// test.kt:12 box: i=0:number, x="x":kotlin.String +// test.kt:13 box: i=0:number, x="x":kotlin.String, e=kotlin.RuntimeException +// test.kt:14 box: i=0:number, x="x":kotlin.String, e=kotlin.RuntimeException, y="y":kotlin.String +// test.kt:15 box: i=0:number, x="x":kotlin.String, e=kotlin.RuntimeException, y="y":kotlin.String, z="z":kotlin.String // test.kt:17 box: i=0:number, x="x":kotlin.String, e=kotlin.RuntimeException, y="y":kotlin.String, z="z":kotlin.String -// test.kt:19 box: i=0:number, x="x":kotlin.String, e=kotlin.RuntimeException, y="y":kotlin.String, z="z":kotlin.String -// test.kt:23 box: i=0:number, x="x":kotlin.String, e=kotlin.RuntimeException, y="y":kotlin.String, z="z":kotlin.String +// test.kt:21 box: i=0:number, x="x":kotlin.String, e=kotlin.RuntimeException, y="y":kotlin.String, z="z":kotlin.String diff --git a/compiler/testData/debug/localVariables/tryFinally12.kt b/compiler/testData/debug/localVariables/tryFinally12.kt index c3aaccadb0d..54d99fef4cc 100644 --- a/compiler/testData/debug/localVariables/tryFinally12.kt +++ b/compiler/testData/debug/localVariables/tryFinally12.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND_K2_LIGHT_TREE: JVM_IR -// Reason: KT-56755 // The local variables `z` and `y` are visible in the finally block with old backend. // IGNORE_BACKEND: JVM // WITH_STDLIB @@ -26,29 +24,29 @@ fun box(): String { } // EXPECTATIONS JVM JVM_IR -// test.kt:9 box: -// test.kt:10 box: -// test.kt:11 box: i:int=0:int +// test.kt:7 box: +// test.kt:8 box: +// test.kt:9 box: i:int=0:int +// test.kt:10 box: i:int=0:int +// test.kt:11 box: i:int=0:int, x:java.lang.String="x":java.lang.String // test.kt:12 box: i:int=0:int -// test.kt:13 box: i:int=0:int, x:java.lang.String="x":java.lang.String -// test.kt:14 box: i:int=0:int -// test.kt:15 box: i:int=0:int, e:java.lang.Exception=java.lang.RuntimeException -// test.kt:16 box: i:int=0:int, e:java.lang.Exception=java.lang.RuntimeException, y:java.lang.String="y":java.lang.String -// test.kt:17 box: i:int=0:int, e:java.lang.Exception=java.lang.RuntimeException, y:java.lang.String="y":java.lang.String, z:java.lang.String="z":java.lang.String -// test.kt:19 box: i:int=0:int -// test.kt:23 box: +// test.kt:13 box: i:int=0:int, e:java.lang.Exception=java.lang.RuntimeException +// test.kt:14 box: i:int=0:int, e:java.lang.Exception=java.lang.RuntimeException, y:java.lang.String="y":java.lang.String +// test.kt:15 box: i:int=0:int, e:java.lang.Exception=java.lang.RuntimeException, y:java.lang.String="y":java.lang.String, z:java.lang.String="z":java.lang.String +// test.kt:17 box: i:int=0:int +// test.kt:21 box: // EXPECTATIONS JS_IR -// test.kt:10 box: -// test.kt:10 box: -// test.kt:10 box: +// test.kt:8 box: +// test.kt:8 box: +// test.kt:8 box: +// test.kt:8 box: i=0:number // test.kt:10 box: i=0:number -// test.kt:12 box: i=0:number -// test.kt:13 box: i=0:number, x="x":kotlin.String -// test.kt:14 box: i=0:number, x="x":kotlin.String -// test.kt:14 box: i=0:number, x="x":kotlin.String -// test.kt:15 box: i=0:number, x="x":kotlin.String, e=kotlin.RuntimeException -// test.kt:16 box: i=0:number, x="x":kotlin.String, e=kotlin.RuntimeException, y="y":kotlin.String +// test.kt:11 box: i=0:number, x="x":kotlin.String +// test.kt:12 box: i=0:number, x="x":kotlin.String +// test.kt:12 box: i=0:number, x="x":kotlin.String +// test.kt:13 box: i=0:number, x="x":kotlin.String, e=kotlin.RuntimeException +// test.kt:14 box: i=0:number, x="x":kotlin.String, e=kotlin.RuntimeException, y="y":kotlin.String +// test.kt:15 box: i=0:number, x="x":kotlin.String, e=kotlin.RuntimeException, y="y":kotlin.String, z="z":kotlin.String // test.kt:17 box: i=0:number, x="x":kotlin.String, e=kotlin.RuntimeException, y="y":kotlin.String, z="z":kotlin.String -// test.kt:19 box: i=0:number, x="x":kotlin.String, e=kotlin.RuntimeException, y="y":kotlin.String, z="z":kotlin.String -// test.kt:23 box: i=0:number, x="x":kotlin.String, e=kotlin.RuntimeException, y="y":kotlin.String, z="z":kotlin.String +// test.kt:21 box: i=0:number, x="x":kotlin.String, e=kotlin.RuntimeException, y="y":kotlin.String, z="z":kotlin.String diff --git a/compiler/testData/debug/localVariables/tryFinally13.kt b/compiler/testData/debug/localVariables/tryFinally13.kt index ce6e2cb538a..d19a8343274 100644 --- a/compiler/testData/debug/localVariables/tryFinally13.kt +++ b/compiler/testData/debug/localVariables/tryFinally13.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND_K2_LIGHT_TREE: JVM_IR -// Reason: KT-56755 // The local variables `y` and `i` are visible in finally blocks with old backend. // IGNORE_BACKEND: JVM // WITH_STDLIB @@ -25,27 +23,27 @@ fun box(): String { } // EXPECTATIONS JVM JVM_IR -// test.kt:9 box: -// test.kt:10 box: -// test.kt:11 box: i:int=0:int +// test.kt:7 box: +// test.kt:8 box: +// test.kt:9 box: i:int=0:int +// test.kt:10 box: i:int=0:int +// test.kt:11 box: i:int=0:int, x:java.lang.String="x":java.lang.String // test.kt:12 box: i:int=0:int -// test.kt:13 box: i:int=0:int, x:java.lang.String="x":java.lang.String -// test.kt:14 box: i:int=0:int -// test.kt:15 box: i:int=0:int, e:java.lang.Exception=java.lang.RuntimeException -// test.kt:16 box: i:int=0:int, e:java.lang.Exception=java.lang.RuntimeException, y:java.lang.String="y":java.lang.String -// test.kt:18 box: i:int=0:int -// test.kt:22 box: +// test.kt:13 box: i:int=0:int, e:java.lang.Exception=java.lang.RuntimeException +// test.kt:14 box: i:int=0:int, e:java.lang.Exception=java.lang.RuntimeException, y:java.lang.String="y":java.lang.String +// test.kt:16 box: i:int=0:int +// test.kt:20 box: // EXPECTATIONS JS_IR -// test.kt:10 box: -// test.kt:10 box: -// test.kt:10 box: +// test.kt:8 box: +// test.kt:8 box: +// test.kt:8 box: +// test.kt:8 box: i=0:number // test.kt:10 box: i=0:number -// test.kt:12 box: i=0:number -// test.kt:13 box: i=0:number, x="x":kotlin.String -// test.kt:14 box: i=0:number, x="x":kotlin.String -// test.kt:14 box: i=0:number, x="x":kotlin.String -// test.kt:15 box: i=0:number, x="x":kotlin.String, e=kotlin.RuntimeException +// test.kt:11 box: i=0:number, x="x":kotlin.String +// test.kt:12 box: i=0:number, x="x":kotlin.String +// test.kt:12 box: i=0:number, x="x":kotlin.String +// test.kt:13 box: i=0:number, x="x":kotlin.String, e=kotlin.RuntimeException +// test.kt:14 box: i=0:number, x="x":kotlin.String, e=kotlin.RuntimeException, y="y":kotlin.String // test.kt:16 box: i=0:number, x="x":kotlin.String, e=kotlin.RuntimeException, y="y":kotlin.String -// test.kt:18 box: i=0:number, x="x":kotlin.String, e=kotlin.RuntimeException, y="y":kotlin.String -// test.kt:22 box: i=0:number, x="x":kotlin.String, e=kotlin.RuntimeException, y="y":kotlin.String +// test.kt:20 box: i=0:number, x="x":kotlin.String, e=kotlin.RuntimeException, y="y":kotlin.String diff --git a/compiler/testData/debug/localVariables/tryFinally7.kt b/compiler/testData/debug/localVariables/tryFinally7.kt index 8436147b326..cfd77add59f 100644 --- a/compiler/testData/debug/localVariables/tryFinally7.kt +++ b/compiler/testData/debug/localVariables/tryFinally7.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND_K2_LIGHT_TREE: JVM_IR -// Reason: KT-56755 // The old backend has `y` and `j` visible on the finally block. // IGNORE_BACKEND: JVM // WITH_STDLIB @@ -36,36 +34,36 @@ fun box() { } // EXPECTATIONS JVM JVM_IR -// test.kt:34 box: -// test.kt:15 compute: -// test.kt:16 compute: -// test.kt:17 compute: y:int=42:int -// test.kt:18 compute: y:int=42:int, i:int=0:int -// test.kt:20 compute: -// test.kt:21 compute: e:java.lang.Exception=java.lang.RuntimeException -// test.kt:22 compute: e:java.lang.Exception=java.lang.RuntimeException, y:int=32:int -// test.kt:23 compute: e:java.lang.Exception=java.lang.RuntimeException, y:int=32:int, j:int=0:int -// test.kt:9 compute: e:java.lang.Exception=java.lang.RuntimeException, y:int=32:int, j:int=0:int, $i$f$f:int=0:int -// test.kt:24 compute: e:java.lang.Exception=java.lang.RuntimeException, y:int=32:int, j:int=0:int, $i$f$f:int=0:int, $i$a$-f-TestKt$compute$1:int=0:int -// test.kt:28 compute: -// test.kt:34 box: -// test.kt:35 box: result:java.lang.String="NON_LOCAL_RETURN":java.lang.String -// test.kt:36 box: result:java.lang.String="NON_LOCAL_RETURN":java.lang.String, localX:java.lang.String="OK":java.lang.String +// test.kt:32 box: +// test.kt:13 compute: +// test.kt:14 compute: +// test.kt:15 compute: y:int=42:int +// test.kt:16 compute: y:int=42:int, i:int=0:int +// test.kt:18 compute: +// test.kt:19 compute: e:java.lang.Exception=java.lang.RuntimeException +// test.kt:20 compute: e:java.lang.Exception=java.lang.RuntimeException, y:int=32:int +// test.kt:21 compute: e:java.lang.Exception=java.lang.RuntimeException, y:int=32:int, j:int=0:int +// test.kt:7 compute: e:java.lang.Exception=java.lang.RuntimeException, y:int=32:int, j:int=0:int, $i$f$f:int=0:int +// test.kt:22 compute: e:java.lang.Exception=java.lang.RuntimeException, y:int=32:int, j:int=0:int, $i$f$f:int=0:int, $i$a$-f-TestKt$compute$1:int=0:int +// test.kt:26 compute: +// test.kt:32 box: +// test.kt:33 box: result:java.lang.String="NON_LOCAL_RETURN":java.lang.String +// test.kt:34 box: result:java.lang.String="NON_LOCAL_RETURN":java.lang.String, localX:java.lang.String="OK":java.lang.String // EXPECTATIONS JS_IR -// test.kt:34 box: -// test.kt:16 compute: -// test.kt:17 compute: y=42:number -// test.kt:17 compute: y=42:number -// test.kt:17 compute: y=42:number -// test.kt:17 compute: y=42:number, i=0:number +// test.kt:32 box: +// test.kt:14 compute: +// test.kt:15 compute: y=42:number +// test.kt:15 compute: y=42:number +// test.kt:15 compute: y=42:number +// test.kt:15 compute: y=42:number, i=0:number +// test.kt:16 compute: y=42:number, i=0:number // test.kt:18 compute: y=42:number, i=0:number -// test.kt:20 compute: y=42:number, i=0:number -// test.kt:20 compute: y=42:number, i=0:number -// test.kt:21 compute: y=42:number, i=0:number, e=kotlin.RuntimeException -// test.kt:22 compute: y=42:number, i=0:number, e=kotlin.RuntimeException, y=32:number -// test.kt:22 compute: y=42:number, i=0:number, e=kotlin.RuntimeException, y=32:number -// test.kt:22 compute: y=42:number, i=0:number, e=kotlin.RuntimeException, y=32:number +// test.kt:18 compute: y=42:number, i=0:number +// test.kt:19 compute: y=42:number, i=0:number, e=kotlin.RuntimeException +// test.kt:20 compute: y=42:number, i=0:number, e=kotlin.RuntimeException, y=32:number +// test.kt:20 compute: y=42:number, i=0:number, e=kotlin.RuntimeException, y=32:number +// test.kt:20 compute: y=42:number, i=0:number, e=kotlin.RuntimeException, y=32:number +// test.kt:20 compute: y=42:number, i=0:number, e=kotlin.RuntimeException, y=32:number, j=0:number // test.kt:22 compute: y=42:number, i=0:number, e=kotlin.RuntimeException, y=32:number, j=0:number -// test.kt:24 compute: y=42:number, i=0:number, e=kotlin.RuntimeException, y=32:number, j=0:number -// test.kt:28 compute: y=42:number, i=0:number, e=kotlin.RuntimeException, y=32:number, j=0:number +// test.kt:26 compute: y=42:number, i=0:number, e=kotlin.RuntimeException, y=32:number, j=0:number diff --git a/compiler/testData/debug/localVariables/tryFinally8.kt b/compiler/testData/debug/localVariables/tryFinally8.kt index 6fba761745c..2e7e1729cb4 100644 --- a/compiler/testData/debug/localVariables/tryFinally8.kt +++ b/compiler/testData/debug/localVariables/tryFinally8.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND_K2_LIGHT_TREE: JVM_IR -// Reason: KT-56755 // The old backend has `y` and `i` visible on the finally block. // IGNORE_BACKEND: JVM // WITH_STDLIB @@ -38,37 +36,37 @@ fun box() { } // EXPECTATIONS JVM JVM_IR -// test.kt:36 box: -// test.kt:22 compute: -// test.kt:23 compute: -// test.kt:24 compute: y:int=42:int -// test.kt:25 compute: y:int=42:int, i:int=0:int -// test.kt:9 compute: y:int=42:int, i:int=0:int, $i$f$f:int=0:int -// test.kt:10 compute: y:int=42:int, i:int=0:int, $i$f$f:int=0:int -// test.kt:11 compute: y:int=42:int, i:int=0:int, $i$f$f:int=0:int, z$iv:int=32:int -// test.kt:12 compute: y:int=42:int, i:int=0:int, $i$f$f:int=0:int, z$iv:int=32:int, j$iv:int=0:int -// test.kt:14 compute: y:int=42:int, i:int=0:int, $i$f$f:int=0:int -// test.kt:15 compute: y:int=42:int, i:int=0:int, $i$f$f:int=0:int, e$iv:java.lang.Exception=java.lang.RuntimeException -// test.kt:26 compute: y:int=42:int, i:int=0:int, $i$f$f:int=0:int, e$iv:java.lang.Exception=java.lang.RuntimeException, $i$a$-f-TestKt$compute$1:int=0:int -// test.kt:30 compute: -// test.kt:36 box: -// test.kt:37 box: result:java.lang.String="NON_LOCAL_RETURN":java.lang.String -// test.kt:38 box: result:java.lang.String="NON_LOCAL_RETURN":java.lang.String, localX:java.lang.String="OK":java.lang.String +// test.kt:34 box: +// test.kt:20 compute: +// test.kt:21 compute: +// test.kt:22 compute: y:int=42:int +// test.kt:23 compute: y:int=42:int, i:int=0:int +// test.kt:7 compute: y:int=42:int, i:int=0:int, $i$f$f:int=0:int +// test.kt:8 compute: y:int=42:int, i:int=0:int, $i$f$f:int=0:int +// test.kt:9 compute: y:int=42:int, i:int=0:int, $i$f$f:int=0:int, z$iv:int=32:int +// test.kt:10 compute: y:int=42:int, i:int=0:int, $i$f$f:int=0:int, z$iv:int=32:int, j$iv:int=0:int +// test.kt:12 compute: y:int=42:int, i:int=0:int, $i$f$f:int=0:int +// test.kt:13 compute: y:int=42:int, i:int=0:int, $i$f$f:int=0:int, e$iv:java.lang.Exception=java.lang.RuntimeException +// test.kt:24 compute: y:int=42:int, i:int=0:int, $i$f$f:int=0:int, e$iv:java.lang.Exception=java.lang.RuntimeException, $i$a$-f-TestKt$compute$1:int=0:int +// test.kt:28 compute: +// test.kt:34 box: +// test.kt:35 box: result:java.lang.String="NON_LOCAL_RETURN":java.lang.String +// test.kt:36 box: result:java.lang.String="NON_LOCAL_RETURN":java.lang.String, localX:java.lang.String="OK":java.lang.String // EXPECTATIONS JS_IR -// test.kt:36 box: -// test.kt:23 compute: -// test.kt:24 compute: y=42:number -// test.kt:24 compute: y=42:number -// test.kt:24 compute: y=42:number -// test.kt:24 compute: y=42:number, i=0:number -// test.kt:10 compute: y=42:number, i=0:number -// test.kt:11 compute: y=42:number, i=0:number, z=32:number -// test.kt:11 compute: y=42:number, i=0:number, z=32:number -// test.kt:11 compute: y=42:number, i=0:number, z=32:number -// test.kt:11 compute: y=42:number, i=0:number, z=32:number, j=0:number +// test.kt:34 box: +// test.kt:21 compute: +// test.kt:22 compute: y=42:number +// test.kt:22 compute: y=42:number +// test.kt:22 compute: y=42:number +// test.kt:22 compute: y=42:number, i=0:number +// test.kt:8 compute: y=42:number, i=0:number +// test.kt:9 compute: y=42:number, i=0:number, z=32:number +// test.kt:9 compute: y=42:number, i=0:number, z=32:number +// test.kt:9 compute: y=42:number, i=0:number, z=32:number +// test.kt:9 compute: y=42:number, i=0:number, z=32:number, j=0:number +// test.kt:10 compute: y=42:number, i=0:number, z=32:number, j=0:number // test.kt:12 compute: y=42:number, i=0:number, z=32:number, j=0:number -// test.kt:14 compute: y=42:number, i=0:number, z=32:number, j=0:number -// test.kt:14 compute: y=42:number, i=0:number, z=32:number, j=0:number -// test.kt:26 compute: y=42:number, i=0:number, z=32:number, j=0:number, e=kotlin.RuntimeException -// test.kt:30 compute: y=42:number, i=0:number, z=32:number, j=0:number, e=kotlin.RuntimeException +// test.kt:12 compute: y=42:number, i=0:number, z=32:number, j=0:number +// test.kt:24 compute: y=42:number, i=0:number, z=32:number, j=0:number, e=kotlin.RuntimeException +// test.kt:28 compute: y=42:number, i=0:number, z=32:number, j=0:number, e=kotlin.RuntimeException diff --git a/compiler/testData/debug/stepping/throwException.kt b/compiler/testData/debug/stepping/throwException.kt index c6ae2cd4404..8c01a89366f 100644 --- a/compiler/testData/debug/stepping/throwException.kt +++ b/compiler/testData/debug/stepping/throwException.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND_K2_LIGHT_TREE: JVM_IR -// Reason: KT-56755 // FILE: test.kt fun box() { val a = 1 @@ -17,25 +15,25 @@ fun throwIfLess(a: Int, b: Int) { throw IllegalStateException() } // EXPECTATIONS JVM JVM_IR +// test.kt:3 box +// test.kt:4 box // test.kt:5 box // test.kt:6 box +// test.kt:14 throwIfLess +// test.kt:15 throwIfLess // test.kt:7 box // test.kt:8 box -// test.kt:16 throwIfLess -// test.kt:17 throwIfLess -// test.kt:9 box -// test.kt:10 box -// test.kt:16 throwIfLess -// test.kt:17 throwIfLess +// test.kt:14 throwIfLess +// test.kt:15 throwIfLess // EXPECTATIONS JS_IR -// test.kt:5 box +// test.kt:3 box +// test.kt:4 box // test.kt:6 box +// test.kt:14 throwIfLess +// test.kt:15 throwIfLess +// test.kt:7 box +// test.kt:7 box // test.kt:8 box -// test.kt:16 throwIfLess -// test.kt:17 throwIfLess -// test.kt:9 box -// test.kt:9 box -// test.kt:10 box -// test.kt:16 throwIfLess -// test.kt:17 throwIfLess +// test.kt:14 throwIfLess +// test.kt:15 throwIfLess diff --git a/compiler/testData/debug/stepping/tryCatch.kt b/compiler/testData/debug/stepping/tryCatch.kt index 3146f04dcfd..661d04ddd6b 100644 --- a/compiler/testData/debug/stepping/tryCatch.kt +++ b/compiler/testData/debug/stepping/tryCatch.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND_K2_LIGHT_TREE: JVM_IR -// Reason: KT-56755 // FILE: test.kt fun foo(shouldThrow: Boolean) { @@ -17,28 +15,28 @@ fun box() { } // EXPECTATIONS JVM JVM_IR -// test.kt:15 box -// test.kt:6 foo -// test.kt:7 foo -// test.kt:11 foo -// test.kt:12 foo -// test.kt:16 box -// test.kt:6 foo -// test.kt:7 foo -// test.kt:8 foo +// test.kt:13 box +// test.kt:4 foo +// test.kt:5 foo // test.kt:9 foo -// test.kt:11 foo -// test.kt:12 foo -// test.kt:17 box +// test.kt:10 foo +// test.kt:14 box +// test.kt:4 foo +// test.kt:5 foo +// test.kt:6 foo +// test.kt:7 foo +// test.kt:9 foo +// test.kt:10 foo +// test.kt:15 box // EXPECTATIONS JS_IR +// test.kt:13 box +// test.kt:5 foo +// test.kt:10 foo +// test.kt:14 box +// test.kt:5 foo +// test.kt:5 foo +// test.kt:6 foo +// test.kt:6 foo +// test.kt:10 foo // test.kt:15 box -// test.kt:7 foo -// test.kt:12 foo -// test.kt:16 box -// test.kt:7 foo -// test.kt:7 foo -// test.kt:8 foo -// test.kt:8 foo -// test.kt:12 foo -// test.kt:17 box diff --git a/compiler/testData/debug/stepping/tryCatchExpression.kt b/compiler/testData/debug/stepping/tryCatchExpression.kt index 4cbf582b5c2..55f9ee7ce5b 100644 --- a/compiler/testData/debug/stepping/tryCatchExpression.kt +++ b/compiler/testData/debug/stepping/tryCatchExpression.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND_K2_LIGHT_TREE: JVM_IR -// Reason: KT-56755 // FILE: test.kt fun foo() { @@ -50,108 +48,108 @@ fun box() { } // EXPECTATIONS JVM JVM_IR +// test.kt:41 box +// test.kt:4 foo +// test.kt:5 foo +// test.kt:28 mightThrow +// test.kt:29 mightThrow +// test.kt:5 foo +// test.kt:10 foo +// test.kt:11 foo +// test.kt:32 mightThrow2 +// test.kt:33 mightThrow2 +// test.kt:11 foo +// test.kt:10 foo +// test.kt:16 foo +// test.kt:17 foo +// test.kt:36 mightThrow3 +// test.kt:37 mightThrow3 +// test.kt:17 foo +// test.kt:16 foo +// test.kt:21 foo +// test.kt:42 box // test.kt:43 box -// test.kt:6 foo -// test.kt:7 foo -// test.kt:30 mightThrow -// test.kt:31 mightThrow -// test.kt:7 foo -// test.kt:12 foo -// test.kt:13 foo -// test.kt:34 mightThrow2 -// test.kt:35 mightThrow2 -// test.kt:13 foo -// test.kt:12 foo +// test.kt:4 foo +// test.kt:5 foo +// test.kt:28 mightThrow +// test.kt:29 mightThrow +// test.kt:5 foo +// test.kt:10 foo +// test.kt:11 foo +// test.kt:32 mightThrow2 +// test.kt:33 mightThrow2 +// test.kt:11 foo +// test.kt:10 foo +// test.kt:16 foo +// test.kt:17 foo +// test.kt:36 mightThrow3 // test.kt:18 foo // test.kt:19 foo -// test.kt:38 mightThrow3 -// test.kt:39 mightThrow3 -// test.kt:19 foo -// test.kt:18 foo -// test.kt:23 foo // test.kt:44 box // test.kt:45 box -// test.kt:6 foo -// test.kt:7 foo -// test.kt:30 mightThrow -// test.kt:31 mightThrow -// test.kt:7 foo +// test.kt:4 foo +// test.kt:5 foo +// test.kt:28 mightThrow +// test.kt:29 mightThrow +// test.kt:5 foo +// test.kt:10 foo +// test.kt:11 foo +// test.kt:32 mightThrow2 // test.kt:12 foo // test.kt:13 foo -// test.kt:34 mightThrow2 -// test.kt:35 mightThrow2 -// test.kt:13 foo -// test.kt:12 foo -// test.kt:18 foo -// test.kt:19 foo -// test.kt:38 mightThrow3 -// test.kt:20 foo -// test.kt:21 foo // test.kt:46 box // test.kt:47 box +// test.kt:4 foo +// test.kt:5 foo +// test.kt:28 mightThrow // test.kt:6 foo // test.kt:7 foo -// test.kt:30 mightThrow -// test.kt:31 mightThrow -// test.kt:7 foo -// test.kt:12 foo -// test.kt:13 foo -// test.kt:34 mightThrow2 -// test.kt:14 foo -// test.kt:15 foo // test.kt:48 box -// test.kt:49 box -// test.kt:6 foo -// test.kt:7 foo -// test.kt:30 mightThrow -// test.kt:8 foo -// test.kt:9 foo -// test.kt:50 box // EXPECTATIONS JS_IR +// test.kt:41 box +// test.kt:5 foo +// test.kt:28 mightThrow +// test.kt:29 mightThrow +// test.kt:11 foo +// test.kt:32 mightThrow2 +// test.kt:33 mightThrow2 +// test.kt:10 foo +// test.kt:17 foo +// test.kt:36 mightThrow3 +// test.kt:37 mightThrow3 +// test.kt:16 foo +// test.kt:21 foo +// test.kt:42 box // test.kt:43 box -// test.kt:7 foo -// test.kt:30 mightThrow -// test.kt:31 mightThrow -// test.kt:13 foo -// test.kt:34 mightThrow2 -// test.kt:35 mightThrow2 -// test.kt:12 foo -// test.kt:19 foo -// test.kt:38 mightThrow3 -// test.kt:39 mightThrow3 +// test.kt:5 foo +// test.kt:28 mightThrow +// test.kt:29 mightThrow +// test.kt:11 foo +// test.kt:32 mightThrow2 +// test.kt:33 mightThrow2 +// test.kt:10 foo +// test.kt:17 foo +// test.kt:36 mightThrow3 +// test.kt:36 mightThrow3 // test.kt:18 foo -// test.kt:23 foo +// test.kt:19 foo // test.kt:44 box // test.kt:45 box -// test.kt:7 foo -// test.kt:30 mightThrow -// test.kt:31 mightThrow -// test.kt:13 foo -// test.kt:34 mightThrow2 -// test.kt:35 mightThrow2 +// test.kt:5 foo +// test.kt:28 mightThrow +// test.kt:29 mightThrow +// test.kt:11 foo +// test.kt:32 mightThrow2 +// test.kt:32 mightThrow2 // test.kt:12 foo -// test.kt:19 foo -// test.kt:38 mightThrow3 -// test.kt:38 mightThrow3 -// test.kt:20 foo -// test.kt:21 foo +// test.kt:13 foo // test.kt:46 box // test.kt:47 box +// test.kt:5 foo +// test.kt:28 mightThrow +// test.kt:28 mightThrow +// test.kt:6 foo +// test.kt:6 foo // test.kt:7 foo -// test.kt:30 mightThrow -// test.kt:31 mightThrow -// test.kt:13 foo -// test.kt:34 mightThrow2 -// test.kt:34 mightThrow2 -// test.kt:14 foo -// test.kt:15 foo // test.kt:48 box -// test.kt:49 box -// test.kt:7 foo -// test.kt:30 mightThrow -// test.kt:30 mightThrow -// test.kt:8 foo -// test.kt:8 foo -// test.kt:9 foo -// test.kt:50 box diff --git a/compiler/testData/debug/stepping/tryCatchFinally.kt b/compiler/testData/debug/stepping/tryCatchFinally.kt index f2125e57a81..bcceb3a4c9a 100644 --- a/compiler/testData/debug/stepping/tryCatchFinally.kt +++ b/compiler/testData/debug/stepping/tryCatchFinally.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND_K2_LIGHT_TREE: JVM_IR -// Reason: KT-56755 // FILE: test.kt fun foo() { @@ -40,93 +38,93 @@ fun box() { } // EXPECTATIONS JVM JVM_IR -// test.kt:35 box -// test.kt:6 foo -// test.kt:7 foo -// test.kt:27 mightThrow -// test.kt:28 mightThrow -// test.kt:11 foo +// test.kt:33 box +// test.kt:4 foo +// test.kt:5 foo +// test.kt:25 mightThrow +// test.kt:26 mightThrow +// test.kt:9 foo +// test.kt:10 foo +// test.kt:12 foo +// test.kt:13 foo +// test.kt:29 mightThrow2 +// test.kt:30 mightThrow2 +// test.kt:13 foo +// test.kt:17 foo +// test.kt:18 foo // test.kt:12 foo -// test.kt:14 foo -// test.kt:15 foo -// test.kt:31 mightThrow2 -// test.kt:32 mightThrow2 -// test.kt:15 foo // test.kt:19 foo -// test.kt:20 foo +// test.kt:34 box +// test.kt:35 box +// test.kt:4 foo +// test.kt:5 foo +// test.kt:25 mightThrow +// test.kt:26 mightThrow +// test.kt:9 foo +// test.kt:10 foo +// test.kt:12 foo +// test.kt:13 foo +// test.kt:29 mightThrow2 // test.kt:14 foo -// test.kt:21 foo +// test.kt:15 foo +// test.kt:17 foo +// test.kt:18 foo +// test.kt:12 foo +// test.kt:19 foo // test.kt:36 box // test.kt:37 box +// test.kt:4 foo +// test.kt:5 foo +// test.kt:25 mightThrow // test.kt:6 foo // test.kt:7 foo -// test.kt:27 mightThrow -// test.kt:28 mightThrow -// test.kt:11 foo -// test.kt:12 foo -// test.kt:14 foo -// test.kt:15 foo -// test.kt:31 mightThrow2 -// test.kt:16 foo -// test.kt:17 foo -// test.kt:19 foo -// test.kt:20 foo -// test.kt:14 foo -// test.kt:21 foo -// test.kt:38 box -// test.kt:39 box -// test.kt:6 foo -// test.kt:7 foo -// test.kt:27 mightThrow -// test.kt:8 foo // test.kt:9 foo -// test.kt:11 foo +// test.kt:10 foo // test.kt:12 foo +// test.kt:13 foo +// test.kt:29 mightThrow2 // test.kt:14 foo // test.kt:15 foo -// test.kt:31 mightThrow2 -// test.kt:16 foo // test.kt:17 foo +// test.kt:18 foo +// test.kt:12 foo // test.kt:19 foo -// test.kt:20 foo -// test.kt:14 foo -// test.kt:21 foo -// test.kt:40 box +// test.kt:38 box // EXPECTATIONS JS_IR +// test.kt:33 box +// test.kt:5 foo +// test.kt:25 mightThrow +// test.kt:26 mightThrow +// test.kt:13 foo +// test.kt:29 mightThrow2 +// test.kt:30 mightThrow2 +// test.kt:12 foo +// test.kt:19 foo +// test.kt:34 box // test.kt:35 box -// test.kt:7 foo -// test.kt:27 mightThrow -// test.kt:28 mightThrow -// test.kt:15 foo -// test.kt:31 mightThrow2 -// test.kt:32 mightThrow2 +// test.kt:5 foo +// test.kt:25 mightThrow +// test.kt:26 mightThrow +// test.kt:13 foo +// test.kt:29 mightThrow2 +// test.kt:29 mightThrow2 // test.kt:14 foo -// test.kt:21 foo +// test.kt:15 foo +// test.kt:12 foo +// test.kt:19 foo // test.kt:36 box // test.kt:37 box -// test.kt:7 foo -// test.kt:27 mightThrow -// test.kt:28 mightThrow -// test.kt:15 foo -// test.kt:31 mightThrow2 -// test.kt:31 mightThrow2 -// test.kt:16 foo -// test.kt:17 foo +// test.kt:5 foo +// test.kt:25 mightThrow +// test.kt:25 mightThrow +// test.kt:6 foo +// test.kt:6 foo +// test.kt:13 foo +// test.kt:29 mightThrow2 +// test.kt:29 mightThrow2 // test.kt:14 foo -// test.kt:21 foo +// test.kt:15 foo +// test.kt:12 foo +// test.kt:19 foo // test.kt:38 box -// test.kt:39 box -// test.kt:7 foo -// test.kt:27 mightThrow -// test.kt:27 mightThrow -// test.kt:8 foo -// test.kt:8 foo -// test.kt:15 foo -// test.kt:31 mightThrow2 -// test.kt:31 mightThrow2 -// test.kt:16 foo -// test.kt:17 foo -// test.kt:14 foo -// test.kt:21 foo -// test.kt:40 box diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BytecodeTextTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BytecodeTextTestGenerated.java index 504125d10bb..349922f8a45 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BytecodeTextTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BytecodeTextTestGenerated.java @@ -319,6 +319,12 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest { runTest("compiler/testData/codegen/bytecodeText/kt5016intOrNull.kt"); } + @Test + @TestMetadata("kt56923.kt") + public void testKt56923() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/kt56923.kt"); + } + @Test @TestMetadata("kt7188.kt") public void testKt7188() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBytecodeTextTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBytecodeTextTestGenerated.java index 5d7878c2d74..7797c6e5bec 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBytecodeTextTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBytecodeTextTestGenerated.java @@ -349,6 +349,12 @@ public class IrBytecodeTextTestGenerated extends AbstractIrBytecodeTextTest { runTest("compiler/testData/codegen/bytecodeText/kt5016intOrNull.kt"); } + @Test + @TestMetadata("kt56923.kt") + public void testKt56923() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/kt56923.kt"); + } + @Test @TestMetadata("kt7188.kt") public void testKt7188() throws Exception {