Skip to content

Commit fe685b4

Browse files
authored
Merge pull request #446 from apple/nserror-bridging
Update for SE-0112: Rename ErrorProtocol to Error
2 parents 12ced8a + 1be9c15 commit fe685b4

File tree

9 files changed

+11
-11
lines changed

9 files changed

+11
-11
lines changed

Foundation/FoundationErrors.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
88
//
99

10-
public struct NSCocoaError : RawRepresentable, ErrorProtocol, __BridgedNSError {
10+
public struct NSCocoaError : RawRepresentable, Swift.Error, __BridgedNSError {
1111
public let rawValue: Int
1212
public init(rawValue: Int) {
1313
self.rawValue = rawValue

Foundation/IndexSet.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ public struct IndexSet : ReferenceConvertible, Equatable, BidirectionalCollectio
634634
public func filteredIndexSet(in range : Range<Element>? = nil, includeInteger: @noescape (Element) throws -> Bool) rethrows -> IndexSet {
635635
let r : NSRange = range != nil ? _toNSRange(range!) : NSMakeRange(0, NSNotFound - 1)
636636
return try _handle.map {
637-
var error : ErrorProtocol? = nil
637+
var error : Swift.Error? = nil
638638
let result = $0.indexes(in: r, options: [], passingTest: { (i, stop) -> Bool in
639639
do {
640640
let include = try includeInteger(i)

Foundation/NSData.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ extension NSData {
553553
}
554554

555555
internal func enumerateByteRangesUsingBlockRethrows(_ block: @noescape (UnsafePointer<Void>, NSRange, UnsafeMutablePointer<Bool>) throws -> Void) throws {
556-
var err : ErrorProtocol? = nil
556+
var err : Swift.Error? = nil
557557
self.enumerateBytes() { (buf, range, stop) -> Void in
558558
do {
559559
try block(buf, range, stop)

Foundation/NSError.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public class NSError : NSObject, NSCopying, NSSecureCoding, NSCoding {
165165
}
166166
}
167167

168-
extension NSError : ErrorProtocol { }
168+
extension NSError : Swift.Error { }
169169

170170
extension NSError : _CFBridgable { }
171171
extension CFError : _NSBridgable {
@@ -184,11 +184,11 @@ extension CFError : _NSBridgable {
184184
}
185185

186186

187-
public protocol _ObjectTypeBridgeableErrorType : ErrorProtocol {
187+
public protocol _ObjectTypeBridgeableErrorType : Swift.Error {
188188
init?(_bridgedNSError: NSError)
189189
}
190190

191-
public protocol __BridgedNSError : RawRepresentable, ErrorProtocol {
191+
public protocol __BridgedNSError : RawRepresentable, Swift.Error {
192192
static var __NSErrorDomain: String { get }
193193
}
194194

Foundation/NSUserDefaults.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public class UserDefaults: NSObject {
119119
}
120120
//This got out of hand fast...
121121
let cVal = bVal._swiftObject
122-
enum convErr: ErrorProtocol {
122+
enum convErr: Swift.Error {
123123
case convErr
124124
}
125125
do {

TestFoundation/TestNSRange.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,4 @@ class TestNSRange : XCTestCase {
6666
let swiftRange2 = range.toRange()
6767
XCTAssertEqual(swiftRange, swiftRange2)
6868
}
69-
}
69+
}

TestFoundation/TestNSString.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,7 @@ let comparisonTests = [
10631063
ComparisonTest("\u{0341}", "\u{0954}"),
10641064
]
10651065

1066-
enum Stack: ErrorProtocol {
1066+
enum Stack: Swift.Error {
10671067
case Stack([UInt])
10681068
}
10691069

TestFoundation/TestNSTask.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ private func mkstemp(template: String, body: @noescape (FileHandle) throws -> Vo
261261

262262
}
263263

264-
private enum Error: ErrorProtocol {
264+
private enum Error: Swift.Error {
265265
case TerminationStatus(Int32)
266266
case UnicodeDecodingError(Data)
267267
case InvalidEnvironmentVariable(String)

Tools/plutil/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ struct Options {
5959
var inputs = [String]()
6060
}
6161

62-
enum OptionParseError : ErrorProtocol {
62+
enum OptionParseError : Swift.Error {
6363
case UnrecognizedArgument(String)
6464
case MissingArgument(String)
6565
case InvalidFormat(String)

0 commit comments

Comments
 (0)