Skip to content

[stdlib][5.0] Remove Strideable ClosedRange operator #21252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions stdlib/public/core/ClosedRange.swift
Original file line number Diff line number Diff line change
Expand Up @@ -338,38 +338,6 @@ extension Comparable {
}
}

extension Strideable where Stride: SignedInteger {
/// Returns a countable closed range that contains both of its bounds.
///
/// Use the closed range operator (`...`) to create a closed range of any type
/// that conforms to the `Strideable` protocol with an associated signed
/// integer `Stride` type, such as any of the standard library's integer
/// types. This example creates a `ClosedRange<Int>` from zero up to,
/// and including, nine.
///
/// let singleDigits = 0...9
/// print(singleDigits.contains(9))
/// // Prints "true"
///
/// You can use sequence or collection methods on the `singleDigits` range.
///
/// print(singleDigits.count)
/// // Prints "10"
/// print(singleDigits.last)
/// // Prints "9"
///
/// - Parameters:)`.
/// - minimum: The lower bound for the range.
/// - maximum: The upper bound for the range.
@_transparent
public static func ... (minimum: Self, maximum: Self) -> ClosedRange<Self> {
// FIXME: swift-3-indexing-model: tests for traps.
_precondition(
minimum <= maximum, "Can't form Range with upperBound < lowerBound")
return ClosedRange(uncheckedBounds: (lower: minimum, upper: maximum))
}
}

extension ClosedRange: Equatable {
/// Returns a Boolean value indicating whether two ranges are equal.
///
Expand Down
2 changes: 2 additions & 0 deletions test/api-digester/Outputs/stability-stdlib-abi.swift.expected
Original file line number Diff line number Diff line change
Expand Up @@ -600,3 +600,5 @@ Var String.Index._utf16Index has been removed (deprecated)

Func MutableCollection.withContiguousMutableStorageIfAvailable(_:) has been added as a protocol requirement
Func Sequence.withContiguousStorageIfAvailable(_:) has been added as a protocol requirement

Func Strideable....(_:_:) has been removed
Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,5 @@ Func Sequence.reduce(into:_:) has parameter 0 changing from Default to Owned

Func MutableCollection.withContiguousMutableStorageIfAvailable(_:) has been added as a protocol requirement
Func Sequence.withContiguousStorageIfAvailable(_:) has been added as a protocol requirement

Func Strideable....(_:_:) has been removed