Add test for class delegation with private constructor

#KT-16583 Obsolete
This commit is contained in:
Mikhail Zarechenskiy
2017-03-02 14:31:30 +03:00
parent e2dcec62d3
commit d573962259
6 changed files with 60 additions and 2 deletions
@@ -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()
}
@@ -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
}