rakshakhegde
10/05/2017, 6:16 PMinterface Base {
fun print()
}
class BaseImpl(val x: Int) : Base {
override fun print() { print(x) }
}
class Derived : Base by b {
val b = BaseImpl(10)
}
fun main(args: Array<String>) {
Derived().print() // prints 10
}
Basically, I don't want the end user to be providing the implementation. Yet, I need Delegation feature to work this way... How to get this working?