Hi Kotlin heads!
https://kotlinlang.org/docs/reference/delegation.html
Is there a way to use delegation with the "by" keyword with a class member that is not passed to the constructor, but initialized in the class body?
I want to achieve something like that (this does not compile):
interface Base {
fun print()
}
class BaseImpl(val x: Int) : Base {
override fun print() { print(x) }
}
class Derived() : Base by b {
val b = BaseImpl(2)
}