Hey guys, I have this requirement in Delegation......
# announcements
r
Hey guys, I have this requirement in Delegation...
Copy code
interface 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?