Files
kotlin-fork/compiler/testData/codegen/box/delegation/delegationWithPrivateConstructor.kt
T
2021-01-12 18:35:39 +03:00

19 lines
354 B
Kotlin
Vendored

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