Skip to content

fix warnings for SE-0049 (Move @noescape ...) #326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Foundation/NSKeyedUnarchiver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ public class NSKeyedUnarchiver : NSCoder {
Helper for NSArray/NSDictionary to dereference and decode an array of objects
*/
internal func _decodeArrayOfObjectsForKey(_ key: String,
@noescape withBlock block: (Any) -> Void) throws {
withBlock block: @noescape (Any) -> Void) throws {
let objectRefs : Array<Any>? = _decodeValue(forKey: key)

guard let unwrappedObjectRefs = objectRefs else {
Expand Down
2 changes: 1 addition & 1 deletion Foundation/NSLock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class NSLock : NSObject, NSLocking {
}

extension NSLock {
internal func synchronized<T>(@noescape _ closure: () -> T) -> T {
internal func synchronized<T>(_ closure: @noescape () -> T) -> T {
self.lock()
defer { self.unlock() }
return closure()
Expand Down
2 changes: 1 addition & 1 deletion Foundation/NSOperation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ internal struct _OperationList {
return all.count
}

func map<T>(@noescape _ transform: (NSOperation) throws -> T) rethrows -> [T] {
func map<T>(_ transform: @noescape (NSOperation) throws -> T) rethrows -> [T] {
return try all.map(transform)
}
}
Expand Down
2 changes: 1 addition & 1 deletion Foundation/NSSwiftRuntime.swift
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ extension Unmanaged {
}

extension Array {
internal mutating func withUnsafeMutablePointerOrAllocation<R>(_ count: Int, fastpath: UnsafeMutablePointer<Element>? = nil, @noescape body: (UnsafeMutablePointer<Element>) -> R) -> R {
internal mutating func withUnsafeMutablePointerOrAllocation<R>(_ count: Int, fastpath: UnsafeMutablePointer<Element>? = nil, body: @noescape (UnsafeMutablePointer<Element>) -> R) -> R {
if let fastpath = fastpath {
return body(fastpath)
} else if self.count > count {
Expand Down
4 changes: 2 additions & 2 deletions Foundation/String.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ extension String {
/// memory referred to by `index`
func _withOptionalOutParameter<Result>(
_ index: UnsafeMutablePointer<Index>?,
@noescape body: (UnsafeMutablePointer<Int>?) -> Result
body: @noescape (UnsafeMutablePointer<Int>?) -> Result
) -> Result {
var utf16Index: Int = 0
let result = (index != nil) ? body(&utf16Index) : body(nil)
Expand All @@ -125,7 +125,7 @@ extension String {
/// it into the memory referred to by `range`
func _withOptionalOutParameter<Result>(
_ range: UnsafeMutablePointer<Range<Index>>?,
@noescape body: (UnsafeMutablePointer<NSRange>?) -> Result
body: @noescape (UnsafeMutablePointer<NSRange>?) -> Result
) -> Result {
var nsRange = NSRange(location: 0, length: 0)
let result = (range != nil) ? body(&nsRange) : body(nil)
Expand Down
2 changes: 1 addition & 1 deletion TestFoundation/TestNSFileManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class TestNSFileManger : XCTestCase {
]
}

func ignoreError(@noescape _ block: () throws -> Void) {
func ignoreError(_ block: @noescape () throws -> Void) {
do { try block() } catch { }
}

Expand Down