mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
In 1ae317dd88, all the machinery was added
to enable calling ObjC functions that have both async and error
conventions. The handling that was added for matching up arguments and
parameters, however, failed to handle functions that had both foreign
async and foreign error and other arguments. Here, that handling is
fixed.
The fix is in four parts:
- Reverting to a single call to CallSite::emit to emit the formal
params. At this point, the foreign async and/or error params will be
claimed as well.
- Separately counting the async and error parameters in
ParamLowering::claimParams to ensure we get the right parameter
slices.
- Letting ArgEmitter::maybeEmitForeignArgument look for an error
parameter even if it already found an async parameter.
- Letting ArgEmitter::maybeEmitForeignArgument keep looking for foreign
arguments after it finds one.
rdar://80704984
29 lines
1.3 KiB
Objective-C
29 lines
1.3 KiB
Objective-C
#include <Foundation/Foundation.h>
|
|
|
|
#pragma clang assume_nonnull begin
|
|
|
|
typedef void (^CompletionHandler)(int status, NSInteger bytesTransferred);
|
|
|
|
@interface PFXObject : NSObject
|
|
- (BOOL)enqueueFailingRequestWithData:(nullable NSMutableData *)data
|
|
error:(NSError *_Nullable *)error
|
|
completionHandler:
|
|
(nullable CompletionHandler)completionHandler;
|
|
- (BOOL)enqueuePassingRequestWithData:(nullable NSMutableData *)data
|
|
error:(NSError *_Nullable *)error
|
|
completionHandler:
|
|
(nullable CompletionHandler)completionHandler;
|
|
- (BOOL)enqueueFailingRequestWithData:(nullable NSMutableData *)data
|
|
completionTimeout:(NSTimeInterval)completionTimeout
|
|
error:(NSError *_Nullable *)error
|
|
completionHandler:
|
|
(nullable CompletionHandler)completionHandler;
|
|
- (BOOL)enqueuePassingRequestWithData:(nullable NSMutableData *)data
|
|
completionTimeout:(NSTimeInterval)completionTimeout
|
|
error:(NSError *_Nullable *)error
|
|
completionHandler:
|
|
(nullable CompletionHandler)completionHandler;
|
|
@end
|
|
|
|
#pragma clang assume_nonnull end
|