Hmm… not sure where to post this since #general is...
# getting-started
p
Hmm… not sure where to post this since #general is now #announcements But does anyone know if there’s a way for a data class to inherit its toString() implementation from another class? (ie, is there a way to not get the automatically generated data class toString() implementation)
Blah, looks like one (unintuitive) answer is to explicitly add,
Copy code
override fun toString() = super.toString()
to the data class(es).
e
yeah, there isn't a straightforward way of turning off particular data class features. no-copy plugin could be modified to no-toString if you wanted though
y
Also, if you control its superclass, you can make its
toString
method final, and so the data modifier won't generate its own