Files
kotlin-fork/compiler/testData/codegen/box/delegation/delegationWithPrivateConstructor.kt
T
2020-10-01 17:49:02 +03:00

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