Skip to content

Commit 6d07945

Browse files
authored
Merge pull request swiftlang#38635 from lorentey/update-subsequence-docs
2 parents b3d6424 + 849f6b9 commit 6d07945

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

stdlib/public/core/Collection.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -387,12 +387,11 @@ public protocol Collection: Sequence {
387387
/// Returns an iterator over the elements of the collection.
388388
override __consuming func makeIterator() -> Iterator
389389

390-
/// A sequence that represents a contiguous subrange of the collection's
391-
/// elements.
390+
/// A collection representing a contiguous subrange of this collection's
391+
/// elements. The subsequence shares indices with the original collection.
392392
///
393-
/// This associated type appears as a requirement in the `Sequence`
394-
/// protocol, but it is restated here with stricter constraints. In a
395-
/// collection, the subsequence should also conform to `Collection`.
393+
/// The default subsequence type for collections that don't define their own
394+
/// is `Slice`.
396395
associatedtype SubSequence: Collection = Slice<Self>
397396
where SubSequence.Index == Index,
398397
Element == SubSequence.Element,

0 commit comments

Comments
 (0)