[swift-evolution] [Pitch] Rename protocol<> to Any<>

Austin Zheng austinzheng at gmail.com
Thu May 19 02:57:36 CDT 2016

Forbidding redundant use of protocol<...>/Any<...> would be a great follow-up proposal. Mercifully, there are few interdependencies between the two proposals - you could conceivably propose it even if if Any<...> were rejected, and just have it apply to protocol<...>.


> On May 19, 2016, at 12:50 AM, David Waite via swift-evolution <swift-evolution at swift.org> wrote:
> They can all be interpreted, but:
> - they provide multiple ways of expressing the same concept
> - the additional uses of Any detract from code clarity
> - it is possible (in the absence of an established design) that these syntaxes (particularly Any<Any<ProtocolA>>) might limit our ability to add existential types without either breaking existing code or adding special cases in the parser. I can go into more detail on my reasoning here, but that seems a diversion of this topic to do so.
> An example elsewhere in the language of otherwise valid code being rejected because the syntax is redundant:
> enum MyError:ErrorType, ErrorType {}
> I’m also specifically saying that the *syntax* should warn on the use of Any-within-Any. Code such as:
> typealias Foo = Any
> typealias Bar = Any<Foo, Sequence>
> would be fine.
> -DW
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

More information about the swift-evolution mailing list