Skip to content

Commit 31bd6d4

Browse files
committed
[stdlib] Remove the UnboundedRange_ enum
1 parent fdc6a71 commit 31bd6d4

File tree

4 files changed

+7
-17
lines changed

4 files changed

+7
-17
lines changed

stdlib/public/core/Range.swift

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -827,22 +827,7 @@ extension Comparable {
827827
/// let word2 = "grisly"
828828
/// let changes = countLetterChanges(word1[...], word2[...])
829829
/// // changes == 2
830-
@_frozen // namespace
831-
public enum UnboundedRange_ {
832-
// FIXME: replace this with a computed var named `...` when the language makes
833-
// that possible.
834-
835-
/// Creates an unbounded range expression.
836-
///
837-
/// The unbounded range operator (`...`) is valid only within a collection's
838-
/// subscript.
839-
public static postfix func ... (_: UnboundedRange_) -> () {
840-
// This function is uncallable
841-
}
842-
}
843-
844-
/// The type of an unbounded range operator.
845-
public typealias UnboundedRange = (UnboundedRange_)->()
830+
public typealias UnboundedRange = (Never) -> PartialRangeFrom<Never>
846831

847832
extension Collection {
848833
/// Accesses the contiguous subrange of the collection's elements specified

test/api-digester/Outputs/stability-stdlib-abi.swift.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,5 @@ Var _RawDictionaryStorage.empty has declared type change from _EmptyDictionarySi
7373
Var _RawSetStorage.empty has declared type change from _EmptySetSingleton to __EmptySetSingleton
7474

7575
Func tryReallocateUniquelyReferenced(buffer:newMinimumCapacity:) has been removed
76+
77+
Enum UnboundedRange_ has been removed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
Func tryReallocateUniquelyReferenced(buffer:newMinimumCapacity:) has been removed
2+
3+
/* FIXME(SR-9283): TypeAlias UnboundedRange has underlying type change from (UnboundedRange_) -> () to (Never) -> PartialRangeFrom<Never> */
4+
Enum UnboundedRange_ has been removed

test/type/types.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var d4 : () -> Int = { d2 } // expected-error{{function produces expected type
2020

2121
var e0 : [Int]
2222
e0[] // expected-error {{cannot subscript a value of type '[Int]' with an index of type '()'}}
23-
// expected-note @-1 {{overloads for 'subscript' exist with these partially matching parameter lists: ((UnboundedRange_) -> ()), (Int), (R), (Range<Int>), (Range<Self.Index>)}}
23+
// expected-note @-1 {{overloads for 'subscript' exist with these partially matching parameter lists: ((Never) -> PartialRangeFrom<Never>), (Int), (R), (Range<Int>), (Range<Self.Index>)}}
2424

2525
var f0 : [Float]
2626
var f1 : [(Int,Int)]

0 commit comments

Comments
 (0)