Add test for class delegation with private constructor
#KT-16583 Obsolete
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
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()
|
||||
}
|
||||
Reference in New Issue
Block a user