File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -501,7 +501,7 @@ extension Array : _ObjectiveCBridgeable {
501
501
502
502
@_semantics ( " convertToObjectiveC " )
503
503
public func _bridgeToObjectiveC( ) -> NSArray {
504
- return unsafeBitCast ( self . _buffer . _asCocoaArray ( ) as AnyObject , to: NSArray . self)
504
+ return unsafeBitCast ( self . _bridgeToObjectiveCImpl ( ) , to: NSArray . self)
505
505
}
506
506
507
507
public static func _forceBridgeFromObjectiveC(
Original file line number Diff line number Diff line change @@ -2091,6 +2091,11 @@ public func != <Element : Equatable>(
2091
2091
2092
2092
#if _runtime(_ObjC)
2093
2093
extension Array {
2094
+ public // @SPI(Foundation)
2095
+ func _bridgeToObjectiveCImpl( ) -> AnyObject {
2096
+ return _buffer. _asCocoaArray ( )
2097
+ }
2098
+
2094
2099
/// Tries to downcast the source `NSArray` as our native buffer type.
2095
2100
/// If it succeeds, creates a new `Array` around it and returns that.
2096
2101
/// Returns `nil` otherwise.
You can’t perform that action at this time.
0 commit comments