[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:
Michael Ilseman
2016-07-28 20:28:26 -07:00
parent b4b31908a6
commit ccda8f33d1
27 changed files with 153 additions and 152 deletions

View File

@@ -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?>>,