[swift-evolution] [swift-evolution-announce] [Review] SE-0089: Replace protocol<P1, P2> syntax with Any<P1, P2>
adrian.zubarev at devandartist.com
Thu May 26 04:16:04 CDT 2016
There is great feedback going on here. I'd like to consider a few things here:
What if we name the whole thing `Existential<>` to sort out all confusion? This would allow `typealias Any = Existential<>`.
Should `protocol A: Any<class>` replace `protocol A: class`? Or at least deprecate it.
Do we need `typealias AnyClass = Any<class>` or do we want to use any class requirement existential directly? If second, we will need to allow direct existential usage on protocols (right now we only can use typealiases as a worksround).
Sent with Airmail
Am 25. Mai 2016 um 23:26:25, Jan E. Schotsman via swift-evolution (swift-evolution at swift.org(mailto:swift-evolution at swift.org)) schrieb:
> Maybe we should adopt a Swift specific definition of existential, like
> "An existential type is a type derived from Any with constraints of
> the kinds listed below:"
> For example, the 5 kinds of constraint proposed by Austin Zheng.
> Not very academic, but might save some discussion.
> That would include the existing Protocol as type (no associated type
> or Self requirements).
> Also Any<ClassName> which equals the class (which hides type
> information through automatic upcasting of subclass instances).
> A narrower definition might require protocols to be involved somehow
> and the resulting type must be new (not equivalent to a class or
> struct or enum).
> swift-evolution mailing list
> swift-evolution at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution