Hi Haravikk,
Am 2017-08-10 11:07, schrieb Haravikk via swift-evolution:
I don't feel that conforming to
Equatable/Hashable is sufficient as an opt-in. Consider for example
someone who declares their type as Equatable/Hashable, then sets to
work on the details of their type, forgetting to implement the actual
equatable/hashable behaviour they want.
This is no different than a default implementation of the protocol.
In fact, the proposal just adds something like this:
extension Struct<A, B, ...>: Equatable where A: Equatable, B:
Equatable, ... {
static func ==(lhs: Self, rhs: Self) -> Bool { /* insert
implementation here */ }
}
We don't require/support some special keywords for other protocols with
default implementation either,
so I see no reason to add them here.
Your concerns are orthogonal to this proposal and should be discussed
independently.
--
Martin
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution