mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
In the synthesized completion handler that is passed to ObjC methods that are called as async, the formal type of each argument is the corresponding parameter of the formal type of the block. The non-error, non-index arguments need to be prepared so that they can be used to fulfill the continuation; the lambda which does that preparation for each such argument takes the formal type of that argument. As such, the call to that lambda needs to pass the type of the corresponding parameter of the formal type of the block to that lambda. Doing so entails skipping over the error and flag parameters if they appear before some of the non-error, non-index arguments. Previously, no parameters were skipped over. Consequently, when an error or flag argument preceded one of the non-error, non-index arguments, the wrong formal type was passed to the preparation lambda. Here, that is fixed by passing the correct index. The to-be-used indices for the formal block parameters are the same as the to-be-used indices for the lowered block parameters minus one reflecting the fact that the lowered block always has an initial block_storage parameter as the first argument which the formal type never has. rdar://81617749
124 lines
6.0 KiB
Objective-C
124 lines
6.0 KiB
Objective-C
#include <Foundation/Foundation.h>
|
|
|
|
#pragma clang assume_nonnull begin
|
|
|
|
typedef void (^CompletionHandler)(void);
|
|
|
|
@interface PFXObject : NSObject
|
|
- (void)performSingleFlaggy1WithCompletionHandler:
|
|
(void (^)(BOOL, CompletionHandler _Nullable))completionHandler
|
|
__attribute__((swift_async_error(zero_argument, 1)));
|
|
- (void)performSingleFlaggy2WithCompletionHandler:
|
|
(void (^)(CompletionHandler _Nullable, BOOL))completionHandler
|
|
__attribute__((swift_async_error(zero_argument, 2)));
|
|
|
|
- (void)performSingleErrory1WithCompletionHandler:
|
|
(void (^)(NSError *_Nullable,
|
|
CompletionHandler _Nullable))completionHandler;
|
|
- (void)performSingleErrory2WithCompletionHandler:
|
|
(void (^)(CompletionHandler _Nullable,
|
|
NSError *_Nullable))completionHandler;
|
|
|
|
- (void)performSingleBothy12WithCompletionHandler:
|
|
(void (^)(NSError *_Nullable, BOOL,
|
|
CompletionHandler _Nullable))completionHandler
|
|
__attribute__((swift_async_error(zero_argument, 2)));
|
|
- (void)performSingleBothy13WithCompletionHandler:
|
|
(void (^)(NSError *_Nullable, CompletionHandler _Nullable,
|
|
BOOL))completionHandler
|
|
__attribute__((swift_async_error(zero_argument, 3)));
|
|
- (void)performSingleBothy21WithCompletionHandler:
|
|
(void (^)(BOOL, NSError *_Nullable,
|
|
CompletionHandler _Nullable))completionHandler
|
|
__attribute__((swift_async_error(zero_argument, 1)));
|
|
- (void)performSingleBothy23WithCompletionHandler:
|
|
(void (^)(CompletionHandler _Nullable, NSError *_Nullable,
|
|
BOOL))completionHandler
|
|
__attribute__((swift_async_error(zero_argument, 3)));
|
|
- (void)performSingleBothy31WithCompletionHandler:
|
|
(void (^)(BOOL, CompletionHandler _Nullable,
|
|
NSError *_Nullable))completionHandler
|
|
__attribute__((swift_async_error(zero_argument, 1)));
|
|
- (void)performSingleBothy32WithCompletionHandler:
|
|
(void (^)(CompletionHandler _Nullable, BOOL,
|
|
NSError *_Nullable))completionHandler
|
|
__attribute__((swift_async_error(zero_argument, 2)));
|
|
|
|
- (void)performDoubleFlaggy1WithCompletionHandler:
|
|
(void (^)(BOOL, CompletionHandler _Nullable,
|
|
CompletionHandler _Nullable))completionHandler
|
|
__attribute__((swift_async_error(zero_argument, 1)));
|
|
- (void)performDoubleFlaggy2WithCompletionHandler:
|
|
(void (^)(CompletionHandler _Nullable, BOOL,
|
|
CompletionHandler _Nullable))completionHandler
|
|
__attribute__((swift_async_error(zero_argument, 2)));
|
|
- (void)performDoubleFlaggy3WithCompletionHandler:
|
|
(void (^)(CompletionHandler _Nullable, CompletionHandler _Nullable,
|
|
BOOL))completionHandler
|
|
__attribute__((swift_async_error(zero_argument, 3)));
|
|
|
|
- (void)performDoubleErrory1WithCompletionHandler:
|
|
(void (^)(NSError *_Nullable, CompletionHandler _Nullable,
|
|
CompletionHandler _Nullable))completionHandler;
|
|
- (void)performDoubleErrory2WithCompletionHandler:
|
|
(void (^)(CompletionHandler _Nullable, NSError *_Nullable,
|
|
CompletionHandler _Nullable))completionHandler;
|
|
- (void)performDoubleErrory3WithCompletionHandler:
|
|
(void (^)(CompletionHandler _Nullable, CompletionHandler _Nullable,
|
|
NSError *_Nullable))completionHandler;
|
|
|
|
- (void)performDoubleBothy12WithCompletionHandler:
|
|
(void (^)(NSError *_Nullable, BOOL, CompletionHandler _Nullable,
|
|
CompletionHandler _Nullable))completionHandler
|
|
__attribute__((swift_async_error(zero_argument, 2)));
|
|
- (void)performDoubleBothy13WithCompletionHandler:
|
|
(void (^)(NSError *_Nullable, CompletionHandler _Nullable, BOOL,
|
|
CompletionHandler _Nullable))completionHandler
|
|
__attribute__((swift_async_error(zero_argument, 3)));
|
|
- (void)performDoubleBothy14WithCompletionHandler:
|
|
(void (^)(NSError *_Nullable, CompletionHandler _Nullable,
|
|
CompletionHandler _Nullable, BOOL))completionHandler
|
|
__attribute__((swift_async_error(zero_argument, 4)));
|
|
|
|
- (void)performDoubleBothy21WithCompletionHandler:
|
|
(void (^)(BOOL, NSError *_Nullable, CompletionHandler _Nullable,
|
|
CompletionHandler _Nullable))completionHandler
|
|
__attribute__((swift_async_error(zero_argument, 1)));
|
|
- (void)performDoubleBothy23WithCompletionHandler:
|
|
(void (^)(CompletionHandler _Nullable, NSError *_Nullable, BOOL,
|
|
CompletionHandler _Nullable))completionHandler
|
|
__attribute__((swift_async_error(zero_argument, 3)));
|
|
- (void)performDoubleBothy24WithCompletionHandler:
|
|
(void (^)(CompletionHandler _Nullable, NSError *_Nullable,
|
|
CompletionHandler _Nullable, BOOL))completionHandler
|
|
__attribute__((swift_async_error(zero_argument, 4)));
|
|
|
|
- (void)performDoubleBothy31WithCompletionHandler:
|
|
(void (^)(BOOL, CompletionHandler _Nullable, NSError *_Nullable,
|
|
CompletionHandler _Nullable))completionHandler
|
|
__attribute__((swift_async_error(zero_argument, 1)));
|
|
- (void)performDoubleBothy32WithCompletionHandler:
|
|
(void (^)(CompletionHandler _Nullable, BOOL, NSError *_Nullable,
|
|
CompletionHandler _Nullable))completionHandler
|
|
__attribute__((swift_async_error(zero_argument, 2)));
|
|
- (void)performDoubleBothy34WithCompletionHandler:
|
|
(void (^)(CompletionHandler _Nullable, CompletionHandler _Nullable,
|
|
NSError *_Nullable, BOOL))completionHandler
|
|
__attribute__((swift_async_error(zero_argument, 4)));
|
|
|
|
- (void)performDoubleBothy41WithCompletionHandler:
|
|
(void (^)(BOOL, CompletionHandler _Nullable, CompletionHandler _Nullable,
|
|
NSError *_Nullable))completionHandler
|
|
__attribute__((swift_async_error(zero_argument, 1)));
|
|
- (void)performDoubleBothy42WithCompletionHandler:
|
|
(void (^)(CompletionHandler _Nullable, BOOL, CompletionHandler _Nullable,
|
|
NSError *_Nullable))completionHandler
|
|
__attribute__((swift_async_error(zero_argument, 2)));
|
|
- (void)performDoubleBothy43WithCompletionHandler:
|
|
(void (^)(CompletionHandler _Nullable, CompletionHandler _Nullable, BOOL,
|
|
NSError *_Nullable))completionHandler
|
|
__attribute__((swift_async_error(zero_argument, 3)));
|
|
@end
|
|
|
|
#pragma clang assume_nonnull end
|