Add test for class delegation with private constructor

#KT-16583 Obsolete
This commit is contained in:
Mikhail Zarechenskiy
2017-03-02 14:31:30 +03:00
parent e2dcec62d3
commit d573962259
6 changed files with 60 additions and 2 deletions
@@ -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()
}