Skip to content

Commit 2201d0e

Browse files
committed
[stdlib] Set, Dictionary: Move compatibility typealiases to end of file
1 parent 791d29f commit 2201d0e

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

stdlib/public/core/Dictionary.swift

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4139,9 +4139,6 @@ extension Dictionary.Index {
41394139
#endif
41404140
}
41414141

4142-
public typealias DictionaryIndex<Key: Hashable, Value> =
4143-
Dictionary<Key, Value>.Index
4144-
41454142
extension Dictionary.Index: Equatable {
41464143
@inlinable
41474144
public static func == (
@@ -4377,9 +4374,6 @@ extension Dictionary {
43774374
}
43784375
}
43794376

4380-
public typealias DictionaryIterator<Key: Hashable, Value> =
4381-
Dictionary<Key, Value>.Iterator
4382-
43834377
extension Dictionary.Iterator {
43844378
@inlinable
43854379
internal static func _native(
@@ -4594,3 +4588,8 @@ extension Dictionary {
45944588
}
45954589
}
45964590
#endif
4591+
4592+
public typealias DictionaryIndex<Key: Hashable, Value> =
4593+
Dictionary<Key, Value>.Index
4594+
public typealias DictionaryIterator<Key: Hashable, Value> =
4595+
Dictionary<Key, Value>.Iterator

stdlib/public/core/SequenceAlgorithms.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ extension Sequence {
4343
/// list consisting of indices of names with five or fewer letters.
4444
///
4545
/// let names: Set = ["Sofia", "Camilla", "Martina", "Mateo", "Nicolás"]
46-
/// var shorterIndices: [SetIndex<String>] = []
46+
/// var shorterIndices: [Set<String>.Index] = []
4747
/// for (i, name) in zip(names.indices, names) {
4848
/// if name.count <= 5 {
4949
/// shorterIndices.append(i)

stdlib/public/core/Set.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3346,8 +3346,6 @@ extension Set.Index {
33463346
#endif
33473347
}
33483348

3349-
public typealias SetIndex<Element: Hashable> = Set<Element>.Index
3350-
33513349
extension Set.Index: Equatable {
33523350
@inlinable
33533351
public static func == (
@@ -3582,8 +3580,6 @@ extension Set {
35823580
}
35833581
}
35843582

3585-
public typealias SetIterator<Element: Hashable> = Set<Element>.Iterator
3586-
35873583
extension Set.Iterator {
35883584
@inlinable
35893585
internal static func _native(
@@ -3788,3 +3784,6 @@ extension Set {
37883784
}
37893785
}
37903786
#endif
3787+
3788+
public typealias SetIndex<Element: Hashable> = Set<Element>.Index
3789+
public typealias SetIterator<Element: Hashable> = Set<Element>.Iterator

0 commit comments

Comments
 (0)