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) {
13921392 return name.drop_back (strlen (" WithCompletion" ));
13931393 }
13941394
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+
13951407 return None;
13961408}
Original file line number Diff line number Diff line change @@ -1135,8 +1135,12 @@ Optional<ForeignErrorConvention::Info> NameImporter::considerErrorImport(
11351135
11361136// / Whether the given parameter name identifies a completion handler.
11371137static 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" ;
11401144}
11411145
11421146// Determine whether the given type is a nullable NSError type.
Original file line number Diff line number Diff line change 1313// CHECK-DAG: func doSomethingDangerous(_ operation: String) async throws -> String
1414// CHECK-DAG: func checkAvailability(completionHandler: @escaping (Bool) -> Void)
1515// 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
1619// CHECK-DAG: func findAnswer(completionHandler handler: @escaping (String?, Error?) -> Void)
1720// CHECK-DAG: func findAnswer() async throws -> String
1821// CHECK-DAG: func findAnswerFailingly(completionHandler handler: @escaping (String?, Error?) -> Void) throws
Original file line number Diff line number Diff line change 1212-(void )doSomethingSlow : (NSString *)operation completionHandler : (void (^)(NSInteger ))handler ;
1313-(void )doSomethingDangerous : (NSString *)operation completionHandler : (void (^ _Nullable)(NSString *_Nullable, NSError * _Nullable))handler ;
1414-(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 ;
1518-(void )findAnswerAsynchronously : (void (^)(NSString *_Nullable, NSError * _Nullable))handler __attribute__((swift_name(" findAnswer(completionHandler:)" )));
1619-(BOOL )findAnswerFailinglyWithError : (NSError * _Nullable * _Nullable)error completion : (void (^)(NSString *_Nullable, NSError * _Nullable))handler __attribute__((swift_name(" findAnswerFailingly(completionHandler:)" )));
1720-(void )doSomethingFun : (NSString *)operation then : (void (^)(void ))completionHandler ;
You can’t perform that action at this time.
0 commit comments