Files
kotlin-fork/compiler/testData/codegen/box/delegation/delegationWithPrivateConstructor.kt
T

18 lines
328 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()
}