Skip to content

Commit 7ac6c04

Browse files
author
Max Moiseev
committed
[stdlib] @available attributes for startIndex/endIndex on ranges
1 parent 1e8463b commit 7ac6c04

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

stdlib/public/core/ClosedRange.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,3 +401,14 @@ public func ... <
401401
return CountableClosedRange(uncheckedBounds: (lower: minimum, upper: maximum))
402402
}
403403

404+
extension ClosedRange {
405+
@available(*, unavailable, renamed: "lowerBound")
406+
public var startIndex: Bound {
407+
Builtin.unreachable()
408+
}
409+
410+
@available(*, unavailable, renamed: "upperBound")
411+
public var endIndex: Bound {
412+
Builtin.unreachable()
413+
}
414+
}

stdlib/public/core/Range.swift.gyb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,3 +589,15 @@ public func ..< <
589589
// swift-3-indexing-model: this is not really a proper rename
590590
@available(*, unavailable, renamed: "IndexingIterator")
591591
public struct RangeGenerator<Bound> {}
592+
593+
extension Range {
594+
@available(*, unavailable, renamed: "lowerBound")
595+
public var startIndex: Bound {
596+
Builtin.unreachable()
597+
}
598+
599+
@available(*, unavailable, renamed: "upperBound")
600+
public var endIndex: Bound {
601+
Builtin.unreachable()
602+
}
603+
}

0 commit comments

Comments
 (0)