[swift-evolution] [Pre-proposal] Replace [Foo] With CollectionType
austinzheng at gmail.com
Tue May 24 21:19:35 CDT 2016
I regret mentioning existentials; I am aware that an existential that isn't
sufficiently constrained will never be able to provide the same guarantees
as a generic type variable. My argument is that even a partially
constrained existential is useful if there is a useful set of APIs that
don't touch the associated types in question. I do not believe that they
fulfill the same role as generics, and I apologize for writing a response
that strongly implied they were.
That being said, my opinion regarding this suggestion is still this: [Foo]
is not an array, Collection<Foo> is not a generic protocol, and I am
strongly against any sort of compiler magic that makes those types mean
anything other than what they appear to be.
If this rule:
> > The generalized existentials proposal goes out of its way to be explicit
> about the fact that only type safe operations would be visible through the
> Is trying to say that this isn't the case because APIs using the
> collection's `Index` are not exposed on an `AnyCollection`, well, then I'm
> not sure what `AnyCollection` is actually supposed to be used for.
> Brent Royal-Gordon
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution