Skip to content

Commit 4381735

Browse files
Switch Zip2Sequence.init to be internal (#20148)
1 parent 1e7e733 commit 4381735

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Diff for: stdlib/public/core/Zip.swift

+2-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
public func zip<Sequence1, Sequence2>(
4646
_ sequence1: Sequence1, _ sequence2: Sequence2
4747
) -> Zip2Sequence<Sequence1, Sequence2> {
48-
return Zip2Sequence(_sequence1: sequence1, _sequence2: sequence2)
48+
return Zip2Sequence(sequence1, sequence2)
4949
}
5050

5151
/// A sequence of pairs built out of two underlying sequences.
@@ -77,8 +77,7 @@ public struct Zip2Sequence<Sequence1 : Sequence, Sequence2 : Sequence> {
7777
/// Creates an instance that makes pairs of elements from `sequence1` and
7878
/// `sequence2`.
7979
@inlinable // generic-performance
80-
public // @testable
81-
init(_sequence1 sequence1: Sequence1, _sequence2 sequence2: Sequence2) {
80+
internal init(_ sequence1: Sequence1, _ sequence2: Sequence2) {
8281
(_sequence1, _sequence2) = (sequence1, sequence2)
8382
}
8483
}

Diff for: test/Interpreter/protocol_extensions.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ extension Sequence {
6565

6666
extension Sequence {
6767
public func myZip<S : Sequence>(_ s: S) -> Zip2Sequence<Self, S> {
68-
return Zip2Sequence(_sequence1: self, _sequence2: s)
68+
return zip(self, s)
6969
}
7070
}
7171

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

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
Constructor AnyHashable.init(_box:) has been removed
88
Constructor AnyHashable.init(_usingDefaultRepresentationOf:) has been removed
99
Constructor ManagedBufferPointer.init(_:_:_:) has been removed
10+
Constructor Zip2Sequence.init(_sequence1:_sequence2:) has been removed
1011
Constructor _BridgeableMetatype.init(value:) has been removed
1112
Func AnyHashable._downCastConditional(into:) has been removed
1213
Func _CocoaDictionary.Index.copy() has been removed

0 commit comments

Comments
 (0)