File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -2950,7 +2950,7 @@ class ObjCImplementationChecker {
2950
2950
if (auto func = dyn_cast<AbstractFunctionDecl>(req)) {
2951
2951
auto asyncFunc = func->getAsyncAlternative ();
2952
2952
2953
- if (auto asyncAccessor = dyn_cast <AccessorDecl>(asyncFunc))
2953
+ if (auto asyncAccessor = dyn_cast_or_null <AccessorDecl>(asyncFunc))
2954
2954
return asyncAccessor->getStorage ();
2955
2955
2956
2956
return asyncFunc;
Original file line number Diff line number Diff line change 103
103
- (void )doSomethingAsynchronousWithCompletionHandler : (void (^ _Nonnull)(id _Nullable result, NSError * _Nullable error))completionHandler ;
104
104
- (void )doSomethingElseAsynchronousWithCompletionHandler : (void (^ _Nullable)(id _Nonnull result))completionHandler ;
105
105
- (void )doSomethingFunAndAsynchronousWithCompletionHandler : (void (^ _Nonnull)(id _Nullable result, NSError * _Nullable error))completionHandler ;
106
+
107
+ - (void )doSomethingOverloadedWithCompletionHandler : (void (^ _Nonnull)())completionHandler ;
108
+ - (void )doSomethingOverloaded __attribute__((__swift_attr__(" @_unavailableFromAsync(message: \" Use async doSomethingOverloaded instead.\" )" )));
106
109
@end
107
110
108
111
@protocol PartiallyOptionalProtocol
Original file line number Diff line number Diff line change @@ -327,6 +327,14 @@ protocol EmptySwiftProto {}
327
327
328
328
public func doSomethingFunAndAsynchronous( completionHandler: @escaping ( Any ? , Error ? ) -> Void ) {
329
329
}
330
+
331
+ @available ( SwiftStdlib 5 . 1 , * )
332
+ @objc ( doSomethingOverloadedWithCompletionHandler: )
333
+ public func doSomethingOverloaded( ) async { }
334
+
335
+ @available ( * , noasync)
336
+ @objc ( doSomethingOverloaded)
337
+ public func doSomethingOverloaded( ) { }
330
338
}
331
339
332
340
@_objcImplementation ( Conformance) extension ObjCClass {
You can’t perform that action at this time.
0 commit comments