[Proposal] allow protocol extensions to contain inheritance clauses


(Sash Zats) #1

Hello,
I ran into several cases when it would be desirable to add an inheritance
clause B in the protocol extension A. Briefly, my proposal is that compiler
should not produce an error once `extension A: B` implements all the
functions of the protocol B, making it formally confirming to it. Sadly,
currently, there is no elegant way to mark the conformance formally.
A more detailed draft can be found here
https://gist.github.com/zats/52476a83627f5e4c0a85
I would really appreciate your feedback and thoughts on this.
Thank you.


(Javier Soto) #2

If I understood your proposal correctly, this is already planned to be
possible in Swift 3 :slight_smile:

···

On Thu, Dec 24, 2015 at 9:05 PM Sash Zats via swift-evolution < swift-evolution@swift.org> wrote:

Hello,
I ran into several cases when it would be desirable to add an inheritance
clause B in the protocol extension A. Briefly, my proposal is that compiler
should not produce an error once `extension A: B` implements all the
functions of the protocol B, making it formally confirming to it. Sadly,
currently, there is no elegant way to mark the conformance formally.
A more detailed draft can be found here
https://gist.github.com/zats/52476a83627f5e4c0a85
I would really appreciate your feedback and thoughts on this.
Thank you.
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

--
Javier Soto


(Sash Zats) #3

That would be great! Is there a comprehensive list of features that made it
under the cut?
All I'm finding points to swift-evolution repo and API design guidelines.

···

On Fri, Dec 25, 2015 at 8:09 AM Javier Soto <javier.api@gmail.com> wrote:

If I understood your proposal correctly, this is already planned to be
possible in Swift 3 :slight_smile:
On Thu, Dec 24, 2015 at 9:05 PM Sash Zats via swift-evolution < > swift-evolution@swift.org> wrote:

Hello,
I ran into several cases when it would be desirable to add an inheritance
clause B in the protocol extension A. Briefly, my proposal is that compiler
should not produce an error once `extension A: B` implements all the
functions of the protocol B, making it formally confirming to it. Sadly,
currently, there is no elegant way to mark the conformance formally.
A more detailed draft can be found here
https://gist.github.com/zats/52476a83627f5e4c0a85
I would really appreciate your feedback and thoughts on this.
Thank you.

_______________________________________________

swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

--
Javier Soto


(Javier Soto) #4

I believe what you're looking for is here under "complete generics"
https://github.com/apple/swift-evolution/blob/master/README.md

···

On Fri, Dec 25, 2015 at 8:23 AM Sash Zats <sash@zats.io> wrote:

That would be great! Is there a comprehensive list of features that made
it under the cut?
All I'm finding points to swift-evolution repo and API design guidelines.

On Fri, Dec 25, 2015 at 8:09 AM Javier Soto <javier.api@gmail.com> wrote:

If I understood your proposal correctly, this is already planned to be
possible in Swift 3 :slight_smile:
On Thu, Dec 24, 2015 at 9:05 PM Sash Zats via swift-evolution < >> swift-evolution@swift.org> wrote:

Hello,
I ran into several cases when it would be desirable to add an
inheritance clause B in the protocol extension A. Briefly, my proposal is
that compiler should not produce an error once `extension A: B` implements
all the functions of the protocol B, making it formally confirming to it.
Sadly, currently, there is no elegant way to mark the conformance formally.
A more detailed draft can be found here
https://gist.github.com/zats/52476a83627f5e4c0a85
I would really appreciate your feedback and thoughts on this.
Thank you.

_______________________________________________

swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

--
Javier Soto

--

Javier Soto


(Sash Zats) #5

That looks exactly what I was thinking of, thanks!

···

On Fri, Dec 25, 2015 at 8:36 PM Javier Soto <javier.api@gmail.com> wrote:

I believe what you're looking for is here under "complete generics"
https://github.com/apple/swift-evolution/blob/master/README.md
On Fri, Dec 25, 2015 at 8:23 AM Sash Zats <sash@zats.io> wrote:

That would be great! Is there a comprehensive list of features that made
it under the cut?
All I'm finding points to swift-evolution repo and API design guidelines.

On Fri, Dec 25, 2015 at 8:09 AM Javier Soto <javier.api@gmail.com> wrote:

If I understood your proposal correctly, this is already planned to be
possible in Swift 3 :slight_smile:
On Thu, Dec 24, 2015 at 9:05 PM Sash Zats via swift-evolution < >>> swift-evolution@swift.org> wrote:

Hello,
I ran into several cases when it would be desirable to add an
inheritance clause B in the protocol extension A. Briefly, my proposal is
that compiler should not produce an error once `extension A: B` implements
all the functions of the protocol B, making it formally confirming to it.
Sadly, currently, there is no elegant way to mark the conformance formally.
A more detailed draft can be found here
https://gist.github.com/zats/52476a83627f5e4c0a85
I would really appreciate your feedback and thoughts on this.
Thank you.

_______________________________________________

swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

--
Javier Soto

--

Javier Soto