[swift-evolution] Enhanced Existentials

Karl Wagner razielim at gmail.com
Sat Jan 7 05:07:13 CST 2017

> On 7 Jan 2017, at 08:04, Russ Bishop via swift-evolution <swift-evolution at swift.org> wrote:
>> On Jan 4, 2017, at 8:48 PM, Douglas Gregor via swift-evolution <swift-evolution at swift.org> wrote:
>>> Would love to see this come forward into discussion.
>> Yeah. I'm less sure about the other enhancements to existentials fitting into Swift 4, e.g., the creation of existentials for protocols with associated types. Although important, it's a big feature that will take a bunch of design and implementation time, and I'm leery of accepting something that we might not actually be able to achieve. 
>>  - Doug
> By this are you referring to generalized existentials? If so I’ll say this is such a constant pain point and perverts so many API designs… not to mention vomiting AnyXYZ type-erased wrappers everywhere… In my completely non-authoritative personal opinion we shouldn’t ship Swift 4 without it :)
> Russ
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

There is one little thing we could do to make that easier to live with: we could allow closure properties to satisfy function requirements on protocols.

It’s on my wishlist of things to propose in phase 2: https://gist.github.com/karwa/52b35a8a1f3bebc24264df5aeb2aa761#allow-function-requirements-in-protocols-to-be-satisfied-by-closure-type-properties

- Karl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170107/5c8fb19c/attachment.html>

More information about the swift-evolution mailing list