Skip to content

Commit 5fee5f4

Browse files
authored
Merge pull request #495 from apple/enable-se-0111
[SE-0111] Update for removal of argument labels from function types
2 parents 516bdbf + 2583bf9 commit 5fee5f4

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

Foundation/Data.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,12 +435,12 @@ public struct Data : ReferenceConvertible, CustomStringConvertible, Equatable, H
435435
///
436436
/// In some cases, (for example, a `Data` backed by a `dispatch_data_t`, the bytes may be stored discontiguously. In those cases, this function invokes the closure for each contiguous region of bytes.
437437
/// - parameter block: The closure to invoke for each region of data. You may stop the enumeration by setting the `stop` parameter to `true`.
438-
public func enumerateBytes(_ block: @noescape (buffer: UnsafeBufferPointer<UInt8>, byteIndex: Index, stop: inout Bool) -> Void) {
438+
public func enumerateBytes(_ block: @noescape (_ buffer: UnsafeBufferPointer<UInt8>, _ byteIndex: Index, _ stop: inout Bool) -> Void) {
439439
_mapUnmanaged {
440440
$0.enumerateBytes { (ptr, range, stop) in
441441
var stopv = false
442442
let bytePtr = ptr.bindMemory(to: UInt8.self, capacity: range.length)
443-
block(buffer: UnsafeBufferPointer(start: bytePtr, count: range.length), byteIndex: range.length, stop: &stopv)
443+
block(UnsafeBufferPointer(start: bytePtr, count: range.length), range.length, &stopv)
444444
if stopv {
445445
stop.pointee = true
446446
}

Foundation/NSData.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ extension NSData {
257257
internal struct NSDataReadResult {
258258
var bytes: UnsafeMutableRawPointer
259259
var length: Int
260-
var deallocator: ((buffer: UnsafeMutableRawPointer, length: Int) -> Void)?
260+
var deallocator: ((_ buffer: UnsafeMutableRawPointer, _ length: Int) -> Void)?
261261
}
262262

263263
internal static func readBytesFromFileWithExtendedAttributes(_ path: String, options: ReadingOptions) throws -> NSDataReadResult {

Foundation/NSError.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public class NSError : NSObject, NSCopying, NSSecureCoding, NSCoding {
153153
return userInfo[NSHelpAnchorErrorKey] as? String
154154
}
155155

156-
internal typealias NSErrorProvider = (error: NSError, key: String) -> AnyObject?
156+
internal typealias NSErrorProvider = (_ error: NSError, _ key: String) -> AnyObject?
157157
internal static var userInfoProviders = [String: NSErrorProvider]()
158158

159159
public class func setUserInfoValueProviderForDomain(_ errorDomain: String, provider: ((NSError, String) -> AnyObject?)?) {

Foundation/String.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -404,12 +404,12 @@ extension String {
404404
// enumerateLinesUsing:(void (^)(NSString *line, BOOL *stop))block
405405

406406
/// Enumerates all the lines in a string.
407-
public func enumerateLines(_ body: (line: String, stop: inout Bool) -> ()) {
407+
public func enumerateLines(_ body: (_ line: String, _ stop: inout Bool) -> ()) {
408408
_ns.enumerateLines {
409409
(line: String, stop: UnsafeMutablePointer<ObjCBool>)
410410
in
411411
var stop_ = false
412-
body(line: line, stop: &stop_)
412+
body(line, &stop_)
413413
if stop_ {
414414
UnsafeMutablePointer<ObjCBool>(stop).pointee = true
415415
}
@@ -434,16 +434,16 @@ extension String {
434434
in range: Range<Index>,
435435
options opts: EnumerationOptions = [],
436436
_ body: (
437-
substring: String?, substringRange: Range<Index>,
438-
enclosingRange: Range<Index>, inout Bool
437+
_ substring: String?, _ substringRange: Range<Index>,
438+
_ enclosingRange: Range<Index>, inout Bool
439439
) -> ()
440440
) {
441441
_ns.enumerateSubstrings(in: _toNSRange(range), options: opts) {
442442
var stop_ = false
443443

444-
body(substring: $0,
445-
substringRange: self._range($1),
446-
enclosingRange: self._range($2),
444+
body($0,
445+
self._range($1),
446+
self._range($2),
447447
&stop_)
448448

449449
if stop_ {
@@ -1554,8 +1554,8 @@ extension String {
15541554
_ range: Range<Index>,
15551555
options opts: EnumerationOptions = [],
15561556
_ body: (
1557-
substring: String?, substringRange: Range<Index>,
1558-
enclosingRange: Range<Index>, inout Bool
1557+
_ substring: String?, _ substringRange: Range<Index>,
1558+
_ enclosingRange: Range<Index>, inout Bool
15591559
) -> ()
15601560
) {
15611561
fatalError("unavailable function can't be called")

0 commit comments

Comments
 (0)