Files
kotlin-fork/compiler/testData/codegen/box/delegation/delegationWithPrivateConstructor.kt
T
2019-11-19 11:00:09 +03:00

18 lines
357 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
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()
}