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
|
||||
}
|
||||
Reference in New Issue
Block a user