[swift-evolution] Subclass Existentials

Douglas Gregor dgregor at apple.com
Wed Feb 1 18:09:09 CST 2017


> On Feb 1, 2017, at 3:13 PM, David Hart <david at hartbit.com> wrote:
> 
> Second question inline:
> 
> 
> 
> Sent from my iPhone
> On 1 Feb 2017, at 23:09, David Hart <david at hartbit.com <mailto:david at hartbit.com>> wrote:
> 
>> I did consider it, but didn’t want to put too much on your plate for Swift 4. But if you’re mentioning it, I’ll go ahead and add it to the second version of the proposal.
>> 
>> By the way, what you is your point of view about the discussions we’ve had concerning the positioning of the class constraint?
>> 
>> David.
>> 
>>> On 1 Feb 2017, at 22:58, Douglas Gregor <dgregor at apple.com <mailto:dgregor at apple.com>> wrote:
>>> 
>>> 
>>>> On Jan 29, 2017, at 8:39 AM, David Hart <david at hartbit.com <mailto:david at hartbit.com>> wrote:
>>>> 
>>>> Hello,
>>>> 
>>>> As promised, I wrote the first draft of a proposal to add class requirements to the existential syntax. Please let me know what you think.
>>>> 
>>>> https://github.com/hartbit/swift-evolution/blob/subclass-existentials/proposals/XXXX-subclass-existentials.md <https://github.com/hartbit/swift-evolution/blob/subclass-existentials/proposals/XXXX-subclass-existentials.md>
>>> This looks good! I’m looking forward to the second draft, but I have one question.
>>> 
>>> Did you consider the generalized “class” constraint? IIRC, this was in Austin’s larger proposal, and it allowed for (e.g.)
>>> 
>>> 	typealias CustomStringConvertibleClass = class & CustomStringConvertible    // class that conforms to CustomStringConvertible
>>> 
>>> and potentially a wonderful cleanup where AnyObject ceases to be a weird special protocol and instead becomes
>>> 
>>> 	typealias AnyObject = Any & class
>>> 
> 
> Austin's proposal defines it as:
> 
> typealias AnyObject = class
> 
> Is Any necessary?

Nah, it should be okay to just have “class” there.

	- Doug

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170201/f340db17/attachment.html>


More information about the swift-evolution mailing list