[FIR] Calculate lazy initializers in properties with backing fields
More tests should be added in the future
This commit is contained in:
+10
@@ -151,6 +151,16 @@ public class LightTree2FirConverterTestCaseGenerated extends AbstractLightTree2F
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/noPrimaryConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("propertyWithBackingField.kt")
|
||||
public void testPropertyWithBackingField() throws Exception {
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/propertyWithBackingField.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("propertyWithBackingFieldDifferentTypes.kt")
|
||||
public void testPropertyWithBackingFieldDifferentTypes() throws Exception {
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/propertyWithBackingFieldDifferentTypes.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("simpleClass.kt")
|
||||
public void testSimpleClass() throws Exception {
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/simpleClass.kt");
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fun resolveMe() {
|
||||
receive(property)
|
||||
}
|
||||
|
||||
val property: Int
|
||||
field: Int = 10
|
||||
|
||||
fun receive(s: Int) {}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
FILE: propertyWithBackingField.kt
|
||||
public? final? fun resolveMe(): R|kotlin/Unit| { LAZY_BLOCK }
|
||||
public? final? val property: Int
|
||||
private <explicit backing field>: Int = LAZY_EXPRESSION
|
||||
public? get(): Int
|
||||
public? final? fun receive(s: Int): R|kotlin/Unit| { LAZY_BLOCK }
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
FILE: propertyWithBackingField.kt
|
||||
public? final? fun resolveMe(): R|kotlin/Unit| {
|
||||
receive#(property#)
|
||||
}
|
||||
public? final? val property: Int
|
||||
private <explicit backing field>: Int = IntegerLiteral(10)
|
||||
public? get(): Int
|
||||
public? final? fun receive(s: Int): R|kotlin/Unit| {
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fun resolveMe() {
|
||||
receive(property)
|
||||
}
|
||||
|
||||
val property: Number
|
||||
field: Int = 10
|
||||
|
||||
fun receive(s: Int) {}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
FILE: propertyWithBackingFieldDifferentTypes.kt
|
||||
public? final? fun resolveMe(): R|kotlin/Unit| { LAZY_BLOCK }
|
||||
public? final? val property: Number
|
||||
private <explicit backing field>: Int = LAZY_EXPRESSION
|
||||
public? get(): Number
|
||||
public? final? fun receive(s: Int): R|kotlin/Unit| { LAZY_BLOCK }
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
FILE: propertyWithBackingFieldDifferentTypes.kt
|
||||
public? final? fun resolveMe(): R|kotlin/Unit| {
|
||||
receive#(property#)
|
||||
}
|
||||
public? final? val property: Number
|
||||
private <explicit backing field>: Int = IntegerLiteral(10)
|
||||
public? get(): Number
|
||||
public? final? fun receive(s: Int): R|kotlin/Unit| {
|
||||
}
|
||||
+10
@@ -151,6 +151,16 @@ public class RawFirBuilderLazyBodiesTestCaseGenerated extends AbstractRawFirBuil
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/noPrimaryConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("propertyWithBackingField.kt")
|
||||
public void testPropertyWithBackingField() throws Exception {
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/propertyWithBackingField.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("propertyWithBackingFieldDifferentTypes.kt")
|
||||
public void testPropertyWithBackingFieldDifferentTypes() throws Exception {
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/propertyWithBackingFieldDifferentTypes.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("simpleClass.kt")
|
||||
public void testSimpleClass() throws Exception {
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/simpleClass.kt");
|
||||
|
||||
+10
@@ -151,6 +151,16 @@ public class RawFirBuilderTestCaseGenerated extends AbstractRawFirBuilderTestCas
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/noPrimaryConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("propertyWithBackingField.kt")
|
||||
public void testPropertyWithBackingField() throws Exception {
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/propertyWithBackingField.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("propertyWithBackingFieldDifferentTypes.kt")
|
||||
public void testPropertyWithBackingFieldDifferentTypes() throws Exception {
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/propertyWithBackingFieldDifferentTypes.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("simpleClass.kt")
|
||||
public void testSimpleClass() throws Exception {
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/simpleClass.kt");
|
||||
|
||||
+12
@@ -165,6 +165,18 @@ public class FirVisualizerForRawFirDataGenerated extends AbstractFirVisualizerTe
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/noPrimaryConstructor.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertyWithBackingField.kt")
|
||||
public void testPropertyWithBackingField() throws Exception {
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/propertyWithBackingField.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertyWithBackingFieldDifferentTypes.kt")
|
||||
public void testPropertyWithBackingFieldDifferentTypes() throws Exception {
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/propertyWithBackingFieldDifferentTypes.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("simpleClass.kt")
|
||||
public void testSimpleClass() throws Exception {
|
||||
|
||||
+12
@@ -165,6 +165,18 @@ public class PsiVisualizerForRawFirDataGenerated extends AbstractPsiVisualizerTe
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/noPrimaryConstructor.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertyWithBackingField.kt")
|
||||
public void testPropertyWithBackingField() throws Exception {
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/propertyWithBackingField.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertyWithBackingFieldDifferentTypes.kt")
|
||||
public void testPropertyWithBackingFieldDifferentTypes() throws Exception {
|
||||
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/propertyWithBackingFieldDifferentTypes.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("simpleClass.kt")
|
||||
public void testSimpleClass() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user