Skip to content

Commit f414836

Browse files
committed
---
yaml --- r: 345953 b: refs/heads/master c: fa7c857 h: refs/heads/master i: 345951: 5c90132
1 parent f571f8d commit f414836

File tree

8 files changed

+53
-5
lines changed

8 files changed

+53
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: ae476790b2afacff1c879541794587e99a313f24
2+
refs/heads/master: fa7c857ec9c2d43bafbfd157e46f35b9e561f061
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/stdlib/public/core/DropWhile.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,3 +157,5 @@ where Base: BidirectionalCollection {
157157
return _base.index(before: i)
158158
}
159159
}
160+
161+
extension LazyDropWhileCollection: LazyCollectionProtocol { }

trunk/stdlib/public/core/Filter.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ extension LazyFilterCollection: Collection {
294294
}
295295
}
296296

297+
extension LazyFilterCollection: LazyCollectionProtocol { }
298+
297299
extension LazyFilterCollection : BidirectionalCollection
298300
where Base : BidirectionalCollection {
299301

trunk/stdlib/public/core/LazyCollection.swift

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,24 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
@available(swift, deprecated: 5.0, renamed: "LazySequence")
14-
public typealias LazyCollectionProtocol = LazySequenceProtocol
13+
public protocol LazyCollectionProtocol: Collection, LazySequenceProtocol
14+
where Elements : Collection { }
15+
16+
extension LazyCollectionProtocol {
17+
// Lazy things are already lazy
18+
@inlinable // protocol-only
19+
public var lazy: LazyCollection<Elements> {
20+
return elements.lazy
21+
}
22+
}
23+
24+
extension LazyCollectionProtocol where Elements: LazyCollectionProtocol {
25+
// Lazy things are already lazy
26+
@inlinable // protocol-only
27+
public var lazy: Elements {
28+
return elements
29+
}
30+
}
1531

1632
/// A collection containing the same elements as a `Base` collection,
1733
/// but on which some operations such as `map` and `filter` are
@@ -127,9 +143,10 @@ extension LazyCollection : Collection {
127143
public func distance(from start: Index, to end: Index) -> Int {
128144
return _base.distance(from:start, to: end)
129145
}
130-
131146
}
132147

148+
extension LazyCollection: LazyCollectionProtocol { }
149+
133150
extension LazyCollection : BidirectionalCollection
134151
where Base : BidirectionalCollection {
135152
@inlinable

trunk/stdlib/public/core/Map.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ extension LazyMapCollection : BidirectionalCollection
185185
}
186186
}
187187

188+
extension LazyMapCollection: LazyCollectionProtocol { }
189+
188190
extension LazyMapCollection : RandomAccessCollection
189191
where Base : RandomAccessCollection { }
190192

trunk/stdlib/public/core/PrefixWhile.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ extension LazyPrefixWhileCollection: Collection {
239239
}
240240
}
241241

