If I only want to modify a nested field of a data ...
# announcements
r
If I only want to modify a nested field of a data class, using
copy()
, what’s the cleanest way to write it? this obviously does not work:
val widget = widget.copy(owner = this.copy(firstName = "alfred"))
d
rrva: do you mean
val widget = widget.copy(owner = widget.owner.copy(firstName = "alfred"))
? Sharing your data classes would help us help you