I tried making a `data class` backed by an iOS fou...
# kotlin-native
b
I tried making a
data class
backed by an iOS foundation object, and kotlin didn't complain. Is this because K/N has built in facilities for generating equals and hashCode that call the NSObject equivalents?
even passes equality tests
s
I tried making a
data class
backed by an iOS foundation object
What do you mean?
K/N has built in facilities for generating equals and hashCode that call the NSObject equivalents?
Yes.
b
data class Date(val date: NSDate)
works, even though
NSDate
comes from iOS. Is this support documented somewhere, by chance?
s
I find this behaviour natural enough, so it is not documented explicitly.
b
Makes sense! Thanks!