<div dir="ltr">I actually suggest something along the lines of <div><br></div><div><span style="font-size:13px"> protocol Foo {</span><br style="font-size:13px"><span style="font-size:13px"> final func doIt() -> String</span><br style="font-size:13px"><span style="font-size:13px"> }</span><br style="font-size:13px"></div><div><span style="font-size:13px"><br></span></div><div><span style="font-size:13px"> extension Foo {</span></div><div><span style="font-size:13px"> final func doIt() -> String {</span><span style="font-size:13px"><br></span></div><div><span style="font-size:13px"> print("I did it.")</span></div><div><span style="font-size:13px"> }</span></div><div><span style="font-size:13px"> final </span>func doThat() {</div><div> print("I did that.")</div><div> }</div><div><span style="font-size:13px"> }</span></div><div><span style="font-size:13px"><br></span></div><div>to indicate that foo will be provided in this module and is not ever to be dynamically dispatched. This draws attention to the fact that dispatch is static in a clear consistent manner.</div><div><br></div><div>TJ</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 9, 2015 at 1:31 PM, Gwendal Roué <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> Le 9 déc. 2015 à 06:31, Paul Cantrell <<a href="mailto:cantrell@pobox.com">cantrell@pobox.com</a>> a écrit :<br>
><br>
> Gwendal Roué wrote:<br>
>> Whatever the direction this proposal is aiming at, please remember that it is desirable for some APIs to let adopting types "override" the default implementation provided by protocols.<br>
><br>
><br>
> I would certainly hope nobody is proposing changing that! Once a method is virtually dispatched, it should be virtual all the way down to the implementing type.<br>
<br>
</span>Yes, and it’s why I’m concerned. When a protocol provides a default implementation, how will an adopting type invoke that default implementation in its own implementation?<br>
<br>
With classes, it’s easy: you call super.<br>
<br>
With protocols, it’s much less easy, if possible at all, as soon as all methods are dynamically dispatched.<br>
<div class="HOEnZb"><div class="h5"><br>
Gwendal Roué<br>
<br>
<br>
_______________________________________________<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/mailman/listinfo/swift-evolution</a><br>
</div></div></blockquote></div><br></div>