[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:
+5
@@ -29916,6 +29916,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
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");
|
||||
|
||||
Reference in New Issue
Block a user