mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[noescape by default] Proliferate @escaping
Adds an explicit @escaping throughout the standard library, validation test suite, and tests. This will be necessary as soon as noescape is the default for closure parameters.
This commit is contained in:
@@ -18,7 +18,7 @@ extension LazySequenceProtocol {
|
||||
///
|
||||
/// - Complexity: O(1)
|
||||
public func flatMap<SegmentOfResult : Sequence>(
|
||||
_ transform: (Elements.Iterator.Element) -> SegmentOfResult
|
||||
_ transform: @escaping (Elements.Iterator.Element) -> SegmentOfResult
|
||||
) -> LazySequence<
|
||||
FlattenSequence<LazyMapSequence<Elements, SegmentOfResult>>> {
|
||||
return self.map(transform).joined()
|
||||
@@ -33,7 +33,7 @@ extension LazySequenceProtocol {
|
||||
/// - Parameter transform: A closure that accepts an element of this
|
||||
/// sequence as its argument and returns an optional value.
|
||||
public func flatMap<ElementOfResult>(
|
||||
_ transform: (Elements.Iterator.Element) -> ElementOfResult?
|
||||
_ transform: @escaping (Elements.Iterator.Element) -> ElementOfResult?
|
||||
) -> LazyMapSequence<
|
||||
LazyFilterSequence<
|
||||
LazyMapSequence<Elements, ElementOfResult?>>,
|
||||
@@ -51,7 +51,7 @@ extension LazyCollectionProtocol {
|
||||
///
|
||||
/// - Complexity: O(1)
|
||||
public func flatMap<SegmentOfResult : Collection>(
|
||||
_ transform: (Elements.Iterator.Element) -> SegmentOfResult
|
||||
_ transform: @escaping (Elements.Iterator.Element) -> SegmentOfResult
|
||||
) -> LazyCollection<
|
||||
FlattenCollection<
|
||||
LazyMapCollection<Elements, SegmentOfResult>>
|
||||
@@ -68,7 +68,7 @@ extension LazyCollectionProtocol {
|
||||
/// - Parameter transform: A closure that accepts an element of this
|
||||
/// collection as its argument and returns an optional value.
|
||||
public func flatMap<ElementOfResult>(
|
||||
_ transform: (Elements.Iterator.Element) -> ElementOfResult?
|
||||
_ transform: @escaping (Elements.Iterator.Element) -> ElementOfResult?
|
||||
) -> LazyMapCollection<
|
||||
LazyFilterCollection<
|
||||
LazyMapCollection<Elements, ElementOfResult?>>,
|
||||
@@ -90,7 +90,7 @@ extension LazyCollectionProtocol
|
||||
///
|
||||
/// - Complexity: O(1)
|
||||
public func flatMap<SegmentOfResult : Collection>(
|
||||
_ transform: (Elements.Iterator.Element) -> SegmentOfResult
|
||||
_ transform: @escaping (Elements.Iterator.Element) -> SegmentOfResult
|
||||
) -> LazyCollection<
|
||||
FlattenBidirectionalCollection<
|
||||
LazyMapBidirectionalCollection<Elements, SegmentOfResult>>>
|
||||
@@ -107,7 +107,7 @@ extension LazyCollectionProtocol
|
||||
/// - Parameter transform: A closure that accepts an element of this
|
||||
/// collection as its argument and returns an optional value.
|
||||
public func flatMap<ElementOfResult>(
|
||||
_ transform: (Elements.Iterator.Element) -> ElementOfResult?
|
||||
_ transform: @escaping (Elements.Iterator.Element) -> ElementOfResult?
|
||||
) -> LazyMapBidirectionalCollection<
|
||||
LazyFilterBidirectionalCollection<
|
||||
LazyMapBidirectionalCollection<Elements, ElementOfResult?>>,
|
||||
|
||||
Reference in New Issue
Block a user