Skip to content

Remove now-dead _isBridgedToObjectiveC() declarations in _ObjectiveCBridgeable conformers. #3810

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions stdlib/public/core/BridgeObjectiveC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,6 @@ public protocol _ObjectiveCBridgeable {
-> Self
}

// FIXME(ABI): stub for unit testing purposes
extension _ObjectiveCBridgeable {
public static func _isBridgedToObjectiveC() -> Bool {
return true
}
}

//===--- Bridging for metatypes -------------------------------------------===//

/// A stand-in for a value of metatype type.
Expand Down
4 changes: 0 additions & 4 deletions stdlib/public/core/ImplicitlyUnwrappedOptional.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@ extension ImplicitlyUnwrappedOptional : _ObjectiveCBridgeable {
return false
}

public static func _isBridgedToObjectiveC() -> Bool {
return Swift._isBridgedToObjectiveC(Wrapped.self)
}

public static func _unconditionallyBridgeFromObjectiveC(_ source: AnyObject?)
-> Wrapped! {
var result: ImplicitlyUnwrappedOptional<Wrapped>?
Expand Down
4 changes: 0 additions & 4 deletions test/1_stdlib/ArrayBridge.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ struct BridgeableValue : _ObjectiveCBridgeable, Equatable {
return Subclass(trak.value)
}

static func _isBridgedToObjectiveC() -> Bool {
return true
}

static func _forceBridgeFromObjectiveC(
_ x: Subclass,
result: inout BridgeableValue?
Expand Down
4 changes: 0 additions & 4 deletions test/1_stdlib/BridgeNonVerbatim.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ import ObjectiveC
import StdlibUnittest

struct X : _ObjectiveCBridgeable {
static func _isBridgedToObjectiveC() -> Bool {
return true
}

init(_ value: Int) {
self.value = value
}
Expand Down
4 changes: 0 additions & 4 deletions test/1_stdlib/Bridgeable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ func testBridging<T>(_ x: T, _ name: String) {

//===----------------------------------------------------------------------===//
struct BridgedValueType : _ObjectiveCBridgeable {
static func _isBridgedToObjectiveC() -> Bool {
return true
}

func _bridgeToObjectiveC() -> C {
return C()
}
Expand Down
2 changes: 0 additions & 2 deletions test/1_stdlib/DebuggerSupport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ struct DontBridgeThisStruct {
extension DontBridgeThisStruct : _ObjectiveCBridgeable {
typealias _ObjectiveCType = AnyObject

static func _isBridgedToObjectiveC() -> Bool { return true }

func _bridgeToObjectiveC() -> _ObjectiveCType {
fatalError("tried to bridge DontBridgeThisStruct")
}
Expand Down
4 changes: 0 additions & 4 deletions test/1_stdlib/DictionaryTrapsObjC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,6 @@ class TestObjCKeyTy : NSObject {
}

struct TestBridgedKeyTy : Hashable, _ObjectiveCBridgeable {
static func _isBridgedToObjectiveC() -> Bool {
return true
}

init(_ value: Int) { self.value = value }

var hashValue: Int { return value }
Expand Down
12 changes: 0 additions & 12 deletions test/1_stdlib/Inputs/DictionaryKeyValueTypesObjC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,6 @@ struct TestBridgedKeyTy
return _hashValue
}

static func _isBridgedToObjectiveC() -> Bool {
return true
}

func _bridgeToObjectiveC() -> TestObjCKeyTy {
_bridgedKeyBridgeOperations.fetchAndAdd(1)
return TestObjCKeyTy(value)
Expand Down Expand Up @@ -326,10 +322,6 @@ struct TestBridgedValueTy : CustomStringConvertible, _ObjectiveCBridgeable {
return value.description
}

static func _isBridgedToObjectiveC() -> Bool {
return true
}

func _bridgeToObjectiveC() -> TestObjCValueTy {
TestBridgedValueTy.bridgeOperations += 1
return TestObjCValueTy(value)
Expand Down Expand Up @@ -387,10 +379,6 @@ struct TestBridgedEquatableValueTy
return value.description
}

static func _isBridgedToObjectiveC() -> Bool {
return true
}

func _bridgeToObjectiveC() -> TestObjCEquatableValueTy {
_bridgedEquatableValueBridgeOperations.fetchAndAdd(1)
return TestObjCEquatableValueTy(value)
Expand Down
8 changes: 0 additions & 8 deletions test/1_stdlib/RuntimeObjC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ struct BridgedValueType : _ObjectiveCBridgeable {
return ClassA(value: value)
}

static func _isBridgedToObjectiveC() -> Bool {
return true
}

static func _forceBridgeFromObjectiveC(
_ x: ClassA,
result: inout BridgedValueType?
Expand Down Expand Up @@ -113,10 +109,6 @@ struct BridgedLargeValueType : _ObjectiveCBridgeable {
return ClassA(value: value0)
}

static func _isBridgedToObjectiveC() -> Bool {
return true
}

static func _forceBridgeFromObjectiveC(
_ x: ClassA,
result: inout BridgedLargeValueType?
Expand Down
4 changes: 0 additions & 4 deletions test/1_stdlib/SetTrapsObjC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ class TestObjCKeyTy : NSObject {
}

struct TestBridgedKeyTy : Hashable, _ObjectiveCBridgeable {
static func _isBridgedToObjectiveC() -> Bool {
return true
}

init(_ value: Int) { self.value = value }

var hashValue: Int { return value }
Expand Down
6 changes: 0 additions & 6 deletions test/Constraints/bridging.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ public class BridgedClassSub : BridgedClass { }
extension LazyFilterIterator : _ObjectiveCBridgeable { // expected-error{{conformance of 'LazyFilterIterator' to '_ObjectiveCBridgeable' can only be written in module 'Swift'}}
public typealias _ObjectiveCType = BridgedClassSub

public static func _isBridgedToObjectiveC() -> Bool { return true }

public func _bridgeToObjectiveC() -> _ObjectiveCType {
return BridgedClassSub()
}
Expand Down Expand Up @@ -46,10 +44,6 @@ extension LazyFilterIterator : _ObjectiveCBridgeable { // expected-error{{confor
struct BridgedStruct : Hashable, _ObjectiveCBridgeable {
var hashValue: Int { return 0 }

static func _isBridgedToObjectiveC() -> Bool {
return true
}

func _bridgeToObjectiveC() -> BridgedClass {
return BridgedClass()
}
Expand Down
13 changes: 0 additions & 13 deletions test/IRGen/Inputs/Foundation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ func _convertNSSetToSet<T: NSObject>(s: NSSet?) -> Set<T> {
}

extension String : _ObjectiveCBridgeable {
public static func _isBridgedToObjectiveC() -> Bool {
return true
}

public func _bridgeToObjectiveC() -> NSString {
return NSString()
}
Expand Down Expand Up @@ -77,9 +73,6 @@ extension Array : _ObjectiveCBridgeable {
) -> Array {
return Array()
}
public static func _isBridgedToObjectiveC() -> Bool {
return Swift._isBridgedToObjectiveC(Element.self)
}
}

extension Dictionary : _ObjectiveCBridgeable {
Expand All @@ -102,9 +95,6 @@ extension Dictionary : _ObjectiveCBridgeable {
) -> Dictionary {
return Dictionary()
}
public static func _isBridgedToObjectiveC() -> Bool {
return Swift._isBridgedToObjectiveC(Key.self) && Swift._isBridgedToObjectiveC(Value.self)
}
}

extension Set : _ObjectiveCBridgeable {
Expand All @@ -127,9 +117,6 @@ extension Set : _ObjectiveCBridgeable {
) -> Set {
return Set()
}
public static func _isBridgedToObjectiveC() -> Bool {
return Swift._isBridgedToObjectiveC(Element.self)
}
}

extension NSError: Error {
Expand Down
4 changes: 0 additions & 4 deletions test/Inputs/ObjCBridging/Appliances.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ public struct Refrigerator {
extension Refrigerator : _ObjectiveCBridgeable {
public typealias _ObjectiveCType = APPRefrigerator

public static func _isBridgedToObjectiveC() -> Bool { return true }

public func _bridgeToObjectiveC() -> _ObjectiveCType {
return APPRefrigerator(temperature: temperature)
}
Expand Down Expand Up @@ -44,8 +42,6 @@ public struct ManufacturerInfo<DataType: AnyObject> {
extension ManufacturerInfo : _ObjectiveCBridgeable {
public typealias _ObjectiveCType = APPManufacturerInfo<DataType>

public static func _isBridgedToObjectiveC() -> Bool { return true }

public func _bridgeToObjectiveC() -> _ObjectiveCType {
return impl
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ internal func _convertNSSetToSet<T : Hashable>(_ s: NSSet?) -> Set<T> {
}

extension String : _ObjectiveCBridgeable {
public static func _isBridgedToObjectiveC() -> Bool {
return true
}

public func _bridgeToObjectiveC() -> NSString {
return NSString()
}
Expand All @@ -70,10 +66,6 @@ extension String : _ObjectiveCBridgeable {
}

extension Int : _ObjectiveCBridgeable {
public static func _isBridgedToObjectiveC() -> Bool {
return true
}

public func _bridgeToObjectiveC() -> NSNumber {
return NSNumber()
}
Expand All @@ -96,10 +88,6 @@ extension Int : _ObjectiveCBridgeable {
}

extension Array : _ObjectiveCBridgeable {
public static func _isBridgedToObjectiveC() -> Bool {
return true
}

public func _bridgeToObjectiveC() -> NSArray {
return NSArray()
}
Expand All @@ -122,10 +110,6 @@ extension Array : _ObjectiveCBridgeable {
}

extension Dictionary : _ObjectiveCBridgeable {
public static func _isBridgedToObjectiveC() -> Bool {
return true
}

public func _bridgeToObjectiveC() -> NSDictionary {
return NSDictionary()
}
Expand All @@ -148,10 +132,6 @@ extension Dictionary : _ObjectiveCBridgeable {
}

extension Set : _ObjectiveCBridgeable {
public static func _isBridgedToObjectiveC() -> Bool {
return true
}

public func _bridgeToObjectiveC() -> NSSet {
return NSSet()
}
Expand All @@ -174,10 +154,6 @@ extension Set : _ObjectiveCBridgeable {
}

extension CGFloat : _ObjectiveCBridgeable {
public static func _isBridgedToObjectiveC() -> Bool {
return true
}

public func _bridgeToObjectiveC() -> NSNumber {
return NSNumber()
}
Expand All @@ -200,10 +176,6 @@ extension CGFloat : _ObjectiveCBridgeable {
}

extension NSRange : _ObjectiveCBridgeable {
public static func _isBridgedToObjectiveC() -> Bool {
return true
}

public func _bridgeToObjectiveC() -> NSValue {
return NSValue()
}
Expand Down
32 changes: 0 additions & 32 deletions test/Inputs/clang-importer-sdk/swift-modules/Foundation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ internal func _convertNSSetToSet<T : Hashable>(_ s: NSSet?) -> Set<T> {
}

extension String : _ObjectiveCBridgeable {
public static func _isBridgedToObjectiveC() -> Bool {
return true
}

public func _bridgeToObjectiveC() -> NSString {
return NSString()
}
Expand All @@ -68,10 +64,6 @@ extension String : _ObjectiveCBridgeable {
}

extension Int : _ObjectiveCBridgeable {
public static func _isBridgedToObjectiveC() -> Bool {
return true
}

public func _bridgeToObjectiveC() -> NSNumber {
return NSNumber()
}
Expand All @@ -94,10 +86,6 @@ extension Int : _ObjectiveCBridgeable {
}

extension Array : _ObjectiveCBridgeable {
public static func _isBridgedToObjectiveC() -> Bool {
return true
}

public func _bridgeToObjectiveC() -> NSArray {
return NSArray()
}
Expand All @@ -120,10 +108,6 @@ extension Array : _ObjectiveCBridgeable {
}

extension Dictionary : _ObjectiveCBridgeable {
public static func _isBridgedToObjectiveC() -> Bool {
return true
}

public func _bridgeToObjectiveC() -> NSDictionary {
return NSDictionary()
}
Expand All @@ -146,10 +130,6 @@ extension Dictionary : _ObjectiveCBridgeable {
}

extension Set : _ObjectiveCBridgeable {
public static func _isBridgedToObjectiveC() -> Bool {
return true
}

public func _bridgeToObjectiveC() -> NSSet {
return NSSet()
}
Expand All @@ -172,10 +152,6 @@ extension Set : _ObjectiveCBridgeable {
}

extension CGFloat : _ObjectiveCBridgeable {
public static func _isBridgedToObjectiveC() -> Bool {
return true
}

public func _bridgeToObjectiveC() -> NSNumber {
return NSNumber()
}
Expand All @@ -198,10 +174,6 @@ extension CGFloat : _ObjectiveCBridgeable {
}

extension NSRange : _ObjectiveCBridgeable {
public static func _isBridgedToObjectiveC() -> Bool {
return true
}

public func _bridgeToObjectiveC() -> NSValue {
return NSValue()
}
Expand Down Expand Up @@ -233,10 +205,6 @@ public struct URL : _ObjectiveCBridgeable {

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

public static func _isBridgedToObjectiveC() -> Bool {
return true
}

public func _bridgeToObjectiveC() -> NSURL {
return NSURL()
}
Expand Down
Loading