File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -2381,6 +2381,15 @@ extension ${Self} {
2381
2381
% end
2382
2382
2383
2383
#if _runtime(_ObjC)
2384
+ // We isolate the bridging of the Cocoa Array -> Swift Array here so that
2385
+ // in the future, we can eagerly bridge the Cocoa array. We need this function
2386
+ // to do the bridging in an ABI safe way. Even though this looks useless,
2387
+ // DO NOT DELETE!
2388
+ @_versioned internal
2389
+ func _bridgeCocoaArray< T> ( _ _immutableCocoaArray: _NSArrayCore) - > Array< T> {
2390
+ return Array ( _buffer: _ArrayBuffer ( nsArray: _immutableCocoaArray) )
2391
+ }
2392
+
2384
2393
extension Array {
2385
2394
@_inlineable
2386
2395
public // @SPI(Foundation)
@@ -2414,7 +2423,7 @@ extension Array {
2414
2423
/// is a reference type).
2415
2424
@_inlineable
2416
2425
public init( _immutableCocoaArray: _NSArrayCore) {
2417
- self = Array ( _buffer : _ArrayBuffer ( nsArray : _immutableCocoaArray) )
2426
+ self = _bridgeCocoaArray ( _immutableCocoaArray)
2418
2427
}
2419
2428
}
2420
2429
#endif
You can’t perform that action at this time.
0 commit comments