[Fir2IR] Fix fake override generation for lazy accessors

^KT-65595 Fixed
This commit is contained in:
Pavel Kunyavskiy
2024-02-08 11:53:45 +01:00
committed by Space Team
parent d121b529b5
commit b4062c8974
12 changed files with 83 additions and 1 deletions
@@ -19376,6 +19376,12 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo
runTest("compiler/testData/codegen/box/fakeOverride/kt65274.kt");
}
@Test
@TestMetadata("kt65695.kt")
public void testKt65695() throws Exception {
runTest("compiler/testData/codegen/box/fakeOverride/kt65695.kt");
}
@Test
@TestMetadata("methodOfAnyFromInterface.kt")
public void testMethodOfAnyFromInterface() throws Exception {
@@ -19376,6 +19376,12 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi
runTest("compiler/testData/codegen/box/fakeOverride/kt65274.kt");
}
@Test
@TestMetadata("kt65695.kt")
public void testKt65695() throws Exception {
runTest("compiler/testData/codegen/box/fakeOverride/kt65695.kt");
}
@Test
@TestMetadata("methodOfAnyFromInterface.kt")
public void testMethodOfAnyFromInterface() throws Exception {
@@ -347,7 +347,7 @@ internal class ClassMemberGenerator(
declarationStorage.leaveScope(this.symbol)
}
}
if (containingClass != null) {
if (containingClass != null && !components.configuration.useIrFakeOverrideBuilder) {
this.overriddenSymbols = property.generateOverriddenAccessorSymbols(containingClass, isGetter)
}
@@ -19365,6 +19365,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr
runTest("compiler/testData/codegen/box/fakeOverride/kt65274.kt");
}
@Test
@TestMetadata("kt65695.kt")
public void testKt65695() throws Exception {
runTest("compiler/testData/codegen/box/fakeOverride/kt65695.kt");
}
@Test
@TestMetadata("methodOfAnyFromInterface.kt")
public void testMethodOfAnyFromInterface() throws Exception {
@@ -19365,6 +19365,12 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated
runTest("compiler/testData/codegen/box/fakeOverride/kt65274.kt");
}
@Test
@TestMetadata("kt65695.kt")
public void testKt65695() throws Exception {
runTest("compiler/testData/codegen/box/fakeOverride/kt65695.kt");
}
@Test
@TestMetadata("methodOfAnyFromInterface.kt")
public void testMethodOfAnyFromInterface() throws Exception {
@@ -19365,6 +19365,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo
runTest("compiler/testData/codegen/box/fakeOverride/kt65274.kt");
}
@Test
@TestMetadata("kt65695.kt")
public void testKt65695() throws Exception {
runTest("compiler/testData/codegen/box/fakeOverride/kt65695.kt");
}
@Test
@TestMetadata("methodOfAnyFromInterface.kt")
public void testMethodOfAnyFromInterface() throws Exception {
+23
View File
@@ -0,0 +1,23 @@
// TARGET_BACKEND: JVM
// FILE: A.kt
interface A {
val x: String
}
// FILE: B.kt
interface B : A
// FILE: C.java
public interface C extends B { }
// FILE: D.kt
class D : C {
override val x: String
get() = "OK"
}
// FILE: box.kt
fun go(p: C): String = p.x
fun box(): String = go(D())
@@ -19365,6 +19365,12 @@ public class JvmAbiConsistencyTestBoxGenerated extends AbstractJvmAbiConsistency
runTest("compiler/testData/codegen/box/fakeOverride/kt65274.kt");
}
@Test
@TestMetadata("kt65695.kt")
public void testKt65695() throws Exception {
runTest("compiler/testData/codegen/box/fakeOverride/kt65695.kt");
}
@Test
@TestMetadata("methodOfAnyFromInterface.kt")
public void testMethodOfAnyFromInterface() throws Exception {
@@ -18507,6 +18507,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/fakeOverride/kt65274.kt");
}
@Test
@TestMetadata("kt65695.kt")
public void testKt65695() throws Exception {
runTest("compiler/testData/codegen/box/fakeOverride/kt65695.kt");
}
@Test
@TestMetadata("methodOfAnyFromInterface.kt")
public void testMethodOfAnyFromInterface() throws Exception {
@@ -19365,6 +19365,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/fakeOverride/kt65274.kt");
}
@Test
@TestMetadata("kt65695.kt")
public void testKt65695() throws Exception {
runTest("compiler/testData/codegen/box/fakeOverride/kt65695.kt");
}
@Test
@TestMetadata("methodOfAnyFromInterface.kt")
public void testMethodOfAnyFromInterface() throws Exception {
@@ -19365,6 +19365,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack
runTest("compiler/testData/codegen/box/fakeOverride/kt65274.kt");
}
@Test
@TestMetadata("kt65695.kt")
public void testKt65695() throws Exception {
runTest("compiler/testData/codegen/box/fakeOverride/kt65695.kt");
}
@Test
@TestMetadata("methodOfAnyFromInterface.kt")
public void testMethodOfAnyFromInterface() throws Exception {
@@ -16134,6 +16134,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/fakeOverride/kt65274.kt");
}
@TestMetadata("kt65695.kt")
public void testKt65695() throws Exception {
runTest("compiler/testData/codegen/box/fakeOverride/kt65695.kt");
}
@TestMetadata("methodOfAnyFromInterface.kt")
public void testMethodOfAnyFromInterface() throws Exception {
runTest("compiler/testData/codegen/box/fakeOverride/methodOfAnyFromInterface.kt");