Skip to content

Commit 9cb78da

Browse files
committed
Move IndexDistance typealias into the Collection protocol
1 parent 1c99238 commit 9cb78da

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

stdlib/public/core/Collection.swift

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,9 @@ public protocol Collection: Sequence where SubSequence: Collection {
776776
/// - Parameter i: A valid index of the collection. `i` must be less than
777777
/// `endIndex`.
778778
func formIndex(after i: inout Index)
779+
780+
@available(swift, deprecated, message: "all index distances are now of type Int")
781+
typealias IndexDistance = Int
779782
}
780783

781784
/// Default implementation for forward collections.
@@ -1695,17 +1698,9 @@ extension Collection {
16951698
// guarantees of Swift 3, but it cannot due to a bug.
16961699
@available(*, unavailable, renamed: "Iterator")
16971700
public typealias Generator = Iterator
1698-
}
16991701

1700-
extension Collection {
17011702
@available(swift, deprecated: 3.2, renamed: "Element")
17021703
public typealias _Element = Element
1703-
}
1704-
1705-
1706-
extension Collection {
1707-
@available(swift, deprecated, message: "all index distances are now of type Int")
1708-
public typealias IndexDistance = Int
17091704

17101705
@available(*, deprecated, message: "all index distances are now of type Int")
17111706
public func index<T: BinaryInteger>(_ i: Index, offsetBy n: T) -> Index {

0 commit comments

Comments
 (0)