when is a property delegation a property getter?

You can use it to “pass through” the property of some other object more concisely.

class Foo (private val bar: Bar) {

    var barName by bar::name

}

versus

class Foo (private val bar: Bar) {

    var barName: String 
        get() = bar.name
        set(value) { bar.name = value }

}

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top