File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -1652,15 +1652,14 @@ extension NSString : CVarArg {
16521652 }
16531653}
16541654
1655- extension String : CVarArg {
1655+ extension String : CVarArg , _CVarArgObject {
1656+ @inlinable // c-abi
1657+ public var _cVarArgObject : CVarArg {
1658+ return NSString ( string: self )
1659+ }
1660+
16561661 @inlinable // c-abi
16571662 public var _cVarArgEncoding : [ Int ] {
1658- // We don't have an autorelease pool to retain the NSString until the withVaList closure is complete.
1659- // So add an operation to release on the next cycle of this thread.
1660- let ns = Unmanaged . passRetained ( NSString ( string: self ) )
1661- OperationQueue . current? . addOperation {
1662- ns. release ( )
1663- }
1664- return ns. takeUnretainedValue ( ) . _cVarArgEncoding
1663+ fatalError ( " _cVarArgEncoding must be called on NSString instead " )
16651664 }
16661665}
You can’t perform that action at this time.
0 commit comments