<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Given the tentative ideas already being worked on for ABI stability what would be the place that code associated with a default implementation of a method on a protocol live?<div class=""><br class=""></div><div class="">e.g.</div><div class=""><br class=""></div><div class="">FooKit has some code that is similar to this:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-stretch: normal; font-size: 17px; line-height: normal; font-family: Menlo; color: rgb(237, 232, 229); background-color: rgb(43, 43, 43);" class=""><span style="color: #fd4384" class="">public</span> <span style="color: #fd4384" class="">struct</span> SomeOptions : <span style="color: #eedb04" class="">RawRepresentable</span> {</div><div style="margin: 0px; font-stretch: normal; font-size: 17px; line-height: normal; font-family: Menlo; color: rgb(253, 67, 132); background-color: rgb(43, 43, 43);" class=""><span style="color: #ede8e5" class=""> </span>public<span style="color: #ede8e5" class=""> </span>private(set)<span style="color: #ede8e5" class=""> </span>var<span style="color: #ede8e5" class=""> rawValue: </span><span style="color: #eedb04" class="">Int</span></div><div style="margin: 0px; font-stretch: normal; font-size: 17px; line-height: normal; font-family: Menlo; color: rgb(237, 232, 229); background-color: rgb(43, 43, 43);" class=""> <span style="color: #fd4384" class="">public</span> <span style="color: #fd4384" class="">init</span>(rawValue: <span style="color: #eedb04" class="">Int</span>) { <span style="color: #fd4384" class="">self</span>.<span style="color: #76e0f2" class="">rawValue</span> = rawValue }</div><p style="margin: 0px; font-stretch: normal; font-size: 17px; line-height: normal; font-family: Menlo; color: rgb(237, 232, 229); background-color: rgb(43, 43, 43); min-height: 20px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-stretch: normal; font-size: 17px; line-height: normal; font-family: Menlo; color: rgb(237, 232, 229); background-color: rgb(43, 43, 43);" class=""> <span style="color: #fd4384" class="">public</span> <span style="color: #fd4384" class="">static</span> <span style="color: #fd4384" class="">let</span> sensible = <span style="color: #eedb04" class="">SomeOptions</span>(rawValue: <span style="color: #f57fff" class="">1</span> << <span style="color: #f57fff" class="">0</span>)</div><div style="margin: 0px; font-stretch: normal; font-size: 17px; line-height: normal; font-family: Menlo; color: rgb(237, 232, 229); background-color: rgb(43, 43, 43);" class=""> <span style="color: #fd4384" class="">public</span> <span style="color: #fd4384" class="">static</span> <span style="color: #fd4384" class="">let</span> maybeWillBeBetterLater = <span style="color: #eedb04" class="">SomeOptions</span>(rawValue: <span style="color: #f57fff" class="">1</span> << <span style="color: #f57fff" class="">1</span>)</div><div style="margin: 0px; font-stretch: normal; font-size: 17px; line-height: normal; font-family: Menlo; color: rgb(237, 232, 229); background-color: rgb(43, 43, 43);" class="">}</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(43, 43, 43); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 17px; line-height: normal; font-family: Menlo; color: rgb(237, 232, 229); background-color: rgb(43, 43, 43);" class=""><span style="color: #fd4384" class="">public</span> <span style="color: #fd4384" class="">protocol</span> Somethingable {</div><div style="margin: 0px; font-stretch: normal; font-size: 17px; line-height: normal; font-family: Menlo; color: rgb(237, 232, 229); background-color: rgb(43, 43, 43);" class=""> <span style="color: #fd4384" class="">func</span> contrive()</div><div style="margin: 0px; font-stretch: normal; font-size: 17px; line-height: normal; font-family: Menlo; color: rgb(237, 232, 229); background-color: rgb(43, 43, 43);" class=""> <span style="color: #fd4384" class="">func</span> contrive(options: <span style="color: #eedb04" class="">SomeOptions</span>)</div><div style="margin: 0px; font-stretch: normal; font-size: 17px; line-height: normal; font-family: Menlo; color: rgb(237, 232, 229); background-color: rgb(43, 43, 43);" class="">}</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(43, 43, 43); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 17px; line-height: normal; font-family: Menlo; color: rgb(238, 219, 4); background-color: rgb(43, 43, 43);" class=""><span style="color: #fd4384" class="">extension</span><span style="color: #ede8e5" class=""> </span>Somethingable<span style="color: #ede8e5" class=""> {</span></div><div style="margin: 0px; font-stretch: normal; font-size: 17px; line-height: normal; font-family: Menlo; color: rgb(237, 232, 229); background-color: rgb(43, 43, 43);" class=""> <span style="color: #fd4384" class="">func</span> contrive() { <span style="color: #ff7627" class="">contrive</span>(options: .<span style="color: #76e0f2" class="">sensible</span>) }</div><div style="margin: 0px; font-stretch: normal; font-size: 17px; line-height: normal; font-family: Menlo; color: rgb(237, 232, 229); background-color: rgb(43, 43, 43);" class="">}</div></div><div class=""><br class=""></div><div class="">Then later on in a newer version of FooKit maybeWillBeBetterLater is now MUCH better and should be the default option so the code is updated to look like this:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-stretch: normal; font-size: 17px; line-height: normal; font-family: Menlo; color: rgb(237, 232, 229); background-color: rgb(43, 43, 43);" class=""><span style="color: #fd4384" class="">public</span> <span style="color: #fd4384" class="">struct</span> SomeOptions : <span style="color: #eedb04" class="">RawRepresentable</span> {</div><div style="margin: 0px; font-stretch: normal; font-size: 17px; line-height: normal; font-family: Menlo; color: rgb(253, 67, 132); background-color: rgb(43, 43, 43);" class=""><span style="color: #ede8e5" class=""> </span>public<span style="color: #ede8e5" class=""> </span>private(set)<span style="color: #ede8e5" class=""> </span>var<span style="color: #ede8e5" class=""> rawValue: </span><span style="color: #eedb04" class="">Int</span></div><div style="margin: 0px; font-stretch: normal; font-size: 17px; line-height: normal; font-family: Menlo; color: rgb(237, 232, 229); background-color: rgb(43, 43, 43);" class=""> <span style="color: #fd4384" class="">public</span> <span style="color: #fd4384" class="">init</span>(rawValue: <span style="color: #eedb04" class="">Int</span>) { <span style="color: #fd4384" class="">self</span>.<span style="color: #76e0f2" class="">rawValue</span> = rawValue }</div><p style="margin: 0px; font-stretch: normal; font-size: 17px; line-height: normal; font-family: Menlo; color: rgb(237, 232, 229); background-color: rgb(43, 43, 43); min-height: 20px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-stretch: normal; font-size: 17px; line-height: normal; font-family: Menlo; color: rgb(237, 232, 229); background-color: rgb(43, 43, 43);" class=""> <span style="color: #fd4384" class="">public</span> <span style="color: #fd4384" class="">static</span> <span style="color: #fd4384" class="">let</span> sensible = <span style="color: #eedb04" class="">SomeOptions</span>(rawValue: <span style="color: #f57fff" class="">1</span> << <span style="color: #f57fff" class="">0</span>)</div><div style="margin: 0px; font-stretch: normal; font-size: 17px; line-height: normal; font-family: Menlo; color: rgb(237, 232, 229); background-color: rgb(43, 43, 43);" class=""> <span style="color: #fd4384" class="">public</span> <span style="color: #fd4384" class="">static</span> <span style="color: #fd4384" class="">let</span> maybeWillBeBetterLater = <span style="color: #eedb04" class="">SomeOptions</span>(rawValue: <span style="color: #f57fff" class="">1</span> << <span style="color: #f57fff" class="">1</span>)</div><div style="margin: 0px; font-stretch: normal; font-size: 17px; line-height: normal; font-family: Menlo; color: rgb(237, 232, 229); background-color: rgb(43, 43, 43);" class="">}</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(43, 43, 43); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 17px; line-height: normal; font-family: Menlo; color: rgb(237, 232, 229); background-color: rgb(43, 43, 43);" class=""><span style="color: #fd4384" class="">public</span> <span style="color: #fd4384" class="">protocol</span> Somethingable {</div><div style="margin: 0px; font-stretch: normal; font-size: 17px; line-height: normal; font-family: Menlo; color: rgb(237, 232, 229); background-color: rgb(43, 43, 43);" class=""> <span style="color: #fd4384" class="">func</span> contrive()</div><div style="margin: 0px; font-stretch: normal; font-size: 17px; line-height: normal; font-family: Menlo; color: rgb(237, 232, 229); background-color: rgb(43, 43, 43);" class=""> <span style="color: #fd4384" class="">func</span> contrive(options: <span style="color: #eedb04" class="">SomeOptions</span>)</div><div style="margin: 0px; font-stretch: normal; font-size: 17px; line-height: normal; font-family: Menlo; color: rgb(237, 232, 229); background-color: rgb(43, 43, 43);" class="">}</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgb(43, 43, 43); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; font-size: 17px; line-height: normal; font-family: Menlo; color: rgb(238, 219, 4); background-color: rgb(43, 43, 43);" class=""><span style="color: #fd4384" class="">extension</span><span style="color: #ede8e5" class=""> </span>Somethingable<span style="color: #ede8e5" class=""> {</span></div><div style="margin: 0px; font-stretch: normal; font-size: 17px; line-height: normal; font-family: Menlo; color: rgb(237, 232, 229); background-color: rgb(43, 43, 43);" class=""> <span style="color: #fd4384" class="">func</span> contrive() { <span style="color: #ff7627" class="">contrive</span>(options: .<span style="color: #76e0f2" class="">maybeWillBeBetterLater</span>) }</div><div style="margin: 0px; font-stretch: normal; font-size: 17px; line-height: normal; font-family: Menlo; color: rgb(237, 232, 229); background-color: rgb(43, 43, 43);" class="">}</div></div><div class=""><br class=""></div><div class="">For apps compiled with FooKit when they are run with the new version of FooKit do they get the behavior of sensible or maybeWillBeBetterLater? </div><div class=""><br class=""></div><div class="">Basically this is a question of where will the code for protocol extensions that are adopted across module boundaries live?</div><div class=""><br class=""></div><div class="">This interestingly applies to things like Collection and other standard library protocols and has some potential drawbacks and benefits from either way of it possibly working.</div><div class=""><br class=""></div><div class="">Thanks in advance for indulging my curiosity.</div><div class="">Philippe</div></body></html>