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 conform to Equatable/Hashable" error at the struct/enum itself, and the compiler could even potentially flag the offending field/associated value that's
causing the conformance to fail.) Thoughts?

I would like to have the option to override the compiler-provided equality etc.
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.

Jan E.

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to