<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><br><br>Sent from my iPad</div><div><br>On May 17, 2016, at 1:10 PM, Andrew Trick via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><span></span><br><blockquote type="cite"><span>On May 14, 2016, at 7:49 AM, Sreejith K R via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Hello All,</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>I would like to suggest an enhancement for the swift protocol would really like this feature to be reviewed.</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Enhancement Description : </span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Currently it is not possible to invoke &nbsp;the default implementation of a particular protocol (EG: SampleProtocolParent achieved using protocol extension) &nbsp;inside &nbsp;&nbsp;another protocol extention(Eg: SampleProtocolSub) that inherits from the former protocol. Please look &nbsp;into the SampleProtocolSub extension as shown below. Also the same behavior is observed &nbsp;while a class implements the protocol(Please look &nbsp;into the Test class that implements SampleProtocolSub as shown below ). </span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span> This behavior is something similar to the usage of super keyword while overriding a method. </span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>protocol SampleProtocolParent{</span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;func testFunction();</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>}</span><br></blockquote><blockquote type="cite"><span>extension SampleProtocolParent{</span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;func testFunction(){</span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print("hello my super implementation")</span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;}</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>}</span><br></blockquote><blockquote type="cite"><span>protocol SampleProtocolSub:SampleProtocolParent{</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>}</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>extension SampleProtocolSub{</span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;func testFunction(){</span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* need to call testFunction implementation of the parent SampleProtocolParent as well here. Is this a possible feature &nbsp;?*/</span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print("hello my current and new implementation")</span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;}</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>}</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>class Test:SampleProtocolSub{</span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;func testFunction(){</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/* need to call testFunction implmentaion of the parent SampleProtocolParent as well here. Is this a possible feature &nbsp;?*/</span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print("hello my current and new new new implementaion")</span><br></blockquote><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;}</span><br></blockquote><blockquote type="cite"><span>}</span><br></blockquote><span></span><br><span>I also want this feature, but haven’t seen any proposed syntax.</span><br><span>-Andy</span><br></div></blockquote><div><br></div>How about this (now that we are uncurrying the self parameter):<div><br></div><div><div><font color="#000000"><span style="background-color: rgba(255, 255, 255, 0);">SampleProtocolParent.testFunction(self)</span></font></div></div><div><br></div><div>It's not pretty but it is clear.</div><div><br><blockquote type="cite"><div><span></span><br><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></div></body></html>