> On 15 Oct 2016, at 18:21, Nevin Brackett-Rozinsky 
> <nevin.brackettrozin...@gmail.com> 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 
swift-evolution mailing list

Reply via email to