<div dir="ltr">Absolutely—I would expect that if the user provided their own implementation of `==` for a particular type, it would override (rather, suppress) the compiler-provided one; the same for hashValue.</div><br><div class="gmail_quote"><div dir="ltr">On Tue, May 24, 2016 at 11:50 AM Jan E. Schotsman via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><div>On May 24, 2016, at 6:50 PM, Tony Allevato wrote:</div><br><blockquote type="cite"><span style="border-collapse:separate;color:rgb(0,0,0);font-family:Georgia;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;font-size:medium">On the one hand, getting the conformance implicitly matches how<br>RawRepresentable is already treated, and makes getting the conformance zero<br>effort. On the other hand, it makes error handling trickier: if you add a<br>non-Equatable/non-Hashable field or associated value to a struct/enum, all<br>of your call sites break. (I guess they would even if you declared the<br>conformance, but at least there you&#39;d also get the &quot;Type does not conform<br>to Equatable/Hashable&quot; error at the struct/enum itself, and the compiler<br>could even potentially flag the offending field/associated value that&#39;s<br>causing the conformance to fail.) Thoughts?<br></span></blockquote><br></div></div><div style="word-wrap:break-word"><div>I would like to have the option to override the compiler-provided equality etc.</div><div>For example, exclude one field from the definition of equality.</div><div>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.</div></div><div style="word-wrap:break-word"><div><br></div><div>Jan E.</div><br></div>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</blockquote></div>