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} {
23812381% end
23822382
23832383#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+
23842393extension Array {
23852394 @_inlineable
23862395 public // @SPI(Foundation)
@@ -2414,7 +2423,7 @@ extension Array {
24142423 /// is a reference type).
24152424 @_inlineable
24162425 public init( _immutableCocoaArray: _NSArrayCore) {
2417- self = Array ( _buffer : _ArrayBuffer ( nsArray : _immutableCocoaArray) )
2426+ self = _bridgeCocoaArray ( _immutableCocoaArray)
24182427 }
24192428}
24202429#endif
You can’t perform that action at this time.
0 commit comments