Include property declared in body of data class in toString() in Kotlin

Viewed 656

In Kotlin, is it possible to have a property, that's declared in the body of a data class, be included in the default toString() result?

data class A(val b:Int = 0) {
    val c: Int = 0
}
println(A())

Prints: A(b=0)
Desired: A(b=0, c=0)

1 Answers
Related