<div dir="ltr"><div>Very interesting indeed... <br></div><div><br></div><div><span style="font-style:italic">class VehicleUtilities { </span><br><br><span style="font-style:italic">    int numberOfAxles(Vehicle v) { return 2;} // a plausible default</span><br><br><span style="font-style:italic">    int numberOfAxles (Truck t){ return 3;} </span><br><br><span style="font-style:italic">}</span><br><br><br><br><br><span style="font-style:italic">Vehicle v = new Truck();</span><br><br><span style="font-style:italic">VehicleUtilities  u = new VehicleUtilities();</span><br><br><span style="font-style:italic">u.numberOfAxles(v); // returns 2<br></span></div><div><br></div><div><br></div><div>--&gt; this is a nice concise example of even simple code can suffer from a nasty code issue such as this...<br></div><div><span style="font-style:italic"></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Nov 11, 2017 at 4:32 PM, Gwendal Roué via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><span class=""><br><div><blockquote type="cite"><div>Le 11 nov. 2017 à 16:48, Joe Groff via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; a écrit :</div><br class="m_7240953771039631359Apple-interchange-newline"><div><span style="font-family:SFUIDisplay-Regular;font-size:15px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">That&#39;d be great, but Swift violates Gilad Bracha&#39;s golden rule by having static overloading, and throws bidirectional type inference on top, so our static name resolution can&#39;t be treated as a specialization of a dynamic name lookup mechanism in all cases.</span><br style="font-family:SFUIDisplay-Regular;font-size:15px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"></div></blockquote></div><br></span><div>I didn&#39;t know of Gilad Bracha, so you made me curious. </div><div><br></div><div>I guess that the &quot;golden rule&quot; you refer to is here, for anyone curious: <a href="https://gbracha.blogspot.fr/2009/09/systemic-overload.html" target="_blank">https://gbracha.<wbr>blogspot.fr/2009/09/systemic-<wbr>overload.html</a></div><div><br></div><div>Gwendal Roué</div><div><br></div></div><br>______________________________<wbr>_________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br>
<br></blockquote></div><br></div>