<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class=""><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Why don’t we just use angle brackets to specify associated types? Protocols aren’t using them for anything anyway.</div></div></blockquote><div>You normally don't want to specify all associated types that way — if you had to, Array<T> would be declared like</div><div><br class=""></div><div>struct Array<T>: SomeSequenceProtocol<T, IndexingIterator<Array<T>>, CountableRange<T>…>, ...</div><div><br class=""></div><div>In C++, I have seen such things in the wild, and it's really no fun to work with such code.</div><div>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.</div><div><br class=""></div><blockquote type="cite" class=""><div class=""><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">if let someSequence as? Sequence<Iterator.Element == Int> { // do something }</div></div></blockquote></div><br class=""><div class="">hey, is this a try to silently establish a shortcut for if-let assignment? ;-)</div><div class=""><br class=""></div></body></html>