[swift-evolution] [swift-evolution-announce] [Review] SE-0095: Replace `protocol<P1, P2>` syntax with `Any<P1, P2>`

Scott James Remnant scott at netsplit.com
Wed Jun 22 14:33:56 CDT 2016


Have given this a thorough review, both the final proposal, and its development during the draft phases on the list, etc.

Unfortunately I have to give the final proposal as it stands a strong -1.

While I appreciate the future benefits of more generic existential types, the final proposal introduces syntax that is flat-out confusing and inconsistent with the rest of Swift 3.


In Swift, the & operator is not used for composition, it serves only as the “Bitwise AND" operator for integer operations.


OptionSetType gives a good example, where Swift has actively abandoned & for composition. Previously code was in an Obj-C style, e.g.

  NSOptionBox & NSOptionCarton

but now uses “,” for composition within an array context:

  [.box, .carton]


For this reason, I find that the pattern `<…, …, …>` is still a more Swift-y type composition syntax than the proposal.

Scott



More information about the swift-evolution mailing list