mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Karoly removed the last use of _convertStringToNSString in f2a96496a;
the replacement is referenced by the runtime but not by the compiler.
Doug had removed all the others from the stdlib in d92ae7707.
rdar://problem/35230338
113 lines
2.4 KiB
Swift
113 lines
2.4 KiB
Swift
// This is an overlay Swift module.
|
|
@_exported import Foundation
|
|
|
|
@_exported import ObjectiveC
|
|
|
|
extension String : _ObjectiveCBridgeable {
|
|
public func _bridgeToObjectiveC() -> NSString {
|
|
return NSString()
|
|
}
|
|
public static func _forceBridgeFromObjectiveC(
|
|
_ x: NSString,
|
|
result: inout String?
|
|
) {
|
|
}
|
|
public static func _conditionallyBridgeFromObjectiveC(
|
|
_ x: NSString,
|
|
result: inout String?
|
|
) -> Bool {
|
|
return true
|
|
}
|
|
public static func _unconditionallyBridgeFromObjectiveC(
|
|
_ x: NSString?
|
|
) -> String {
|
|
return String()
|
|
}
|
|
}
|
|
|
|
extension Array : _ObjectiveCBridgeable {
|
|
public func _bridgeToObjectiveC() -> NSArray {
|
|
return NSArray()
|
|
}
|
|
public static func _forceBridgeFromObjectiveC(
|
|
_ x: NSArray,
|
|
result: inout Array?
|
|
) {
|
|
}
|
|
public static func _conditionallyBridgeFromObjectiveC(
|
|
_ x: NSArray,
|
|
result: inout Array?
|
|
) -> Bool {
|
|
return true
|
|
}
|
|
public static func _unconditionallyBridgeFromObjectiveC(
|
|
_ x: NSArray?
|
|
) -> Array {
|
|
return Array()
|
|
}
|
|
}
|
|
|
|
extension Dictionary : _ObjectiveCBridgeable {
|
|
public func _bridgeToObjectiveC() -> NSDictionary {
|
|
return NSDictionary()
|
|
}
|
|
public static func _forceBridgeFromObjectiveC(
|
|
_ x: NSDictionary,
|
|
result: inout Dictionary?
|
|
) {
|
|
}
|
|
public static func _conditionallyBridgeFromObjectiveC(
|
|
_ x: NSDictionary,
|
|
result: inout Dictionary?
|
|
) -> Bool {
|
|
return true
|
|
}
|
|
public static func _unconditionallyBridgeFromObjectiveC(
|
|
_ x: NSDictionary?
|
|
) -> Dictionary {
|
|
return Dictionary()
|
|
}
|
|
}
|
|
|
|
extension Set : _ObjectiveCBridgeable {
|
|
public func _bridgeToObjectiveC() -> NSSet {
|
|
return NSSet()
|
|
}
|
|
public static func _forceBridgeFromObjectiveC(
|
|
_ x: NSSet,
|
|
result: inout Set?
|
|
) {
|
|
}
|
|
public static func _conditionallyBridgeFromObjectiveC(
|
|
_ x: NSSet,
|
|
result: inout Set?
|
|
) -> Bool {
|
|
return true
|
|
}
|
|
public static func _unconditionallyBridgeFromObjectiveC(
|
|
_ x: NSSet?
|
|
) -> Set {
|
|
return Set()
|
|
}
|
|
}
|
|
|
|
extension NSError: Error {
|
|
public var _domain: String { return domain }
|
|
public var _code: Int { return code }
|
|
}
|
|
|
|
public enum _GenericObjCError : Error {
|
|
case nilError
|
|
}
|
|
|
|
public func _convertNSErrorToError(_ error: NSError?) -> Error {
|
|
if let error = error {
|
|
return error
|
|
}
|
|
return _GenericObjCError.nilError
|
|
}
|
|
|
|
public func _convertErrorToNSError(_ error: Error) -> NSError {
|
|
return error as NSError
|
|
}
|