> Why don’t we just use angle brackets to specify associated types? Protocols 
> aren’t using them for anything anyway.
You normally don't want to specify all associated types that way — if you had 
to, Array<T> would be declared like

struct Array<T>: SomeSequenceProtocol<T, IndexingIterator<Array<T>>, 
CountableRange<T>…>, ...

In C++, I have seen such things in the wild, and it's really no fun to work 
with such code.
Maybe it is feasible to think about that approach when generics support named 
parameters with default values, but in general, associated types and generics 
have different use cases.

> if let someSequence as? Sequence<Iterator.Element == Int> { // do something }

hey, is this a try to silently establish a shortcut for if-let assignment? ;-)

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to