[swift-users] Multiple Class Types in Protocol Composition

Mario Meili mario.meili at live.com
Thu Dec 7 09:17:45 CST 2017

Hi everyone,

I noticed strange behaviour of the Swift 4.0.3 compiler regarding class and subtype existentials.

According to the proposal SE-0156 (https://github.com/apple/swift-evolution/blob/master/proposals/0156-subclass-existentials.md), multiple class types in protocol compositions should be allowed, if:

  *   The class types are the same
  *   Or, one class type must be a subtype of the other.

However, when copying the exact code from the proposal into Xcode 9.2, the result is the following:

[cid:image001.png at 01D36F76.E9815E30]

My conclusion here is that the compiler does not allow multiple class types in one protocol composition.

My question is:
Is this behaviour intended or should I open a bug report?

Thank you very much

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20171207/683370ce/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 63027 bytes
Desc: image001.png
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20171207/683370ce/attachment.png>

More information about the swift-users mailing list