@ske one current “workaround” to this is to use a private constructor
Copy code
class Foo private constructor(private val barImpl: Bar): Bar by barImpl {
constructor() : this(BarImpl())
}
a
arocnies
08/16/2018, 3:27 AM
Does
class Foo : Bar by BarImpl()
not work?
a
alex.hart
08/16/2018, 4:49 PM
it might, I’d have to double check, however, this doesn’t work in more complex cases, such as BarImpl implementing multiple interfaces, or if I want to have access to the Bar instance.