JVM: do not put public field access into a single expression block

It affects the `is IrGetField` check in
TypeOperatorLowering.computeNotNullAssertionText, which leads to missing
NPE messages when accessing backing fields of public properties.

 #KT-64615
This commit is contained in:
Alexander Udalov
2024-01-09 00:10:46 +01:00
committed by Space Team
parent 96b2f13397
commit f01e633f8b
12 changed files with 92 additions and 1 deletions
@@ -31436,6 +31436,12 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/notNullAssertions/expressionAssertionMessages"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("backingField.kt")
public void testBackingField() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/notNullAssertions/expressionAssertionMessages/backingField.kt");
}
@Test
@TestMetadata("field_after.kt")
public void testField_after() throws Exception {
@@ -31436,6 +31436,12 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/notNullAssertions/expressionAssertionMessages"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("backingField.kt")
public void testBackingField() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/notNullAssertions/expressionAssertionMessages/backingField.kt");
}
@Test
@TestMetadata("field_after.kt")
public void testField_after() throws Exception {