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 {
1652
1652
}
1653
1653
}
1654
1654
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
+
1656
1661
@inlinable // c-abi
1657
1662
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 " )
1665
1664
}
1666
1665
}
You can’t perform that action at this time.
0 commit comments