Hi,

Am 2016-09-26 12:53, schrieb Francisco Costa via swift-evolution:
+1 for making enums with payloads Equatable by default. Right now this
requires lots of copy-paste boiler plate that can easily result in
bugs.

Of course, making structs and enums Equatable should be much easier (the same is true for e.g. Hashable). However, I still think Protocol conformance should be something which is specified explicitly.

When we improve support for generics we might be able to provide a default implementation for those cases where all fields are already Equatable/Hashable.
Then, making your struct conform to Equatable would be easy:

    extension MyStruct: Equatable {}

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

Reply via email to