mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
stdlib: annotate Array.map() and Array.filter() with @noescape
Now these functions are implemented using protocol extensions, which are, in turn, implemented with an unsafe hack that casts @noescape away. rdar://20544096 Swift SVN r27397
This commit is contained in:
@@ -691,7 +691,7 @@ extension ${Self} : _ArrayType {
|
||||
|
||||
/// Return ${a_Self} containing the results of calling
|
||||
/// `transform(x)` on each element `x` of `self`
|
||||
public func map<U>(transform: (T) -> U) -> ${Self}<U> {
|
||||
public func map<U>(@noescape transform: (T) -> U) -> ${Self}<U> {
|
||||
// FIXME(prext): remove this function when protocol extensions land.
|
||||
return ${Self}<U>(self._prext_map(transform))
|
||||
}
|
||||
@@ -711,7 +711,7 @@ extension ${Self} : _ArrayType {
|
||||
|
||||
/// Return ${a_Self} containing the elements `x` of `self` for which
|
||||
/// `includeElement(x)` is `true`
|
||||
public func filter(includeElement: (T) -> Bool) -> ${Self} {
|
||||
public func filter(@noescape includeElement: (T) -> Bool) -> ${Self} {
|
||||
// FIXME(prext): remove this function when protocol extensions land.
|
||||
return self._prext_filter(includeElement)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user