hey folks, is there a way to combine property and ...
# announcements
p
hey folks, is there a way to combine property and interface delegation? Something akin to:
Copy code
interface Foo {}
class Bar(): Foo {}

class DelegatedFoo: Foo by foo {
  val foo by lazy { Bar() }
}
🚫 1
s
You could do something like this:
Copy code
interface Foo {}

class Bar() : Foo {}

class DelegatedFoo private constructor(val foo: Foo) : Foo by foo {

  constructor() : this(Bar())

}
p
Yeah —
lazy
in that example is a placeholder, I need a delegated property of my own there.