[FIR] Increase level of sequential when branches
Level of CFGNode is used to determine which call is a common one for
creating node with union of arguments (to merge flow from multiple
in-place lambdas). Before this change calls in different when branches
may have same node level, which entail passing smartcasts from moddle of
one branch to another
```
val x: Any = ...
when {
... -> run { x as String } // (1)
... -> {
run {
x.foo()
} // (2)
"hello"
}
}
```
Call `(1)` was assumed as argument of call `(2)` which is incorrect
#KT-44814 Fixed
This commit is contained in:
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java
Generated
+5
@@ -25527,6 +25527,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
||||
runTest("compiler/testData/codegen/box/smartCasts/kt44804.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt44814.kt")
|
||||
public void testKt44814() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/smartCasts/kt44814.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("lambdaArgumentWithoutType.kt")
|
||||
public void testLambdaArgumentWithoutType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/smartCasts/lambdaArgumentWithoutType.kt");
|
||||
|
||||
Generated
+5
@@ -25012,6 +25012,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/smartCasts/kt44804.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt44814.kt")
|
||||
public void testKt44814() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/smartCasts/kt44814.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("lambdaArgumentWithoutType.kt")
|
||||
public void testLambdaArgumentWithoutType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/smartCasts/lambdaArgumentWithoutType.kt");
|
||||
|
||||
Generated
+5
@@ -24972,6 +24972,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/smartCasts/kt44804.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt44814.kt")
|
||||
public void testKt44814() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/smartCasts/kt44814.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("lambdaArgumentWithoutType.kt")
|
||||
public void testLambdaArgumentWithoutType() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/smartCasts/lambdaArgumentWithoutType.kt");
|
||||
|
||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java
Generated
+5
@@ -13589,6 +13589,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
|
||||
runTest("compiler/testData/codegen/box/smartCasts/kt44804.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt44814.kt")
|
||||
public void testKt44814() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/smartCasts/kt44814.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("multipleSmartCast.kt")
|
||||
public void testMultipleSmartCast() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/smartCasts/multipleSmartCast.kt");
|
||||
|
||||
Reference in New Issue
Block a user