Skip to content

Commit 80f6ce6

Browse files
committed
fix warnings for SE-0049 (Move @NoEscape ...)
This fixes the `warning: @NoEscape is now an attribute on a parameter type, instead of on the parameter itself`.
1 parent 5dcaadb commit 80f6ce6

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

Foundation/NSKeyedUnarchiver.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ public class NSKeyedUnarchiver : NSCoder {
527527
Helper for NSArray/NSDictionary to dereference and decode an array of objects
528528
*/
529529
internal func _decodeArrayOfObjectsForKey(_ key: String,
530-
@noescape withBlock block: (Any) -> Void) throws {
530+
withBlock block: @noescape (Any) -> Void) throws {
531531
let objectRefs : Array<Any>? = _decodeValue(forKey: key)
532532

533533
guard let unwrappedObjectRefs = objectRefs else {

Foundation/NSLock.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public class NSLock : NSObject, NSLocking {
5151
}
5252

5353
extension NSLock {
54-
internal func synchronized<T>(@noescape _ closure: () -> T) -> T {
54+
internal func synchronized<T>(_ closure: @noescape () -> T) -> T {
5555
self.lock()
5656
defer { self.unlock() }
5757
return closure()

Foundation/NSOperation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ internal struct _OperationList {
279279
return all.count
280280
}
281281

282-
func map<T>(@noescape _ transform: (NSOperation) throws -> T) rethrows -> [T] {
282+
func map<T>(_ transform: @noescape (NSOperation) throws -> T) rethrows -> [T] {
283283
return try all.map(transform)
284284
}
285285
}

Foundation/NSSwiftRuntime.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ extension Unmanaged {
360360
}
361361

362362
extension Array {
363-
internal mutating func withUnsafeMutablePointerOrAllocation<R>(_ count: Int, fastpath: UnsafeMutablePointer<Element>? = nil, @noescape body: (UnsafeMutablePointer<Element>) -> R) -> R {
363+
internal mutating func withUnsafeMutablePointerOrAllocation<R>(_ count: Int, fastpath: UnsafeMutablePointer<Element>? = nil, body: @noescape (UnsafeMutablePointer<Element>) -> R) -> R {
364364
if let fastpath = fastpath {
365365
return body(fastpath)
366366
} else if self.count > count {

Foundation/String.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ extension String {
112112
/// memory referred to by `index`
113113
func _withOptionalOutParameter<Result>(
114114
_ index: UnsafeMutablePointer<Index>?,
115-
@noescape body: (UnsafeMutablePointer<Int>?) -> Result
115+
body: @noescape (UnsafeMutablePointer<Int>?) -> Result
116116
) -> Result {
117117
var utf16Index: Int = 0
118118
let result = (index != nil) ? body(&utf16Index) : body(nil)
@@ -125,7 +125,7 @@ extension String {
125125
/// it into the memory referred to by `range`
126126
func _withOptionalOutParameter<Result>(
127127
_ range: UnsafeMutablePointer<Range<Index>>?,
128-
@noescape body: (UnsafeMutablePointer<NSRange>?) -> Result
128+
body: @noescape (UnsafeMutablePointer<NSRange>?) -> Result
129129
) -> Result {
130130
var nsRange = NSRange(location: 0, length: 0)
131131
let result = (range != nil) ? body(&nsRange) : body(nil)

TestFoundation/TestNSFileManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class TestNSFileManger : XCTestCase {
3131
]
3232
}
3333

34-
func ignoreError(@noescape _ block: () throws -> Void) {
34+
func ignoreError(_ block: @noescape () throws -> Void) {
3535
do { try block() } catch { }
3636
}
3737

0 commit comments

Comments
 (0)