Files
kotlin-fork/compiler/testData/codegen/box/delegation/delegationWithPrivateConstructor.kt
T
Mikhail Zarechenskiy d573962259 Add test for class delegation with private constructor
#KT-16583 Obsolete
2017-03-02 18:34:59 +03:00

17 lines
327 B
Kotlin
Vendored

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()
}