[swift-evolution] [Review] SE-0095: Replace `protocol<P1, P2>` syntax with `Any<P1, P2>`
Adrian Zubarev
adrian.zubarev at devandartist.com
Wed Jun 22 13:54:05 CDT 2016
Not with this proposal, but this should be allowed at a later point.
This would work as a workaround.
protocol A { }
protocol B { }
typealias AB = A & B
struct Foo : AB { }
class SuperClass { }
class SubClass : SuperClass, AB { }
It’s up to the core team to decide if your mentioned behavior should be allowed with this proposal.
--
Adrian Zubarev
Sent with Airmail
Am 22. Juni 2016 um 20:45:55, Ian Partridge via swift-evolution (swift-evolution at swift.org) schrieb:
Could this ampersand syntax be reused in protocol adoption too?
Idea:
protocol A { }
protocol B { }
struct Foo : A & B { }
class SuperClass { }
class SubClass : SuperClass, A & B { }
This would solve a problem: currently you cannot tell at a glance whether a class is a) inheriting from a superclass and adopting one protocol, or b) adopting two protocols.
Ian Partridge
On 22 June 2016 at 19:04, Chris Lattner via swift-evolution <swift-evolution at swift.org> wrote:
>
> Hello Swift community,
>
> The review of "SE-0095: Replace `protocol<P1,P2>` syntax with `Any<P1,P2>`" begins now and runs through June 27. The proposal is available here:
>
> https://github.com/apple/swift-evolution/blob/master/proposals/0095-any-as-existential.md
--
Ian Partridge
_______________________________________________
swift-evolution mailing list
swift-evolution at swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160622/6785394e/attachment.html>
More information about the swift-evolution
mailing list