<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Given 2-tuples of type (T1, T2), you should be able to invoke the == operator if you could on both types T1 and T2, right? i.e.<div class=""><br class=""></div><div class="">(“abc”, 3) == (“abc”, 4)<span class="Apple-tab-span" style="white-space:pre">        </span>// legal</div><div class=""><br class=""></div><div class="">but:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">class SomeClass {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> static public func ==(_ lhs:</span><span style="font-variant-ligatures: no-common-ligatures; color: #9f35da" class="">SomeClass</span><span style="font-variant-ligatures: no-common-ligatures" class="">, _ rhs:</span><span style="font-variant-ligatures: no-common-ligatures; color: #9f35da" class="">SomeClass</span><span style="font-variant-ligatures: no-common-ligatures" class="">) -> </span><span style="font-variant-ligatures: no-common-ligatures; color: #3495af" class="">Bool</span><span style="font-variant-ligatures: no-common-ligatures" class=""> {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> return lhs === rhs</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">let c1 = </span><span style="font-variant-ligatures: no-common-ligatures; color: #9f35da" class="">SomeClass</span><span style="font-variant-ligatures: no-common-ligatures" class="">()</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">let c2 = </span><span style="font-variant-ligatures: no-common-ligatures; color: #9f35da" class="">SomeClass</span><span style="font-variant-ligatures: no-common-ligatures" class="">()</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">let t1 = (</span><span style="font-variant-ligatures: no-common-ligatures; color: #b4261a" class="">"abc"</span><span style="font-variant-ligatures: no-common-ligatures" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #0536ff" class="">c1</span><span style="font-variant-ligatures: no-common-ligatures" class="">)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">let t2 = (</span><span style="font-variant-ligatures: no-common-ligatures; color: #b4261a" class="">"abc"</span><span style="font-variant-ligatures: no-common-ligatures" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #0536ff" class="">c2</span><span style="font-variant-ligatures: no-common-ligatures" class="">)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(5, 54, 255);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">c1</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #9f35da" class="">==</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">c2<span class="Apple-tab-span" style="white-space:pre">                </span>// legal</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #0536ff" class="">t1</span><span style="font-variant-ligatures: no-common-ligatures" class=""> == </span><span style="font-variant-ligatures: no-common-ligatures; color: #0536ff" class="">t2<span class="Apple-tab-span" style="white-space:pre">                </span>// illegal</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #0536ff" class=""><br class=""></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; line-height: normal; min-height: 13px;" class="">Why is t1 == t2 not legal given that c1 == c2 IS legal?</div><div style="margin: 0px; line-height: normal; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; line-height: normal; min-height: 13px;" class=""><br class=""></div></body></html>