https://kotlinlang.org logo
#announcements
Title
# announcements
t

thana

06/04/2019, 7:39 PM
i have a
data class
which has a property of type Array<String> (let's forgo discussing whether or not to use arrays at all). Let's do a step back: What should the
equals
method generated for data classes do? I think they should compare the values of data classes. Unfortunately when the
data class
has an
Array
property compares those arrays using
equals()
and not using
content(Deep)Equals()
. Do you think this is a good idea? why?
Consider: Lists are compared based on the content, too!
4 Views