Skip to content

Commit f29615b

Browse files
committed
[Foundation] Add migration hints for deprecated NSNumber based initializers
1 parent 77a6661 commit f29615b

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

stdlib/public/SDK/Foundation/NSNumber.swift

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import CoreGraphics
1515

1616
extension Int8 : _ObjectiveCBridgeable {
17-
@available(swift, deprecated: 4)
17+
@available(swift, deprecated: 4, renamed: "init(truncating:)")
1818
public init(_ number: NSNumber) {
1919
self = number.int8Value
2020
}
@@ -55,7 +55,7 @@ extension Int8 : _ObjectiveCBridgeable {
5555
}
5656

5757
extension UInt8 : _ObjectiveCBridgeable {
58-
@available(swift, deprecated: 4)
58+
@available(swift, deprecated: 4, renamed: "init(truncating:)")
5959
public init(_ number: NSNumber) {
6060
self = number.uint8Value
6161
}
@@ -96,7 +96,7 @@ extension UInt8 : _ObjectiveCBridgeable {
9696
}
9797

9898
extension Int16 : _ObjectiveCBridgeable {
99-
@available(swift, deprecated: 4)
99+
@available(swift, deprecated: 4, renamed: "init(truncating:)")
100100
public init(_ number: NSNumber) {
101101
self = number.int16Value
102102
}
@@ -137,7 +137,7 @@ extension Int16 : _ObjectiveCBridgeable {
137137
}
138138

139139
extension UInt16 : _ObjectiveCBridgeable {
140-
@available(swift, deprecated: 4)
140+
@available(swift, deprecated: 4, renamed: "init(truncating:)")
141141
public init(_ number: NSNumber) {
142142
self = number.uint16Value
143143
}
@@ -178,7 +178,7 @@ extension UInt16 : _ObjectiveCBridgeable {
178178
}
179179

180180
extension Int32 : _ObjectiveCBridgeable {
181-
@available(swift, deprecated: 4)
181+
@available(swift, deprecated: 4, renamed: "init(truncating:)")
182182
public init(_ number: NSNumber) {
183183
self = number.int32Value
184184
}
@@ -219,7 +219,7 @@ extension Int32 : _ObjectiveCBridgeable {
219219
}
220220

221221
extension UInt32 : _ObjectiveCBridgeable {
222-
@available(swift, deprecated: 4)
222+
@available(swift, deprecated: 4, renamed: "init(truncating:)")
223223
public init(_ number: NSNumber) {
224224
self = number.uint32Value
225225
}
@@ -260,7 +260,7 @@ extension UInt32 : _ObjectiveCBridgeable {
260260
}
261261

262262
extension Int64 : _ObjectiveCBridgeable {
263-
@available(swift, deprecated: 4)
263+
@available(swift, deprecated: 4, renamed: "init(truncating:)")
264264
public init(_ number: NSNumber) {
265265
self = number.int64Value
266266
}
@@ -301,7 +301,7 @@ extension Int64 : _ObjectiveCBridgeable {
301301
}
302302

303303
extension UInt64 : _ObjectiveCBridgeable {
304-
@available(swift, deprecated: 4)
304+
@available(swift, deprecated: 4, renamed: "init(truncating:)")
305305
public init(_ number: NSNumber) {
306306
self = number.uint64Value
307307
}
@@ -342,7 +342,7 @@ extension UInt64 : _ObjectiveCBridgeable {
342342
}
343343

344344
extension Int : _ObjectiveCBridgeable {
345-
@available(swift, deprecated: 4)
345+
@available(swift, deprecated: 4, renamed: "init(truncating:)")
346346
public init(_ number: NSNumber) {
347347
self = number.intValue
348348
}
@@ -383,7 +383,7 @@ extension Int : _ObjectiveCBridgeable {
383383
}
384384

385385
extension UInt : _ObjectiveCBridgeable {
386-
@available(swift, deprecated: 4)
386+
@available(swift, deprecated: 4, renamed: "init(truncating:)")
387387
public init(_ number: NSNumber) {
388388
self = number.uintValue
389389
}
@@ -424,7 +424,7 @@ extension UInt : _ObjectiveCBridgeable {
424424
}
425425

426426
extension Float : _ObjectiveCBridgeable {
427-
@available(swift, deprecated: 4)
427+
@available(swift, deprecated: 4, renamed: "init(truncating:)")
428428
public init(_ number: NSNumber) {
429429
self = number.floatValue
430430
}
@@ -465,7 +465,7 @@ extension Float : _ObjectiveCBridgeable {
465465
}
466466

467467
extension Double : _ObjectiveCBridgeable {
468-
@available(swift, deprecated: 4)
468+
@available(swift, deprecated: 4, renamed: "init(truncating:)")
469469
public init(_ number: NSNumber) {
470470
self = number.doubleValue
471471
}
@@ -513,7 +513,7 @@ extension Double : _ObjectiveCBridgeable {
513513
}
514514

515515
extension Bool : _ObjectiveCBridgeable {
516-
@available(swift, deprecated: 4)
516+
@available(swift, deprecated: 4, renamed: "init(truncating:)")
517517
public init(_ number: NSNumber) {
518518
self = number.boolValue
519519
}
@@ -564,7 +564,7 @@ extension Bool : _ObjectiveCBridgeable {
564564
}
565565

566566
extension CGFloat : _ObjectiveCBridgeable {
567-
@available(swift, deprecated: 4)
567+
@available(swift, deprecated: 4, renamed: "init(truncating:)")
568568
public init(_ number: NSNumber) {
569569
native = CGFloat.NativeType(truncating: number)
570570
}

0 commit comments

Comments
 (0)