Skip to content

Commit 2a5b9d6

Browse files
committed
Remove now-dead _isBridgedToObjectiveC() declarations in _ObjectiveCBridgeable conformers.
1 parent cd283b1 commit 2a5b9d6

26 files changed

+0
-200
lines changed

stdlib/public/core/BridgeObjectiveC.swift

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,6 @@ public protocol _ObjectiveCBridgeable {
8383
-> Self
8484
}
8585

86-
// FIXME(ABI): stub for unit testing purposes
87-
extension _ObjectiveCBridgeable {
88-
public static func _isBridgedToObjectiveC() -> Bool {
89-
return true
90-
}
91-
}
92-
9386
//===--- Bridging for metatypes -------------------------------------------===//
9487

9588
/// A stand-in for a value of metatype type.

stdlib/public/core/ImplicitlyUnwrappedOptional.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,6 @@ extension ImplicitlyUnwrappedOptional : _ObjectiveCBridgeable {
9595
return false
9696
}
9797

98-
public static func _isBridgedToObjectiveC() -> Bool {
99-
return Swift._isBridgedToObjectiveC(Wrapped.self)
100-
}
101-
10298
public static func _unconditionallyBridgeFromObjectiveC(_ source: AnyObject?)
10399
-> Wrapped! {
104100
var result: ImplicitlyUnwrappedOptional<Wrapped>?

test/1_stdlib/ArrayBridge.swift.gyb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,6 @@ struct BridgeableValue : _ObjectiveCBridgeable, Equatable {
8080
return Subclass(trak.value)
8181
}
8282

83-
static func _isBridgedToObjectiveC() -> Bool {
84-
return true
85-
}
86-
8783
static func _forceBridgeFromObjectiveC(
8884
_ x: Subclass,
8985
result: inout BridgeableValue?

test/1_stdlib/BridgeNonVerbatim.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ import ObjectiveC
2727
import StdlibUnittest
2828

2929
struct X : _ObjectiveCBridgeable {
30-
static func _isBridgedToObjectiveC() -> Bool {
31-
return true
32-
}
33-
3430
init(_ value: Int) {
3531
self.value = value
3632
}

test/1_stdlib/Bridgeable.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ func testBridging<T>(_ x: T, _ name: String) {
4040

4141
//===----------------------------------------------------------------------===//
4242
struct BridgedValueType : _ObjectiveCBridgeable {
43-
static func _isBridgedToObjectiveC() -> Bool {
44-
return true
45-
}
46-
4743
func _bridgeToObjectiveC() -> C {
4844
return C()
4945
}

test/1_stdlib/DebuggerSupport.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ struct DontBridgeThisStruct {
2727
extension DontBridgeThisStruct : _ObjectiveCBridgeable {
2828
typealias _ObjectiveCType = AnyObject
2929

30-
static func _isBridgedToObjectiveC() -> Bool { return true }
31-
3230
func _bridgeToObjectiveC() -> _ObjectiveCType {
3331
fatalError("tried to bridge DontBridgeThisStruct")
3432
}

test/1_stdlib/DictionaryTrapsObjC.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,6 @@ class TestObjCKeyTy : NSObject {
7878
}
7979

8080
struct TestBridgedKeyTy : Hashable, _ObjectiveCBridgeable {
81-
static func _isBridgedToObjectiveC() -> Bool {
82-
return true
83-
}
84-
8581
init(_ value: Int) { self.value = value }
8682

8783
var hashValue: Int { return value }

test/1_stdlib/Inputs/DictionaryKeyValueTypesObjC.swift

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,6 @@ struct TestBridgedKeyTy
258258
return _hashValue
259259
}
260260

261-
static func _isBridgedToObjectiveC() -> Bool {
262-
return true
263-
}
264-
265261
func _bridgeToObjectiveC() -> TestObjCKeyTy {
266262
_bridgedKeyBridgeOperations.fetchAndAdd(1)
267263
return TestObjCKeyTy(value)
@@ -326,10 +322,6 @@ struct TestBridgedValueTy : CustomStringConvertible, _ObjectiveCBridgeable {
326322
return value.description
327323
}
328324

329-
static func _isBridgedToObjectiveC() -> Bool {
330-
return true
331-
}
332-
333325
func _bridgeToObjectiveC() -> TestObjCValueTy {
334326
TestBridgedValueTy.bridgeOperations += 1
335327
return TestObjCValueTy(value)
@@ -387,10 +379,6 @@ struct TestBridgedEquatableValueTy
387379
return value.description
388380
}
389381

390-
static func _isBridgedToObjectiveC() -> Bool {
391-
return true
392-
}
393-
394382
func _bridgeToObjectiveC() -> TestObjCEquatableValueTy {
395383
_bridgedEquatableValueBridgeOperations.fetchAndAdd(1)
396384
return TestObjCEquatableValueTy(value)

test/1_stdlib/RuntimeObjC.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ struct BridgedValueType : _ObjectiveCBridgeable {
6060
return ClassA(value: value)
6161
}
6262

63-
static func _isBridgedToObjectiveC() -> Bool {
64-
return true
65-
}
66-
6763
static func _forceBridgeFromObjectiveC(
6864
_ x: ClassA,
6965
result: inout BridgedValueType?
@@ -113,10 +109,6 @@ struct BridgedLargeValueType : _ObjectiveCBridgeable {
113109
return ClassA(value: value0)
114110
}
115111

116-
static func _isBridgedToObjectiveC() -> Bool {
117-
return true
118-
}
119-
120112
static func _forceBridgeFromObjectiveC(
121113
_ x: ClassA,
122114
result: inout BridgedLargeValueType?

test/1_stdlib/SetTrapsObjC.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,6 @@ class TestObjCKeyTy : NSObject {
7979
}
8080

8181
struct TestBridgedKeyTy : Hashable, _ObjectiveCBridgeable {
82-
static func _isBridgedToObjectiveC() -> Bool {
83-
return true
84-
}
85-
8682
init(_ value: Int) { self.value = value }
8783

8884
var hashValue: Int { return value }

test/Constraints/bridging.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ public class BridgedClassSub : BridgedClass { }
1717
extension LazyFilterIterator : _ObjectiveCBridgeable { // expected-error{{conformance of 'LazyFilterIterator' to '_ObjectiveCBridgeable' can only be written in module 'Swift'}}
1818
public typealias _ObjectiveCType = BridgedClassSub
1919

20-
public static func _isBridgedToObjectiveC() -> Bool { return true }
21-
2220
public func _bridgeToObjectiveC() -> _ObjectiveCType {
2321
return BridgedClassSub()
2422
}
@@ -46,10 +44,6 @@ extension LazyFilterIterator : _ObjectiveCBridgeable { // expected-error{{confor
4644
struct BridgedStruct : Hashable, _ObjectiveCBridgeable {
4745
var hashValue: Int { return 0 }
4846

49-
static func _isBridgedToObjectiveC() -> Bool {
50-
return true
51-
}
52-
5347
func _bridgeToObjectiveC() -> BridgedClass {
5448
return BridgedClass()
5549
}

test/IRGen/Inputs/Foundation.swift

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ func _convertNSSetToSet<T: NSObject>(s: NSSet?) -> Set<T> {
3232
}
3333

3434
extension String : _ObjectiveCBridgeable {
35-
public static func _isBridgedToObjectiveC() -> Bool {
36-
return true
37-
}
38-
3935
public func _bridgeToObjectiveC() -> NSString {
4036
return NSString()
4137
}
@@ -77,9 +73,6 @@ extension Array : _ObjectiveCBridgeable {
7773
) -> Array {
7874
return Array()
7975
}
80-
public static func _isBridgedToObjectiveC() -> Bool {
81-
return Swift._isBridgedToObjectiveC(Element.self)
82-
}
8376
}
8477

8578
extension Dictionary : _ObjectiveCBridgeable {
@@ -102,9 +95,6 @@ extension Dictionary : _ObjectiveCBridgeable {
10295
) -> Dictionary {
10396
return Dictionary()
10497
}
105-
public static func _isBridgedToObjectiveC() -> Bool {
106-
return Swift._isBridgedToObjectiveC(Key.self) && Swift._isBridgedToObjectiveC(Value.self)
107-
}
10898
}
10999

110100
extension Set : _ObjectiveCBridgeable {
@@ -127,9 +117,6 @@ extension Set : _ObjectiveCBridgeable {
127117
) -> Set {
128118
return Set()
129119
}
130-
public static func _isBridgedToObjectiveC() -> Bool {
131-
return Swift._isBridgedToObjectiveC(Element.self)
132-
}
133120
}
134121

135122
extension NSError: Error {

test/Inputs/ObjCBridging/Appliances.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ public struct Refrigerator {
77
extension Refrigerator : _ObjectiveCBridgeable {
88
public typealias _ObjectiveCType = APPRefrigerator
99

10-
public static func _isBridgedToObjectiveC() -> Bool { return true }
11-
1210
public func _bridgeToObjectiveC() -> _ObjectiveCType {
1311
return APPRefrigerator(temperature: temperature)
1412
}
@@ -44,8 +42,6 @@ public struct ManufacturerInfo<DataType: AnyObject> {
4442
extension ManufacturerInfo : _ObjectiveCBridgeable {
4543
public typealias _ObjectiveCType = APPManufacturerInfo<DataType>
4644

47-
public static func _isBridgedToObjectiveC() -> Bool { return true }
48-
4945
public func _bridgeToObjectiveC() -> _ObjectiveCType {
5046
return impl
5147
}

test/Inputs/clang-importer-sdk/swift-modules-without-ns/Foundation.swift

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ internal func _convertNSSetToSet<T : Hashable>(_ s: NSSet?) -> Set<T> {
4646
}
4747

4848
extension String : _ObjectiveCBridgeable {
49-
public static func _isBridgedToObjectiveC() -> Bool {
50-
return true
51-
}
52-
5349
public func _bridgeToObjectiveC() -> NSString {
5450
return NSString()
5551
}
@@ -70,10 +66,6 @@ extension String : _ObjectiveCBridgeable {
7066
}
7167

7268
extension Int : _ObjectiveCBridgeable {
73-
public static func _isBridgedToObjectiveC() -> Bool {
74-
return true
75-
}
76-
7769
public func _bridgeToObjectiveC() -> NSNumber {
7870
return NSNumber()
7971
}
@@ -96,10 +88,6 @@ extension Int : _ObjectiveCBridgeable {
9688
}
9789

9890
extension Array : _ObjectiveCBridgeable {
99-
public static func _isBridgedToObjectiveC() -> Bool {
100-
return true
101-
}
102-
10391
public func _bridgeToObjectiveC() -> NSArray {
10492
return NSArray()
10593
}
@@ -122,10 +110,6 @@ extension Array : _ObjectiveCBridgeable {
122110
}
123111

124112
extension Dictionary : _ObjectiveCBridgeable {
125-
public static func _isBridgedToObjectiveC() -> Bool {
126-
return true
127-
}
128-
129113
public func _bridgeToObjectiveC() -> NSDictionary {
130114
return NSDictionary()
131115
}
@@ -148,10 +132,6 @@ extension Dictionary : _ObjectiveCBridgeable {
148132
}
149133

150134
extension Set : _ObjectiveCBridgeable {
151-
public static func _isBridgedToObjectiveC() -> Bool {
152-
return true
153-
}
154-
155135
public func _bridgeToObjectiveC() -> NSSet {
156136
return NSSet()
157137
}
@@ -174,10 +154,6 @@ extension Set : _ObjectiveCBridgeable {
174154
}
175155

176156
extension CGFloat : _ObjectiveCBridgeable {
177-
public static func _isBridgedToObjectiveC() -> Bool {
178-
return true
179-
}
180-
181157
public func _bridgeToObjectiveC() -> NSNumber {
182158
return NSNumber()
183159
}
@@ -200,10 +176,6 @@ extension CGFloat : _ObjectiveCBridgeable {
200176
}
201177

202178
extension NSRange : _ObjectiveCBridgeable {
203-
public static func _isBridgedToObjectiveC() -> Bool {
204-
return true
205-
}
206-
207179
public func _bridgeToObjectiveC() -> NSValue {
208180
return NSValue()
209181
}

test/Inputs/clang-importer-sdk/swift-modules/Foundation.swift

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ internal func _convertNSSetToSet<T : Hashable>(_ s: NSSet?) -> Set<T> {
4646
}
4747

4848
extension String : _ObjectiveCBridgeable {
49-
public static func _isBridgedToObjectiveC() -> Bool {
50-
return true
51-
}
52-
5349
public func _bridgeToObjectiveC() -> NSString {
5450
return NSString()
5551
}
@@ -68,10 +64,6 @@ extension String : _ObjectiveCBridgeable {
6864
}
6965

7066
extension Int : _ObjectiveCBridgeable {
71-
public static func _isBridgedToObjectiveC() -> Bool {
72-
return true
73-
}
74-
7567
public func _bridgeToObjectiveC() -> NSNumber {
7668
return NSNumber()
7769
}
@@ -94,10 +86,6 @@ extension Int : _ObjectiveCBridgeable {
9486
}
9587

9688
extension Array : _ObjectiveCBridgeable {
97-
public static func _isBridgedToObjectiveC() -> Bool {
98-
return true
99-
}
100-
10189
public func _bridgeToObjectiveC() -> NSArray {
10290
return NSArray()
10391
}
@@ -120,10 +108,6 @@ extension Array : _ObjectiveCBridgeable {
120108
}
121109

122110
extension Dictionary : _ObjectiveCBridgeable {
123-
public static func _isBridgedToObjectiveC() -> Bool {
124-
return true
125-
}
126-
127111
public func _bridgeToObjectiveC() -> NSDictionary {
128112
return NSDictionary()
129113
}
@@ -146,10 +130,6 @@ extension Dictionary : _ObjectiveCBridgeable {
146130
}
147131

148132
extension Set : _ObjectiveCBridgeable {
149-
public static func _isBridgedToObjectiveC() -> Bool {
150-
return true
151-
}
152-
153133
public func _bridgeToObjectiveC() -> NSSet {
154134
return NSSet()
155135
}
@@ -172,10 +152,6 @@ extension Set : _ObjectiveCBridgeable {
172152
}
173153

174154
extension CGFloat : _ObjectiveCBridgeable {
175-
public static func _isBridgedToObjectiveC() -> Bool {
176-
return true
177-
}
178-
179155
public func _bridgeToObjectiveC() -> NSNumber {
180156
return NSNumber()
181157
}
@@ -198,10 +174,6 @@ extension CGFloat : _ObjectiveCBridgeable {
198174
}
199175

200176
extension NSRange : _ObjectiveCBridgeable {
201-
public static func _isBridgedToObjectiveC() -> Bool {
202-
return true
203-
}
204-
205177
public func _bridgeToObjectiveC() -> NSValue {
206178
return NSValue()
207179
}
@@ -233,10 +205,6 @@ public struct URL : _ObjectiveCBridgeable {
233205

234206
public init?(string: String) { return nil }
235207

236-
public static func _isBridgedToObjectiveC() -> Bool {
237-
return true
238-
}
239-
240208
public func _bridgeToObjectiveC() -> NSURL {
241209
return NSURL()
242210
}

0 commit comments

Comments
 (0)