Xcode-beta (7A152u): Ability to Declare Protocol Conformance Through a Protocl Extension

Originator:john
Number:rdar://21757477 Date Originated:09-Jul-2015 07:41 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode-beta (7A152u)
Classification:Feature (New) Reproducible:Always
 
Summary:
It would be nice if we could have one protocol conform to another protocol through a protocol extension that provides default implementations of the other protocol’s methods. This can be done by having the original declaration of the first protocol, but it seems cleaner to have the conformance noted as part of the protocol extension, to keep that localized to the implementations of the protocol’s methods.

Steps to Reproduce:
1. Create a protocol ProtocolOne
2. Create a protocol ProtocolTwo
3. Add an extension of ProtocolTwo that inherits from ProtocolOne and provides implementations of all of its methods

Expected Results:
It would compile, and anything that implemented ProtocolTwo would be known at compile time to conform to ProtocolOne

Actual Results:
The code will not compile, because protocol extensions cannot have inheritance clauses.

Regression:

Notes:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!