242+
extension LazyPrefixWhileCollection: LazyCollectionProtocol { }
243+
242244
extension LazyPrefixWhileCollection: BidirectionalCollection
243245
where Base: BidirectionalCollection {
244246
@inlinable // lazy-performance

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,6 @@ Func _SequenceBox._prefix(while:) has return type change from _AnySequenceBox<τ
341341
Func _SequenceBox._split(maxSplits:omittingEmptySubsequences:whereSeparator:) has been removed
342342
Func _SequenceBox._suffix(_:) has return type change from _AnySequenceBox<τ_0_0.Element> to Array<τ_0_0.Element>
343343
Protocol Collection has generic signature change from <τ_0_0 : Sequence, τ_0_0.Index : Comparable, τ_0_0.Index == τ_0_0.Indices.Element, τ_0_0.Indices : Collection, τ_0_0.Indices == τ_0_0.Indices.SubSequence, τ_0_0.SubSequence : Collection, τ_0_0.Indices.Element == τ_0_0.Indices.Index, τ_0_0.Indices.Index == τ_0_0.SubSequence.Index, τ_0_0.SubSequence.Index == τ_0_0.Indices.Indices.Element, τ_0_0.Indices.Indices.Element == τ_0_0.Indices.Indices.Index, τ_0_0.Indices.Indices.Index == τ_0_0.SubSequence.Indices.Element, τ_0_0.SubSequence.Indices.Element == τ_0_0.SubSequence.Indices.Index, τ_0_0.SubSequence.Indices.Index == τ_0_0.SubSequence.Indices.Indices.Element, τ_0_0.SubSequence.Indices.Indices.Element == τ_0_0.SubSequence.Indices.Indices.Index> to <τ_0_0 : Sequence, τ_0_0.Element == τ_0_0.SubSequence.Element, τ_0_0.Index : Comparable, τ_0_0.Index == τ_0_0.Indices.Element, τ_0_0.Indices : Collection, τ_0_0.Indices == τ_0_0.Indices.SubSequence, τ_0_0.SubSequence : Collection, τ_0_0.SubSequence == τ_0_0.SubSequence.SubSequence, τ_0_0.Indices.Element == τ_0_0.Indices.Index, τ_0_0.Indices.Index == τ_0_0.SubSequence.Index, τ_0_0.SubSequence.Index == τ_0_0.Indices.Indices.Element, τ_0_0.Indices.Indices.Element == τ_0_0.Indices.Indices.Index, τ_0_0.Indices.Indices.Index == τ_0_0.SubSequence.Indices.Element, τ_0_0.SubSequence.Indices.Element == τ_0_0.SubSequence.Indices.Index, τ_0_0.SubSequence.Indices.Index == τ_0_0.SubSequence.Indices.Indices.Element, τ_0_0.SubSequence.Indices.Indices.Element == τ_0_0.SubSequence.Indices.Indices.Index>
344-
Protocol LazyCollectionProtocol has been removed
345344
Protocol Sequence has generic signature change from <τ_0_0.Element == τ_0_0.Iterator.Element, τ_0_0.Iterator : IteratorProtocol, τ_0_0.SubSequence : Sequence, τ_0_0.SubSequence == τ_0_0.SubSequence.SubSequence, τ_0_0.Iterator.Element == τ_0_0.SubSequence.Element, τ_0_0.SubSequence.Element == τ_0_0.SubSequence.Iterator.Element> to <τ_0_0.Element == τ_0_0.Iterator.Element, τ_0_0.Iterator : IteratorProtocol>
346345
Protocol _SequenceWrapper has been removed
347346
Struct AnySequence has removed conformance to Sequence
@@ -487,3 +486,15 @@ Protocol _ShadowProtocol has been removed
487486
Func ManagedBufferPointer._sanityCheckValidBufferClass(_:creating:) has been removed
488487
Func _sanityCheck(_:_:file:line:) has been removed
489488
Func _sanityCheckFailure(_:file:line:) has been removed
489+
490+
AssociatedType LazyCollectionProtocol.Elements has been removed
491+
Func LazyCollectionProtocol.compactMap(_:) has been removed
492+
Func LazyCollectionProtocol.drop(while:) has been removed
493+
Func LazyCollectionProtocol.filter(_:) has been removed
494+
Func LazyCollectionProtocol.flatMap(_:) has been removed
495+
Func LazyCollectionProtocol.flatMap(_:) has been removed (deprecated)
496+
Func LazyCollectionProtocol.joined() has been removed
497+
Func LazyCollectionProtocol.map(_:) has been removed
498+
Func LazyCollectionProtocol.prefix(while:) has been removed
499+
Func LazyCollectionProtocol.reversed() has been removed
500+
Var LazyCollectionProtocol.lazy has declared type change from LazyCollection<τ_0_0.Elements> to LazySequence<τ_0_0.Elements>

trunk/test/api-digester/Outputs/stability-stdlib-source.swift.expected

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,15 @@ TypeAlias UnfoldSequence.SubSequence has been removed
114114
TypeAlias UnsafeRawBufferPointer.Iterator.SubSequence has been removed
115115
TypeAlias Zip2Sequence.SubSequence has been removed
116116
Var Collection.lazy has been removed
117+
118+
AssociatedType LazyCollectionProtocol.Elements has been removed
119+
Func LazyCollectionProtocol.compactMap(_:) has been removed
120+
Func LazyCollectionProtocol.drop(while:) has been removed
121+
Func LazyCollectionProtocol.filter(_:) has been removed
122+
Func LazyCollectionProtocol.flatMap(_:) has been removed
123+
Func LazyCollectionProtocol.flatMap(_:) has been removed (deprecated)
124+
Func LazyCollectionProtocol.joined() has been removed
125+
Func LazyCollectionProtocol.map(_:) has been removed
126+
Func LazyCollectionProtocol.prefix(while:) has been removed
127+
Func LazyCollectionProtocol.reversed() has been removed
128+
Var LazyCollectionProtocol.lazy has declared type change from LazyCollection<Self.Elements> to LazySequence<Self.Elements>

0 commit comments

Comments
 (0)