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
@@ -26297,6 +26297,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaInterop/notNullAssertions/expressionAssertionMessages"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("backingField.kt")
public void testBackingField() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/notNullAssertions/expressionAssertionMessages/backingField.kt");
}
@TestMetadata("field_after.kt")
public void testField_after() throws Exception {
runTest("compiler/testData/codegen/box/javaInterop/notNullAssertions/expressionAssertionMessages/field_after.kt");