Skip to content

Commit b285f45

Browse files
xwuparkera
authored andcommitted
Fixing a typo in internal bridging protocol names (NFC) (#605)
* Fix a typo ("bridgeable" not "bridgable") * Fix another typo (comments)
1 parent 3ec8dfb commit b285f45

17 files changed

+50
-50
lines changed

Foundation/Bridging.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public protocol _ObjectTypeBridgeable : _ObjectBridgeable {
3333
static func _unconditionallyBridgeFromObjectiveC(_ source: _ObjectType?) -> Self
3434
}
3535

36-
/// - Note: This does not exist currently on Darwin but it is the inverse corrilation to the bridge types such that a
36+
/// - Note: This does not exist currently on Darwin but it is the inverse correlation to the bridge types such that a
3737
/// reference type can be converted via a callout to a conversion method.
3838
public protocol _StructTypeBridgeable : _StructBridgeable {
3939
associatedtype _StructType
@@ -55,17 +55,17 @@ extension _StructTypeBridgeable {
5555
}
5656

5757
// slated for removal, these are the swift-corelibs-only variant of the _ObjectiveCBridgeable
58-
internal protocol _CFBridgable {
58+
internal protocol _CFBridgeable {
5959
associatedtype CFType
6060
var _cfObject: CFType { get }
6161
}
6262

63-
internal protocol _SwiftBridgable {
63+
internal protocol _SwiftBridgeable {
6464
associatedtype SwiftType
6565
var _swiftObject: SwiftType { get }
6666
}
6767

68-
internal protocol _NSBridgable {
68+
internal protocol _NSBridgeable {
6969
associatedtype NSType
7070
var _nsObject: NSType { get }
7171
}

Foundation/NSArray.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ open class NSArray : NSObject, NSCopying, NSMutableCopying, NSSecureCoding, NSCo
589589
}
590590
}
591591

592-
extension NSArray : _CFBridgable, _SwiftBridgable {
592+
extension NSArray : _CFBridgeable, _SwiftBridgeable {
593593
internal var _cfObject: CFArray { return unsafeBitCast(self, to: CFArray.self) }
594594
internal var _swiftObject: [AnyObject] { return Array._unconditionallyBridgeFromObjectiveC(self) }
595595
}
@@ -598,15 +598,15 @@ extension NSMutableArray {
598598
internal var _cfMutableObject: CFMutableArray { return unsafeBitCast(self, to: CFMutableArray.self) }
599599
}
600600

601-
extension CFArray : _NSBridgable, _SwiftBridgable {
601+
extension CFArray : _NSBridgeable, _SwiftBridgeable {
602602
internal var _nsObject: NSArray { return unsafeBitCast(self, to: NSArray.self) }
603603
internal var _swiftObject: Array<Any> { return _nsObject._swiftObject }
604604
}
605605

606606
extension CFArray {
607607
/// Bridge something returned from CF to an Array<T>. Useful when we already know that a CFArray contains objects that are toll-free bridged with Swift objects, e.g. CFArray<CFURLRef>.
608608
/// - Note: This bridging operation is unfortunately still O(n), but it only traverses the NSArray once, creating the Swift array and casting at the same time.
609-
func _unsafeTypedBridge<T : _CFBridgable>() -> Array<T> {
609+
func _unsafeTypedBridge<T : _CFBridgeable>() -> Array<T> {
610610
var result = Array<T>()
611611
let count = CFArrayGetCount(self)
612612
result.reserveCapacity(count)
@@ -617,7 +617,7 @@ extension CFArray {
617617
}
618618
}
619619

620-
extension Array : _NSBridgable, _CFBridgable {
620+
extension Array : _NSBridgeable, _CFBridgeable {
621621
internal var _nsObject: NSArray { return _bridgeToObjectiveC() }
622622
internal var _cfObject: CFArray { return _nsObject._cfObject }
623623
}

Foundation/NSAttributedString.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ private extension NSAttributedString {
186186
}
187187
}
188188

189-
extension NSAttributedString: _CFBridgable {
189+
extension NSAttributedString: _CFBridgeable {
190190
internal var _cfObject: CFAttributedString { return unsafeBitCast(self, to: CFAttributedString.self) }
191191
}
192192

Foundation/NSCalendar.swift

+5-5
Original file line numberDiff line numberDiff line change
@@ -1822,28 +1822,28 @@ open class NSDateComponents : NSObject, NSCopying, NSSecureCoding {
18221822
}
18231823
}
18241824

1825-
extension NSDateComponents : _SwiftBridgable {
1825+
extension NSDateComponents : _SwiftBridgeable {
18261826
typealias SwiftType = DateComponents
18271827
var _swiftObject: SwiftType { return DateComponents(reference: self) }
18281828
}
18291829

1830-
extension DateComponents : _NSBridgable {
1830+
extension DateComponents : _NSBridgeable {
18311831
typealias NSType = NSDateComponents
18321832
var _nsObject: NSType { return _bridgeToObjectiveC() }
18331833
}
18341834

1835-
extension NSCalendar: _SwiftBridgable, _CFBridgable {
1835+
extension NSCalendar: _SwiftBridgeable, _CFBridgeable {
18361836
typealias SwiftType = Calendar
18371837
var _swiftObject: SwiftType { return Calendar(reference: self) }
18381838
}
1839-
extension Calendar: _NSBridgable, _CFBridgable {
1839+
extension Calendar: _NSBridgeable, _CFBridgeable {
18401840
typealias NSType = NSCalendar
18411841
typealias CFType = CFCalendar
18421842
var _nsObject: NSCalendar { return _bridgeToObjectiveC() }
18431843
var _cfObject: CFCalendar { return _nsObject._cfObject }
18441844
}
18451845

1846-
extension CFCalendar : _NSBridgable, _SwiftBridgable {
1846+
extension CFCalendar : _NSBridgeable, _SwiftBridgeable {
18471847
typealias NSType = NSCalendar
18481848
internal var _nsObject: NSType { return unsafeBitCast(self, to: NSType.self) }
18491849
internal var _swiftObject: Calendar { return _nsObject._swiftObject }

Foundation/NSCharacterSet.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ open class NSMutableCharacterSet : NSCharacterSet {
320320
}
321321
}
322322

323-
extension CharacterSet : _CFBridgable, _NSBridgable {
323+
extension CharacterSet : _CFBridgeable, _NSBridgeable {
324324
typealias CFType = CFCharacterSet
325325
typealias NSType = NSCharacterSet
326326
internal var _cfObject: CFType {
@@ -331,7 +331,7 @@ extension CharacterSet : _CFBridgable, _NSBridgable {
331331
}
332332
}
333333

334-
extension CFCharacterSet : _NSBridgable, _SwiftBridgable {
334+
extension CFCharacterSet : _NSBridgeable, _SwiftBridgeable {
335335
typealias NSType = NSCharacterSet
336336
typealias SwiftType = CharacterSet
337337
internal var _nsObject: NSType {
@@ -342,7 +342,7 @@ extension CFCharacterSet : _NSBridgable, _SwiftBridgable {
342342
}
343343
}
344344

345-
extension NSCharacterSet : _SwiftBridgable {
345+
extension NSCharacterSet : _SwiftBridgeable {
346346
typealias SwiftType = CharacterSet
347347
internal var _swiftObject: SwiftType {
348348
return CharacterSet(_bridged: self)

Foundation/NSData.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -847,19 +847,19 @@ open class NSData : NSObject, NSCopying, NSMutableCopying, NSSecureCoding {
847847
}
848848

849849
// MARK: -
850-
extension NSData : _CFBridgable, _SwiftBridgable {
850+
extension NSData : _CFBridgeable, _SwiftBridgeable {
851851
typealias SwiftType = Data
852852
internal var _swiftObject: SwiftType { return Data(referencing: self) }
853853
}
854854

855-
extension Data : _NSBridgable, _CFBridgable {
855+
extension Data : _NSBridgeable, _CFBridgeable {
856856
typealias CFType = CFData
857857
typealias NSType = NSData
858858
internal var _cfObject: CFType { return _nsObject._cfObject }
859859
internal var _nsObject: NSType { return _bridgeToObjectiveC() }
860860
}
861861

862-
extension CFData : _NSBridgable, _SwiftBridgable {
862+
extension CFData : _NSBridgeable, _SwiftBridgeable {
863863
typealias NSType = NSData
864864
typealias SwiftType = Data
865865
internal var _nsObject: NSType { return unsafeBitCast(self, to: NSType.self) }

Foundation/NSDate.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -225,22 +225,22 @@ extension NSDate {
225225
}
226226
}
227227

228-
extension NSDate: _CFBridgable, _SwiftBridgable {
228+
extension NSDate: _CFBridgeable, _SwiftBridgeable {
229229
typealias SwiftType = Date
230230
var _swiftObject: Date {
231231
return Date(timeIntervalSinceReferenceDate: timeIntervalSinceReferenceDate)
232232
}
233233
}
234234

235-
extension CFDate : _NSBridgable, _SwiftBridgable {
235+
extension CFDate : _NSBridgeable, _SwiftBridgeable {
236236
typealias NSType = NSDate
237237
typealias SwiftType = Date
238238

239239
internal var _nsObject: NSType { return unsafeBitCast(self, to: NSType.self) }
240240
internal var _swiftObject: Date { return _nsObject._swiftObject }
241241
}
242242

243-
extension Date : _NSBridgable, _CFBridgable {
243+
extension Date : _NSBridgeable, _CFBridgeable {
244244
typealias NSType = NSDate
245245
typealias CFType = CFDate
246246

Foundation/NSDictionary.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ open class NSDictionary : NSObject, NSCopying, NSMutableCopying, NSSecureCoding,
466466
}
467467
}
468468

469-
extension NSDictionary : _CFBridgable, _SwiftBridgable {
469+
extension NSDictionary : _CFBridgeable, _SwiftBridgeable {
470470
internal var _cfObject: CFDictionary { return unsafeBitCast(self, to: CFDictionary.self) }
471471
internal var _swiftObject: Dictionary<AnyHashable, Any> { return Dictionary._unconditionallyBridgeFromObjectiveC(self) }
472472
}
@@ -475,12 +475,12 @@ extension NSMutableDictionary {
475475
internal var _cfMutableObject: CFMutableDictionary { return unsafeBitCast(self, to: CFMutableDictionary.self) }
476476
}
477477

478-
extension CFDictionary : _NSBridgable, _SwiftBridgable {
478+
extension CFDictionary : _NSBridgeable, _SwiftBridgeable {
479479
internal var _nsObject: NSDictionary { return unsafeBitCast(self, to: NSDictionary.self) }
480480
internal var _swiftObject: [AnyHashable: Any] { return _nsObject._swiftObject }
481481
}
482482

483-
extension Dictionary : _NSBridgable, _CFBridgable {
483+
extension Dictionary : _NSBridgeable, _CFBridgeable {
484484
internal var _nsObject: NSDictionary { return _bridgeToObjectiveC() }
485485
internal var _cfObject: CFDictionary { return _nsObject._cfObject }
486486
}

Foundation/NSError.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ open class NSError : NSObject, NSCopying, NSSecureCoding, NSCoding {
197197

198198
extension NSError : Swift.Error { }
199199

200-
extension NSError : _CFBridgable { }
201-
extension CFError : _NSBridgable {
200+
extension NSError : _CFBridgeable { }
201+
extension CFError : _NSBridgeable {
202202
typealias NSType = NSError
203203
internal var _nsObject: NSType {
204204
let userInfo = CFErrorCopyUserInfo(self)._swiftObject

Foundation/NSKeyedArchiverHelpers.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import CoreFoundation
1111

12-
extension CFKeyedArchiverUID : _NSBridgable {
12+
extension CFKeyedArchiverUID : _NSBridgeable {
1313
typealias NSType = _NSKeyedArchiverUID
1414

1515
internal var _nsObject: NSType { return unsafeBitCast(self, to: NSType.self) }

Foundation/NSLocale.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ public func <(_ lhs: NSLocale.Key, _ rhs: NSLocale.Key) -> Bool {
251251
public let NSCurrentLocaleDidChangeNotification: String = "kCFLocaleCurrentLocaleDidChangeNotification"
252252

253253

254-
extension CFLocale : _NSBridgable, _SwiftBridgable {
254+
extension CFLocale : _NSBridgeable, _SwiftBridgeable {
255255
typealias NSType = NSLocale
256256
typealias SwiftType = Locale
257257
internal var _nsObject: NSLocale {
@@ -262,14 +262,14 @@ extension CFLocale : _NSBridgable, _SwiftBridgable {
262262
}
263263
}
264264

265-
extension NSLocale : _SwiftBridgable {
265+
extension NSLocale : _SwiftBridgeable {
266266
typealias SwiftType = Locale
267267
internal var _swiftObject: Locale {
268268
return Locale(reference: self)
269269
}
270270
}
271271

272-
extension Locale : _CFBridgable {
272+
extension Locale : _CFBridgeable {
273273
typealias CFType = CFLocale
274274
internal var _cfObject: CFLocale {
275275
return _bridgeToObjectiveC()._cfObject

Foundation/NSNumber.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ extension Bool : _ObjectTypeBridgeable {
184184
}
185185
}
186186

187-
extension Bool : _CFBridgable {
187+
extension Bool : _CFBridgeable {
188188
typealias CFType = CFBoolean
189189
var _cfObject: CFType {
190190
return self ? kCFBooleanTrue : kCFBooleanFalse
@@ -519,7 +519,7 @@ open class NSNumber : NSValue {
519519
}
520520
}
521521

522-
extension CFNumber : _NSBridgable {
522+
extension CFNumber : _NSBridgeable {
523523
typealias NSType = NSNumber
524524
internal var _nsObject: NSType { return unsafeBitCast(self, to: NSType.self) }
525525
}

Foundation/NSSet.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -288,17 +288,17 @@ extension NSSet {
288288
}
289289
}
290290

291-
extension NSSet : _CFBridgable, _SwiftBridgable {
291+
extension NSSet : _CFBridgeable, _SwiftBridgeable {
292292
internal var _cfObject: CFSet { return unsafeBitCast(self, to: CFSet.self) }
293293
internal var _swiftObject: Set<NSObject> { return Set._unconditionallyBridgeFromObjectiveC(self) }
294294
}
295295

296-
extension CFSet : _NSBridgable, _SwiftBridgable {
296+
extension CFSet : _NSBridgeable, _SwiftBridgeable {
297297
internal var _nsObject: NSSet { return unsafeBitCast(self, to: NSSet.self) }
298298
internal var _swiftObject: Set<NSObject> { return _nsObject._swiftObject }
299299
}
300300

301-
extension Set : _NSBridgable, _CFBridgable {
301+
extension Set : _NSBridgeable, _CFBridgeable {
302302
internal var _nsObject: NSSet { return _bridgeToObjectiveC() }
303303
internal var _cfObject: CFSet { return _nsObject._cfObject }
304304
}

Foundation/NSString.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,7 @@ extension String {
13941394
}
13951395
}
13961396

1397-
extension NSString : _CFBridgable, _SwiftBridgable {
1397+
extension NSString : _CFBridgeable, _SwiftBridgeable {
13981398
typealias SwiftType = String
13991399
internal var _cfObject: CFString { return unsafeBitCast(self, to: CFString.self) }
14001400
internal var _swiftObject: String { return String._unconditionallyBridgeFromObjectiveC(self) }
@@ -1404,14 +1404,14 @@ extension NSMutableString {
14041404
internal var _cfMutableObject: CFMutableString { return unsafeBitCast(self, to: CFMutableString.self) }
14051405
}
14061406

1407-
extension CFString : _NSBridgable, _SwiftBridgable {
1407+
extension CFString : _NSBridgeable, _SwiftBridgeable {
14081408
typealias NSType = NSString
14091409
typealias SwiftType = String
14101410
internal var _nsObject: NSType { return unsafeBitCast(self, to: NSString.self) }
14111411
internal var _swiftObject: String { return _nsObject._swiftObject }
14121412
}
14131413

1414-
extension String : _NSBridgable, _CFBridgable {
1414+
extension String : _NSBridgeable, _CFBridgeable {
14151415
typealias NSType = NSString
14161416
typealias CFType = CFString
14171417
internal var _nsObject: NSType { return _bridgeToObjectiveC() }

Foundation/NSTimeZone.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -262,18 +262,18 @@ extension NSTimeZone {
262262

263263
}
264264

265-
extension NSTimeZone: _SwiftBridgable, _CFBridgable {
265+
extension NSTimeZone: _SwiftBridgeable, _CFBridgeable {
266266
typealias SwiftType = TimeZone
267267
var _swiftObject: TimeZone { return TimeZone(reference: self) }
268268
}
269269

270-
extension CFTimeZone : _SwiftBridgable, _NSBridgable {
270+
extension CFTimeZone : _SwiftBridgeable, _NSBridgeable {
271271
typealias NSType = NSTimeZone
272272
var _nsObject : NSTimeZone { return unsafeBitCast(self, to: NSTimeZone.self) }
273273
var _swiftObject: TimeZone { return _nsObject._swiftObject }
274274
}
275275

276-
extension TimeZone : _NSBridgable, _CFBridgable {
276+
extension TimeZone : _NSBridgeable, _CFBridgeable {
277277
typealias NSType = NSTimeZone
278278
typealias CFType = CFTimeZone
279279
var _nsObject : NSTimeZone { return _bridgeToObjectiveC() }

Foundation/NSURL.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -1255,19 +1255,19 @@ open class NSURLComponents: NSObject, NSCopying {
12551255
}
12561256
}
12571257

1258-
extension NSURL: _CFBridgable, _SwiftBridgable {
1258+
extension NSURL: _CFBridgeable, _SwiftBridgeable {
12591259
typealias SwiftType = URL
12601260
internal var _swiftObject: SwiftType { return URL(reference: self) }
12611261
}
12621262

1263-
extension CFURL : _NSBridgable, _SwiftBridgable {
1263+
extension CFURL : _NSBridgeable, _SwiftBridgeable {
12641264
typealias NSType = NSURL
12651265
typealias SwiftType = URL
12661266
internal var _nsObject: NSType { return unsafeBitCast(self, to: NSType.self) }
12671267
internal var _swiftObject: SwiftType { return _nsObject._swiftObject }
12681268
}
12691269

1270-
extension URL : _NSBridgable, _CFBridgable {
1270+
extension URL : _NSBridgeable, _CFBridgeable {
12711271
typealias NSType = NSURL
12721272
typealias CFType = CFURL
12731273
internal var _nsObject: NSType { return self.reference }

Foundation/URLComponents.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -377,22 +377,22 @@ extension URLQueryItem : CustomStringConvertible, CustomDebugStringConvertible,
377377
}
378378
}
379379

380-
extension NSURLComponents : _SwiftBridgable {
380+
extension NSURLComponents : _SwiftBridgeable {
381381
typealias SwiftType = URLComponents
382382
internal var _swiftObject: SwiftType { return URLComponents(reference: self) }
383383
}
384384

385-
extension URLComponents : _NSBridgable {
385+
extension URLComponents : _NSBridgeable {
386386
typealias NSType = NSURLComponents
387387
internal var _nsObject: NSType { return _handle._copiedReference() }
388388
}
389389

390-
extension NSURLQueryItem : _SwiftBridgable {
390+
extension NSURLQueryItem : _SwiftBridgeable {
391391
typealias SwiftType = URLQueryItem
392392
internal var _swiftObject: SwiftType { return URLQueryItem(reference: self) }
393393
}
394394

395-
extension URLQueryItem : _NSBridgable {
395+
extension URLQueryItem : _NSBridgeable {
396396
typealias NSType = NSURLQueryItem
397397
internal var _nsObject: NSType { return _queryItem }
398398
}

0 commit comments

Comments
 (0)