Skip to content

Remove 'public' from a few NSError-bridging-related symbols #14731

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
Mar 20, 2018
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
18 changes: 10 additions & 8 deletions stdlib/public/SDK/Foundation/NSError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,16 @@ public typealias NSErrorPointer = AutoreleasingUnsafeMutablePointer<NSError?>?
// Note: NSErrorPointer becomes ErrorPointer in Swift 3.
public typealias ErrorPointer = NSErrorPointer

public // COMPILER_INTRINSIC
let _nilObjCError: Error = _GenericObjCError.nilError
// An error value to use when an Objective-C API indicates error
// but produces a nil error object.
// This is 'internal' rather than 'private' for no other reason but to make the
// type print more nicely. It's not part of the ABI, so if type printing of
// private things improves we can change it.
internal enum _GenericObjCError : Error {
case nilError
}
// A cached instance of the above in order to save on the conversion to Error.
private let _nilObjCError: Error = _GenericObjCError.nilError

public // COMPILER_INTRINSIC
func _convertNSErrorToError(_ error: NSError?) -> Error {
Expand Down Expand Up @@ -335,12 +343,6 @@ extension CFError : Error {
}
}

// An error value to use when an Objective-C API indicates error
// but produces a nil error object.
public enum _GenericObjCError : Error {
case nilError
}

/// An internal protocol to represent Swift error enums that map to standard
/// Cocoa NSError domains.
public protocol _ObjectiveCBridgeableError : Error {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ extension NSError : Error {
public var _code: Int { return code }
}

public enum _GenericObjCError : Error {
internal enum _GenericObjCError : Error {
case nilError
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ extension NSError : Error {
public var _code: Int { return code }
}

public enum _GenericObjCError : Error {
internal enum _GenericObjCError : Error {
case nilError
}

Expand Down