[swift-evolution] [Review] SE-0156: Class and Subtype existentials

Adrian Zubarev adrian.zubarev at devandartist.com
Fri Mar 3 08:39:25 CST 2017

And what if we ever decide that restricting protocols to structs or enums should be allowed as well?
AnyValue (_might_ happen with value sub typing)?

Or maybe there are secret plans to add new reference types to Swift?
Classes aren’t the only reference types in Swift, functions are also reference types, but there is no way to express something like _any function_.

The question is, if the *new* reference types will be objects or something different. Otherwise we’ll simply need to add AnyReference or something similar to that.

There was a huuuuge talk about AnyValue vs. AnyObject last year, and I’m totally convinced with AnyObject. The Any prefix also indicates that it’s an existential which is correct in this context.

Adrian Zubarev
Sent with Airmail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170303/36ac8e82/attachment.html>

More information about the swift-evolution mailing list