DEV Community

Discussion on: Kotlin - The Good, the Bad and the Ugly

Collapse
 
kgtgit profile image
KgTgIT • Edited

You can use @JvmOverloads for constructors not to overload them by urself. But this is useful only for Spock and nullable fields.

As for data classes, you can use interface with a field. Then simply add override on field in data class. This may be useful for some code generalisation.