Skip to content

Commit 88d227e

Browse files
authored
Merge pull request #3710 from jckarter/turn-on-id-as-any
Turn on id as any
2 parents 1e1f58d + 3d0864d commit 88d227e

26 files changed

+105
-217
lines changed

Darwin/Foundation-swiftoverlay/AffineTransform.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,6 @@ extension AffineTransform : ReferenceConvertible, Hashable, CustomStringConverti
264264
}
265265

266266
extension AffineTransform : _ObjectiveCBridgeable {
267-
public static func _isBridgedToObjectiveC() -> Bool {
268-
return true
269-
}
270-
271267
public static func _getObjectiveCType() -> Any.Type {
272268
return NSAffineTransform.self
273269
}

Darwin/Foundation-swiftoverlay/Boxing.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ internal protocol _SwiftNativeFoundationType : class {
7575
init(unmanagedImmutableObject: Unmanaged<ImmutableType>)
7676
init(unmanagedMutableObject: Unmanaged<MutableType>)
7777

78-
func mutableCopy(with zone : NSZone) -> AnyObject
78+
func mutableCopy(with zone : NSZone?) -> Any
7979

8080
var hashValue: Int { get }
8181
var description: String { get }
@@ -115,7 +115,7 @@ extension _SwiftNativeFoundationType {
115115
}
116116
}
117117

118-
func mutableCopy(with zone : NSZone) -> AnyObject {
118+
func mutableCopy(with zone : NSZone?) -> Any {
119119
return _mapUnmanaged { $0.mutableCopy() }
120120
}
121121

Darwin/Foundation-swiftoverlay/Calendar.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public struct Calendar : CustomStringConvertible, CustomDebugStringConvertible,
107107
///
108108
/// - parameter identifier: The kind of calendar to use.
109109
public init(identifier: Identifier) {
110-
let result = __NSCalendarInit(Calendar._toNSCalendarIdentifier(identifier))!
110+
let result = __NSCalendarInit(Calendar._toNSCalendarIdentifier(identifier).rawValue as NSString)!
111111
_handle = _MutableHandle(adoptingReference: result)
112112
_autoupdating = false
113113
}
@@ -1082,10 +1082,6 @@ public struct Calendar : CustomStringConvertible, CustomDebugStringConvertible,
10821082
}
10831083

10841084
extension Calendar : _ObjectiveCBridgeable {
1085-
public static func _isBridgedToObjectiveC() -> Bool {
1086-
return true
1087-
}
1088-
10891085
@_semantics("convertToObjectiveC")
10901086
public func _bridgeToObjectiveC() -> NSCalendar {
10911087
return _handle._copiedReference()

Darwin/Foundation-swiftoverlay/CharacterSet.swift

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ internal final class _SwiftNSCharacterSet : _SwiftNativeNSCharacterSet, _SwiftNa
5151
}
5252

5353
@objc(copyWithZone:)
54-
func copy(with zone: NSZone? = nil) -> AnyObject {
54+
func copy(with zone: NSZone? = nil) -> Any {
5555
return _mapUnmanaged { $0.copy(with: zone) }
5656
}
5757

5858
@objc(mutableCopyWithZone:)
59-
func mutableCopy(with zone: NSZone? = nil) -> AnyObject {
59+
func mutableCopy(with zone: NSZone? = nil) -> Any {
6060
return _mapUnmanaged { $0.mutableCopy(with: zone) }
6161
}
6262

@@ -84,7 +84,7 @@ public struct CharacterSet : ReferenceConvertible, Equatable, Hashable, SetAlgeb
8484

8585
private init(_bridged characterSet: NSCharacterSet) {
8686
// We must copy the input because it might be mutable; just like storing a value type in ObjC
87-
_wrapped = _SwiftNSCharacterSet(immutableObject: characterSet.copy())
87+
_wrapped = _SwiftNSCharacterSet(immutableObject: characterSet.copy() as AnyObject)
8888
}
8989

9090
/// Initialize an empty instance.
@@ -439,10 +439,6 @@ public struct CharacterSet : ReferenceConvertible, Equatable, Hashable, SetAlgeb
439439

440440
// MARK: Objective-C Bridging
441441
extension CharacterSet : _ObjectiveCBridgeable {
442-
public static func _isBridgedToObjectiveC() -> Bool {
443-
return true
444-
}
445-
446442
public static func _getObjectiveCType() -> Any.Type {
447443
return NSCharacterSet.self
448444
}

Darwin/Foundation-swiftoverlay/Data.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ public struct Data : ReferenceConvertible, CustomStringConvertible, Equatable, H
253253
///
254254
/// - parameter reference: The instance of `NSData` that you wish to wrap. This instance will be copied by `struct Data`.
255255
public init(referencing reference: NSData) {
256-
_wrapped = _SwiftNSData(immutableObject: reference.copy())
256+
_wrapped = _SwiftNSData(immutableObject: reference.copy() as AnyObject)
257257
}
258258

259259
// -----------------------------------
@@ -678,10 +678,6 @@ public struct Data : ReferenceConvertible, CustomStringConvertible, Equatable, H
678678

679679
/// Provides bridging functionality for struct Data to class NSData and vice-versa.
680680
extension Data : _ObjectiveCBridgeable {
681-
public static func _isBridgedToObjectiveC() -> Bool {
682-
return true
683-
}
684-
685681
@_semantics("convertToObjectiveC")
686682
public func _bridgeToObjectiveC() -> NSData {
687683
return unsafeBitCast(_wrapped, to: NSData.self)

Darwin/Foundation-swiftoverlay/Date.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,6 @@ public struct Date : ReferenceConvertible, Comparable, Equatable, CustomStringCo
229229
}
230230

231231
extension Date : _ObjectiveCBridgeable {
232-
public static func _isBridgedToObjectiveC() -> Bool {
233-
return true
234-
}
235-
236232
@_semantics("convertToObjectiveC")
237233
public func _bridgeToObjectiveC() -> NSDate {
238234
return NSDate(timeIntervalSinceReferenceDate: _time)

Darwin/Foundation-swiftoverlay/DateComponents.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,10 +292,6 @@ public struct DateComponents : ReferenceConvertible, Hashable, Equatable, _Mutab
292292
// MARK: - Bridging
293293

294294
extension DateComponents : _ObjectiveCBridgeable {
295-
public static func _isBridgedToObjectiveC() -> Bool {
296-
return true
297-
}
298-
299295
public static func _getObjectiveCType() -> Any.Type {
300296
return NSDateComponents.self
301297
}

Darwin/Foundation-swiftoverlay/DateInterval.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,6 @@ public struct DateInterval : ReferenceConvertible, Comparable, Hashable {
183183

184184
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
185185
extension DateInterval : _ObjectiveCBridgeable {
186-
public static func _isBridgedToObjectiveC() -> Bool {
187-
return true
188-
}
189-
190186
public static func _getObjectiveCType() -> Any.Type {
191187
return NSDateInterval.self
192188
}

Darwin/Foundation-swiftoverlay/Decimal.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -436,10 +436,6 @@ extension Decimal : CustomStringConvertible {
436436
}
437437

438438
extension Decimal : _ObjectiveCBridgeable {
439-
public static func _isBridgedToObjectiveC() -> Bool {
440-
return true
441-
}
442-
443439
@_semantics("convertToObjectiveC")
444440
public func _bridgeToObjectiveC() -> NSDecimalNumber {
445441
return NSDecimalNumber(decimal: self)

Darwin/Foundation-swiftoverlay/FileManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ extension FileManager {
4040
@available(OSX 10.6, iOS 4.0, *)
4141
public func replaceItemAt(_ originalItemURL: URL, withItemAt newItemURL: URL, backupItemName: String? = nil, options: FileManager.ItemReplacementOptions = []) throws -> NSURL? {
4242
var error: NSError? = nil
43-
if let result = NS_Swift_NSFileManager_replaceItemAtURL_withItemAtURL_backupItemName_options(self, originalItemURL as URL, newItemURL as URL, backupItemName, options, &error) {
43+
if let result = NS_Swift_NSFileManager_replaceItemAtURL_withItemAtURL_backupItemName_options(self, originalItemURL as NSURL, newItemURL as NSURL, backupItemName, options, &error) {
4444
return result
4545
}
4646
throw error!

0 commit comments

Comments
 (0)