Minor. Add regression test for KT-59051

FIR2IR generates correct IR, unlike PSI2IR.
 #KT-59051 Fixed
This commit is contained in:
Ilmir Usmanov
2023-09-05 14:10:25 +02:00
committed by Space Team
parent 184b5cebe7
commit ae8b896c7b
8 changed files with 63 additions and 0 deletions
@@ -16191,6 +16191,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr
runTest("compiler/testData/codegen/box/delegation/differentModules.kt");
}
@Test
@TestMetadata("doubleDelegationEqualsHashcode.kt")
public void testDoubleDelegationEqualsHashcode() throws Exception {
runTest("compiler/testData/codegen/box/delegation/doubleDelegationEqualsHashcode.kt");
}
@Test
@TestMetadata("genericProperty.kt")
public void testGenericProperty() throws Exception {
@@ -16191,6 +16191,12 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated
runTest("compiler/testData/codegen/box/delegation/differentModules.kt");
}
@Test
@TestMetadata("doubleDelegationEqualsHashcode.kt")
public void testDoubleDelegationEqualsHashcode() throws Exception {
runTest("compiler/testData/codegen/box/delegation/doubleDelegationEqualsHashcode.kt");
}
@Test
@TestMetadata("genericProperty.kt")
public void testGenericProperty() throws Exception {
@@ -16191,6 +16191,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo
runTest("compiler/testData/codegen/box/delegation/differentModules.kt");
}
@Test
@TestMetadata("doubleDelegationEqualsHashcode.kt")
public void testDoubleDelegationEqualsHashcode() throws Exception {
runTest("compiler/testData/codegen/box/delegation/doubleDelegationEqualsHashcode.kt");
}
@Test
@TestMetadata("genericProperty.kt")
public void testGenericProperty() throws Exception {
@@ -0,0 +1,22 @@
// TARGET_BACKEND: JVM
// IGNORE_BACKEND_K1: JVM, JVM_IR
interface A {
override operator fun equals(other: Any?): Boolean
override fun hashCode(): Int
}
class AImpl : A {
override fun equals(other: Any?) = super.equals(other)
override fun hashCode() = super.hashCode()
}
interface B
class BImpl : B
class Impl : A by AImpl(), B by BImpl()
fun box(): String {
Impl()
return "OK"
}
@@ -15831,6 +15831,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/delegation/differentModules.kt");
}
@Test
@TestMetadata("doubleDelegationEqualsHashcode.kt")
public void testDoubleDelegationEqualsHashcode() throws Exception {
runTest("compiler/testData/codegen/box/delegation/doubleDelegationEqualsHashcode.kt");
}
@Test
@TestMetadata("genericProperty.kt")
public void testGenericProperty() throws Exception {
@@ -16191,6 +16191,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/delegation/differentModules.kt");
}
@Test
@TestMetadata("doubleDelegationEqualsHashcode.kt")
public void testDoubleDelegationEqualsHashcode() throws Exception {
runTest("compiler/testData/codegen/box/delegation/doubleDelegationEqualsHashcode.kt");
}
@Test
@TestMetadata("genericProperty.kt")
public void testGenericProperty() throws Exception {
@@ -16191,6 +16191,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack
runTest("compiler/testData/codegen/box/delegation/differentModules.kt");
}
@Test
@TestMetadata("doubleDelegationEqualsHashcode.kt")
public void testDoubleDelegationEqualsHashcode() throws Exception {
runTest("compiler/testData/codegen/box/delegation/doubleDelegationEqualsHashcode.kt");
}
@Test
@TestMetadata("genericProperty.kt")
public void testGenericProperty() throws Exception {
@@ -13262,6 +13262,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Delegation extends AbstractLightAnalysisModeTest {
@TestMetadata("doubleDelegationEqualsHashcode.kt")
public void ignoreDoubleDelegationEqualsHashcode() throws Exception {
runTest("compiler/testData/codegen/box/delegation/doubleDelegationEqualsHashcode.kt");
}
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
}