> On 15 Oct 2016, at 18:21, Nevin Brackett-Rozinsky
> <[email protected]> wrote:
>
> Tuples cannot conform to protocols, so despite the existence of an “==”
> operator for certain tuples, no tuple conforms to Equatable.
>
> This is problematic, because it means that a function which takes a generic
> Equatable parameter cannot be called with a tuple argument, even though an
> applicable “==” operator exists.
>
> (Ditto for “Comparable”, mutatis mutandis.)
>
> Nevin
Yeah, since the operators are implemented though perhaps some kind of magic can
be used? It seems strange that the following is valid:
struct Foo : Equatable { let value:(Int, Int) }
func == (lhs:Foo, rhs:Foo) -> Bool { return lhs.value == rhs.value }
Yet tuples can't just be Equatable etc. But I'm wondering whether that falls
into separate issue territory, such that it should be done first as its own
proposal?_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution