<div dir="ltr">It&#39;s a similar discussion with simple structs which could automatically be equatable.<div>And for Hashable.<br><div>It&#39;s difficult to draw a line where that makes sense and where not.<div><br></div><div>In any case I&#39;d prefer to not have recursive equality automatically.</div><div><ul><li>It can easily lead to unexpected behavior when you forget to implement an own equality operator in order to remove variables from the equation which do not affect the equality.</li><li>You could add another variable to an existing enum (or struct) which is now automatically compared for equality without you noticing and which might be wrong.</li><li>You cannot opt out of that behavior.</li></ul></div><div>But I agree that the current implementations of the equality operator for enums are awful.</div><div>Maybe we can make the enum (or struct) conform to a special protocol which allows it to automatically generate the equality operator (and even default hashValue).</div><div><br></div><div>Something like this:</div><div><span class=""><br></span></div><div><font face="monospace, monospace"><span class="">protocol </span></font><span style="font-family:monospace,monospace">DefaultEquatable: Equatable {}</span></div><div><span style="font-family:monospace,monospace">protocol DefaultHashable: Hashable {}</span></div><div><font face="monospace, monospace"><span class=""><br></span></font></div><div><font face="monospace, monospace"><span class="">enum</span><span class=""> MyEnumWithPayload: </span><span class="">DefaultEquatable</span><span class="">, </span><span class="">DefaultHashable</span><span class=""> {<br></span><span class="">    case</span><span class=""> One(payload: String)<br></span><span class="">    case</span><span class=""> Two(payload: String)<br>}</span></font></div><div><br></div></div></div></div>