[swift-evolution] Pitch: Automatically deriving Equatable/Hashable for more value types

Jordan Rose jordan_rose at apple.com
Tue May 16 17:19:06 CDT 2017


One additional point that could justify leaving out classes: because classes have reference semantics, it's not always clear that "all members are equal" implies "these instances are equal". Class instances have identity, which may be significant when deciding whether two objects are "the same".

(Thanks for writing this up, Tony!)

Jordan


> On May 5, 2017, at 12:18, Xiaodi Wu via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Hmm, with these complications, I regret suggesting that this could be extended to classes so easily. Definitely some interesting solutions, but my inclination as well would be to leave classes out entirely for the moment and let it percolate for Swift 4.1+. After all, it's an additive convenience.



More information about the swift-evolution mailing list