Slide 13
Slide 13 text
RECURSIVE CONSTRAINTS ON ASSOCIATED
TYPES
// Will not compile in Swift 4, will in Swift 5
protocol Sequence {
associatedtype SubSequence: Sequence
where Iterator.Element == SubSequence.Iterator.Element, SubSequence.SubSequence == SubSequence
// Returns a subsequence containing all but the first 'n' items
// in the original sequence.
func dropFirst(_ n: Int) -> Self.SubSequence
// ...
}
13 — @basthomas