Skip to content

Commit 26cdef1

Browse files
authored
Merge pull request #12342 from natecook1000/nc-indexdistance
[stdlib] Constrain SubSequence.IndexDistance == IndexDistance
2 parents 4df3541 + 0648aad commit 26cdef1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

stdlib/public/core/Collection.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,8 @@ public protocol Collection : Sequence
404404
/// protocol, but it is restated here with stricter constraints. In a
405405
/// collection, the subsequence should also conform to `Collection`.
406406
associatedtype SubSequence : Collection = Slice<Self>
407-
where SubSequence.Index == Index
407+
where SubSequence.Index == Index,
408+
SubSequence.IndexDistance == IndexDistance
408409

409410
/// Accesses the element at the specified position.
410411
///

0 commit comments

Comments
 (0)