<div dir="ltr">What are you trying to accomplish here, more concretely?<div><br></div><div>My first thought is that you shouldn&#39;t implement the same function in both a protocol extension and a conforming class. Why not just give them different names and call the function from within the extension instead of from the class? E.g.</div><div><br></div><div><p style="margin:0px;font-size:12px;line-height:normal;font-family:inconsolata-dz;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">protocol</span><span style="font-variant-ligatures:no-common-ligatures"> FooPro {</span></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:inconsolata-dz;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">func</span><span style="font-variant-ligatures:no-common-ligatures"> _fooFunc()</span></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:inconsolata-dz;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">}</span></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:inconsolata-dz;color:rgb(0,0,0);min-height:16px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:inconsolata-dz;color:rgb(186,45,162)"><span style="font-variant-ligatures:no-common-ligatures">extension</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">FooPro</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> {</span></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:inconsolata-dz;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">func</span><span style="font-variant-ligatures:no-common-ligatures"> fooFunc() {</span></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:inconsolata-dz;color:rgb(209,47,27)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">        </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">print</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(</span><span style="font-variant-ligatures:no-common-ligatures">&quot;fooFunc default&quot;</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">)</span></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:inconsolata-dz;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">        </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(49,89,93)">_fooFunc</span><span style="font-variant-ligatures:no-common-ligatures">()</span></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:inconsolata-dz;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    }</span></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:inconsolata-dz;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">}</span></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:inconsolata-dz;color:rgb(0,0,0);min-height:16px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:inconsolata-dz;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">class</span><span style="font-variant-ligatures:no-common-ligatures"> FooClass: </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">FooPro</span><span style="font-variant-ligatures:no-common-ligatures"> {</span></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:inconsolata-dz;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">func</span><span style="font-variant-ligatures:no-common-ligatures"> _fooFunc() {</span></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:inconsolata-dz;color:rgb(209,47,27)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">        </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(62,30,129)">print</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">(</span><span style="font-variant-ligatures:no-common-ligatures">&quot;fooFunc FooClass&quot;</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">)</span></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:inconsolata-dz;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    }</span></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:inconsolata-dz;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">}</span></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:inconsolata-dz;color:rgb(0,0,0);min-height:16px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:inconsolata-dz;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(186,45,162)">let</span><span style="font-variant-ligatures:no-common-ligatures"> fc = </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">FooClass</span><span style="font-variant-ligatures:no-common-ligatures">()</span></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:inconsolata-dz;color:rgb(0,0,0)">

















</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:inconsolata-dz;color:rgb(49,89,93)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">fc</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">.</span><span style="font-variant-ligatures:no-common-ligatures">fooFunc</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">()</span></p></div><div><br></div><div>Dan</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 15, 2016 at 4:28 PM, Rick Mann via swift-users <span dir="ltr">&lt;<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">The following gives Xcode 8.1 a very hard time. Eventually I get a Bad Access on the last line. I&#39;m guessing it&#39;s a recursive call. Is there any way to call the default implementation from a &quot;real&quot; implementation?<br>
<br>
protocol FooPro<br>
{<br>
        func fooFunc()<br>
}<br>
<br>
extension FooPro<br>
{<br>
        func<br>
        fooFunc()<br>
        {<br>
                print(&quot;fooFunc default&quot;)<br>
        }<br>
}<br>
<br>
class FooClass : FooPro<br>
{<br>
        func<br>
        fooFunc()<br>
        {<br>
                (self as FooPro).fooFunc()<br>
                print(&quot;fooFunc FooClass&quot;)<br>
        }<br>
}<br>
<br>
let fc: FooPro = FooClass()<br>
fc.fooFunc()<br>
<br>
<br>
Thanks!<br>
<span class="m_6531730436975955370m_-7746122822290572822gmail-m_-849923410612315318HOEnZb"><font color="#888888"><br>
<br>
--<br>
Rick Mann<br>
<a href="mailto:rmann@latencyzero.com" target="_blank">rmann@latencyzero.com</a><br>
<br>
<br>
______________________________<wbr>_________________<br>
swift-users mailing list<br>
<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" target="_blank">https://lists.swift.org/mailma<wbr>n/listinfo/swift-users</a><br>
</font></span></blockquote></div><br></div></div>