https://kotlinlang.org logo
#getting-started
Title
# getting-started
j

Johann Pardanaud

10/25/2023, 12:15 PM
Is it possible, in some way, for a delegetad property to inherit the Kdoc of the original one?
Copy code
class Foo {
    /** some doc */
    var bar = ""
}

class Baz(val foo: Foo) {
    var bar by foo::bar
}
Here the Kdoc of
Baz.bar
is empty.
s

Sam

10/25/2023, 2:13 PM
If you can inherit the property, you can inherit its docs that way. E.g.
Copy code
interface Foo {
    /** some doc */
    var bar: String
}

class Baz(val foo: Foo): Foo {
    override var bar by foo::bar
}
j

Johann Pardanaud

10/25/2023, 2:38 PM
oh right, this could be an option!
thanks