File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
test/expr/primary/selector Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -3061,6 +3061,13 @@ class Context {
30613061 return copy;
30623062 }
30633063
3064+ // / Form a subcontext that handles all async calls.
3065+ Context withHandlesAsync () const {
3066+ Context copy = *this ;
3067+ copy.HandlesAsync = true ;
3068+ return copy;
3069+ }
3070+
30643071 Kind getKind () const { return TheKind; }
30653072
30663073 DeclContext *getDeclContext () const { return DC; }
@@ -4068,7 +4075,7 @@ class CheckEffectsCoverage : public EffectsHandlingWalker<CheckEffectsCoverage>
40684075
40694076 ShouldRecurse_t checkObjCSelector (ObjCSelectorExpr *E) {
40704077 // Walk the operand.
4071- ContextScope scope (*this , std:: nullopt );
4078+ ContextScope scope (*this , CurContext. withHandlesAsync () );
40724079 scope.enterNonExecuting ();
40734080
40744081 E->getSubExpr ()->walk (*this );
Original file line number Diff line number Diff line change @@ -180,3 +180,13 @@ func test() -> Selector {
180180func testWithThrowing( obj: AnyObject ) {
181181 _ = #selector( HasThrows . doSomething ( to: ) )
182182}
183+
184+ @available ( SwiftStdlib 5 . 1 , * )
185+ @objc protocol HasAsync {
186+ @objc optional func doSomething( to object: AnyObject ) async -> Void
187+ }
188+
189+ @available ( SwiftStdlib 5 . 1 , * )
190+ func testWithAsync( obj: AnyObject ) {
191+ _ = #selector( HasAsync . doSomething ( to: ) )
192+ }
You can’t perform that action at this time.
0 commit comments