Add test for class delegation with private constructor
#KT-16583 Obsolete
This commit is contained in:
@@ -0,0 +1,17 @@
|
|||||||
|
class MyObject private constructor(val delegate: Interface) : Interface by delegate {
|
||||||
|
constructor() : this(Delegate())
|
||||||
|
}
|
||||||
|
|
||||||
|
class Delegate : Interface {
|
||||||
|
override fun greet(): String {
|
||||||
|
return "OK"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private interface Interface {
|
||||||
|
fun greet(): String
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
return MyObject().greet()
|
||||||
|
}
|
||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
@kotlin.Metadata
|
||||||
|
public final class Delegate {
|
||||||
|
public method <init>(): void
|
||||||
|
public @org.jetbrains.annotations.NotNull method greet(): java.lang.String
|
||||||
|
}
|
||||||
|
|
||||||
|
@kotlin.Metadata
|
||||||
|
public final class DelegationWithPrivateConstructorKt {
|
||||||
|
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||||
|
}
|
||||||
|
|
||||||
|
@kotlin.Metadata
|
||||||
|
interface Interface {
|
||||||
|
public abstract @org.jetbrains.annotations.NotNull method greet(): java.lang.String
|
||||||
|
}
|
||||||
|
|
||||||
|
@kotlin.Metadata
|
||||||
|
public final class MyObject {
|
||||||
|
private final @org.jetbrains.annotations.NotNull field delegate: Interface
|
||||||
|
public method <init>(): void
|
||||||
|
private method <init>(p0: Interface): void
|
||||||
|
public final @org.jetbrains.annotations.NotNull method getDelegate(): Interface
|
||||||
|
public @org.jetbrains.annotations.NotNull method greet(): java.lang.String
|
||||||
|
}
|
||||||
+6
@@ -6653,6 +6653,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("delegationWithPrivateConstructor.kt")
|
||||||
|
public void testDelegationWithPrivateConstructor() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegation/delegationWithPrivateConstructor.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("hiddenSuperOverrideIn1.0.kt")
|
@TestMetadata("hiddenSuperOverrideIn1.0.kt")
|
||||||
public void testHiddenSuperOverrideIn1_0() throws Exception {
|
public void testHiddenSuperOverrideIn1_0() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegation/hiddenSuperOverrideIn1.0.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegation/hiddenSuperOverrideIn1.0.kt");
|
||||||
|
|||||||
@@ -6653,6 +6653,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("delegationWithPrivateConstructor.kt")
|
||||||
|
public void testDelegationWithPrivateConstructor() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegation/delegationWithPrivateConstructor.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("hiddenSuperOverrideIn1.0.kt")
|
@TestMetadata("hiddenSuperOverrideIn1.0.kt")
|
||||||
public void testHiddenSuperOverrideIn1_0() throws Exception {
|
public void testHiddenSuperOverrideIn1_0() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegation/hiddenSuperOverrideIn1.0.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegation/hiddenSuperOverrideIn1.0.kt");
|
||||||
|
|||||||
@@ -181,8 +181,7 @@ public class InspectionTestGenerated extends AbstractInspectionTest {
|
|||||||
|
|
||||||
@TestMetadata("destructuringWrongName/inspectionData/inspections.test")
|
@TestMetadata("destructuringWrongName/inspectionData/inspections.test")
|
||||||
public void testDestructuringWrongName_inspectionData_Inspections_test() throws Exception {
|
public void testDestructuringWrongName_inspectionData_Inspections_test() throws Exception {
|
||||||
String fileName =
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/inspections/destructuringWrongName/inspectionData/inspections.test");
|
||||||
KotlinTestUtils.navigationMetadata("idea/testData/inspections/destructuringWrongName/inspectionData/inspections.test");
|
|
||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7506,6 +7506,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
|||||||
throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that.");
|
throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("delegationWithPrivateConstructor.kt")
|
||||||
|
public void testDelegationWithPrivateConstructor() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegation/delegationWithPrivateConstructor.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("hiddenSuperOverrideIn1.0.kt")
|
@TestMetadata("hiddenSuperOverrideIn1.0.kt")
|
||||||
public void testHiddenSuperOverrideIn1_0() throws Exception {
|
public void testHiddenSuperOverrideIn1_0() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegation/hiddenSuperOverrideIn1.0.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/delegation/hiddenSuperOverrideIn1.0.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user