<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Nov 12, 2017, at 7:27 PM, Nevin Brackett-Rozinsky &lt;<a href="mailto:nevin.brackettrozinsky@gmail.com" class="">nevin.brackettrozinsky@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote">On Sun, Nov 12, 2017 at 10:16 PM, Slava Pestov <span dir="ltr" class="">&lt;<a href="mailto:spestov@apple.com" target="_blank" class="">spestov@apple.com</a>&gt;</span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space" class=""><div class=""><span class=""><blockquote type="cite" class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class="">Pardon my lack of imagination, but could you provide an example of a call site that would become ambiguous?</div></div></div></div></blockquote><div class=""><br class=""></div></span><div class="">protocol P {}</div><div class="">protocol Q {}</div>struct S : P, Q {}</div><div class=""><br class=""></div><div class="">struct Outer {</div><div class="">&nbsp; static func foo(_: P) {}</div><div class=""><br class=""></div><div class="">&nbsp; struct Inner {</div><div class="">&nbsp; &nbsp; static func foo(_: Q) {}</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp; static func bar() {</div><div class="">&nbsp; &nbsp; &nbsp; &nbsp;foo(S())</div><div class="">&nbsp; &nbsp; }</div><div class="">&nbsp; }</div><div class="">}</div></div></blockquote><div class=""><br class=""></div><div class="">Resolves to Inner.foo just like it does today.</div><div class=""><br class=""></div><div class="">We would still start from the innermost scope and work our way outward until we find a match. The only difference is we no longer stop partway up the chain *without* finding a match.</div></div></div></div></div></blockquote><div><br class=""></div>That’s not implementable as described. Right now we find all possible overloads for a call site up front, then evaluate every combination of overloads at all call sites in an expression. The valid solutions are then ranked and the “best” one chosen, or an ambiguity is diagnosed. This means you can’t “stop” evaluating overloads, you need some way to disambiguate them and you have to consider all of them.</div><div><br class=""></div><div>Slava</div><div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""><br class=""></div><div class="">If we do find a match then yes, of course we stop there and use it.</div><div class=""><br class=""></div><div class="">Nevin</div></div></div></div>
</div></blockquote></div><br class=""></body></html>