[FIR2IR] Fix generation of val initialization after smart-cast

If neither setter nor backing field were found for an assignment call,
search overridden properties for backing fields.

^KT-57105 Fixed
This commit is contained in:
Kirill Rakhman
2023-03-07 11:16:44 +01:00
committed by Space Team
parent 2706e5502f
commit 0e721c8fc2
16 changed files with 99 additions and 3 deletions
@@ -38342,6 +38342,12 @@ public class K2NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTes
runTest("compiler/testData/codegen/box/smartCasts/nullSmartCast.kt");
}
@Test
@TestMetadata("propertyInitializationAfterSmartCast.kt")
public void testPropertyInitializationAfterSmartCast() throws Exception {
runTest("compiler/testData/codegen/box/smartCasts/propertyInitializationAfterSmartCast.kt");
}
@Test
@TestMetadata("smartCastInsideIf.kt")
public void testSmartCastInsideIf() throws Exception {
@@ -37862,6 +37862,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
runTest("compiler/testData/codegen/box/smartCasts/nullSmartCast.kt");
}
@Test
@TestMetadata("propertyInitializationAfterSmartCast.kt")
public void testPropertyInitializationAfterSmartCast() throws Exception {
runTest("compiler/testData/codegen/box/smartCasts/propertyInitializationAfterSmartCast.kt");
}
@Test
@TestMetadata("smartCastInsideIf.kt")
public void testSmartCastInsideIf() throws Exception {