[swift-evolution] Universal Equatability, Hashability, and Comparability
Jan E. Schotsman
jeschot at xs4all.nl
Tue May 24 13:49:52 CDT 2016
On May 24, 2016, at 6:50 PM, Tony Allevato wrote:
> On the one hand, getting the conformance implicitly matches how
> RawRepresentable is already treated, and makes getting the
> conformance zero
> effort. On the other hand, it makes error handling trickier: if you
> add a
> non-Equatable/non-Hashable field or associated value to a struct/
> enum, all
> of your call sites break. (I guess they would even if you declared the
> conformance, but at least there you'd also get the "Type does not
> to Equatable/Hashable" error at the struct/enum itself, and the
> could even potentially flag the offending field/associated value
> causing the conformance to fail.) Thoughts?
I would like to have the option to override the compiler-provided
For example, exclude one field from the definition of equality.
It would be nice if the default implementation would be available
inside the definition of a custom implementation so you can base your
custom implementation on that.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution