Sent from my iPad

> On May 17, 2016, at 1:10 PM, Andrew Trick via swift-evolution 
> <[email protected]> wrote:
> 
> 
>> On May 14, 2016, at 7:49 AM, Sreejith K R via swift-evolution 
>> <[email protected]> wrote:
>> 
>> Hello All,
>> 
>> 
>> I would like to suggest an enhancement for the swift protocol would really 
>> like this feature to be reviewed.
>> 
>> Enhancement Description : 
>> 
>> Currently it is not possible to invoke  the default implementation of a 
>> particular protocol (EG: SampleProtocolParent achieved using protocol 
>> extension)  inside   another protocol extention(Eg: SampleProtocolSub) that 
>> inherits from the former protocol. Please look  into the SampleProtocolSub 
>> extension as shown below. Also the same behavior is observed  while a class 
>> implements the protocol(Please look  into the Test class that implements 
>> SampleProtocolSub as shown below ). 
>> 
>> This behavior is something similar to the usage of super keyword while 
>> overriding a method. 
>> 
>> protocol SampleProtocolParent{
>>    func testFunction();
>> 
>> }
>> extension SampleProtocolParent{
>>    func testFunction(){
>>            print("hello my super implementation")
>>    }
>> 
>> }
>> protocol SampleProtocolSub:SampleProtocolParent{
>> 
>> 
>> }
>> 
>> extension SampleProtocolSub{
>>    func testFunction(){
>>       /* need to call testFunction implementation of the parent 
>> SampleProtocolParent as well here. Is this a possible feature  ?*/
>>        print("hello my current and new implementation")
>>    }
>> 
>> }
>> 
>> class Test:SampleProtocolSub{
>>    func testFunction(){
>> 
>>        /* need to call testFunction implmentaion of the parent 
>> SampleProtocolParent as well here. Is this a possible feature  ?*/
>>        print("hello my current and new new new implementaion")
>>    }
>> }
> 
> I also want this feature, but haven’t seen any proposed syntax.
> -Andy

How about this (now that we are uncurrying the self parameter):

SampleProtocolParent.testFunction(self)

It's not pretty but it is clear.

> 
> _______________________________________________
> swift-evolution mailing list
> [email protected]
> https://lists.swift.org/mailman/listinfo/swift-evolution
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to