File tree Expand file tree Collapse file tree 4 files changed +24
-2
lines changed
Inputs/clang-importer-sdk/usr/include Expand file tree Collapse file tree 4 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -1392,5 +1392,17 @@ Optional<StringRef> swift::stripWithCompletionHandlerSuffix(StringRef name) {
1392
1392
return name.drop_back (strlen (" WithCompletion" ));
1393
1393
}
1394
1394
1395
+ if (name.endswith (" WithCompletionBlock" )) {
1396
+ return name.drop_back (strlen (" WithCompletionBlock" ));
1397
+ }
1398
+
1399
+ if (name.endswith (" WithReplyTo" )) {
1400
+ return name.drop_back (strlen (" WithReplyTo" ));
1401
+ }
1402
+
1403
+ if (name.endswith (" WithReply" )) {
1404
+ return name.drop_back (strlen (" WithReply" ));
1405
+ }
1406
+
1395
1407
return None;
1396
1408
}
Original file line number Diff line number Diff line change @@ -1135,8 +1135,12 @@ Optional<ForeignErrorConvention::Info> NameImporter::considerErrorImport(
1135
1135
1136
1136
// / Whether the given parameter name identifies a completion handler.
1137
1137
static bool isCompletionHandlerParamName (StringRef paramName) {
1138
- return paramName == " completionHandler" || paramName == " completion" ||
1139
- paramName == " withCompletionHandler" || paramName == " withCompletion" ;
1138
+ return paramName == " completionHandler" ||
1139
+ paramName == " withCompletionHandler" ||
1140
+ paramName == " completion" || paramName == " withCompletion" ||
1141
+ paramName == " completionBlock" || paramName == " withCompletionBlock" ||
1142
+ paramName == " reply" || paramName == " withReply" ;
1143
+ paramName == " replyTo" || paramName == " withReplyTo" ;
1140
1144
}
1141
1145
1142
1146
// Determine whether the given type is a nullable NSError type.
Original file line number Diff line number Diff line change 13
13
// CHECK-DAG: func doSomethingDangerous(_ operation: String) async throws -> String
14
14
// CHECK-DAG: func checkAvailability(completionHandler: @escaping (Bool) -> Void)
15
15
// CHECK-DAG: func checkAvailability() async -> Bool
16
+ // CHECK-DAG: func anotherExample() async -> String
17
+ // CHECK-DAG: func finalExample() async -> String
18
+ // CHECK-DAG: func replyingOperation(_ operation: String) async -> String
16
19
// CHECK-DAG: func findAnswer(completionHandler handler: @escaping (String?, Error?) -> Void)
17
20
// CHECK-DAG: func findAnswer() async throws -> String
18
21
// CHECK-DAG: func findAnswerFailingly(completionHandler handler: @escaping (String?, Error?) -> Void) throws
Original file line number Diff line number Diff line change 12
12
-(void )doSomethingSlow : (NSString *)operation completionHandler : (void (^)(NSInteger ))handler ;
13
13
-(void )doSomethingDangerous : (NSString *)operation completionHandler : (void (^ _Nullable)(NSString *_Nullable, NSError * _Nullable))handler ;
14
14
-(void )checkAvailabilityWithCompletionHandler : (void (^)(BOOL isAvailable))completionHandler ;
15
+ -(void )anotherExampleWithCompletionBlock : (void (^)(NSString *))block ;
16
+ -(void )finalExampleWithReplyTo : (void (^)(NSString *))block ;
17
+ -(void )replyingOperation : (NSString *)operation replyTo : (void (^)(NSString *))block ;
15
18
-(void )findAnswerAsynchronously : (void (^)(NSString *_Nullable, NSError * _Nullable))handler __attribute__((swift_name(" findAnswer(completionHandler:)" )));
16
19
-(BOOL )findAnswerFailinglyWithError : (NSError * _Nullable * _Nullable)error completion : (void (^)(NSString *_Nullable, NSError * _Nullable))handler __attribute__((swift_name(" findAnswerFailingly(completionHandler:)" )));
17
20
-(void )doSomethingFun : (NSString *)operation then : (void (^)(void ))completionHandler ;
You can’t perform that action at this time.
0 commit comments