[swift-evolution] Enhanced existential types proposal discussion

Joe Groff jgroff at apple.com
Tue May 17 15:55:53 CDT 2016


> On May 17, 2016, at 1:27 PM, Matthew Johnson via swift-evolution <swift-evolution at swift.org> wrote:
> 
> 
>> On May 17, 2016, at 3:06 PM, Austin Zheng <austinzheng at gmail.com> wrote:
>> 
>> I'm honestly not sure it makes sense to introduce a proposal just for expressing <Class, Protocol, Protocol> style requirements, and then trying to retrofit fuller support for other existentials onto it. I would prefer that the 'basic package' of existential cases be considered together as a single proposal, unless a core team member expresses their preference otherwise.
> 
> It also renames protocol<> to Any, but fair enough.  
> 
> One reason to keep it separate is that the rename is a breaking change and we should really try to get that into Swift 3.  Generalizing existentials is an additive change.  I would love to have that in Swift 3 as well, but if it’s not going to make it I don’t think it should hold back the smaller change which is a breaking change.
> 
> Doug, any opinion on this?

I agree with this. If we're certain we should reskin protocol<> as Any<>, we should frontload that change—in addition to affecting source code, it'd also influence the runtime behavior of type printing/parsing, which can't be statically migrated in the future. I think any discussion of extending existentials has to be considered out of scope for Swift 3, though, so the Any rename deserves its own proposal.

-Joe


More information about the swift-evolution mailing list