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 {
3061
3061
return copy;
3062
3062
}
3063
3063
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
+
3064
3071
Kind getKind () const { return TheKind; }
3065
3072
3066
3073
DeclContext *getDeclContext () const { return DC; }
@@ -4068,7 +4075,7 @@ class CheckEffectsCoverage : public EffectsHandlingWalker<CheckEffectsCoverage>
4068
4075
4069
4076
ShouldRecurse_t checkObjCSelector (ObjCSelectorExpr *E) {
4070
4077
// Walk the operand.
4071
- ContextScope scope (*this , std::nullopt );
4078
+ ContextScope scope (*this , CurContext. withHandlesAsync () );
4072
4079
scope.enterNonExecuting ();
4073
4080
4074
4081
E->getSubExpr ()->walk (*this );
Original file line number Diff line number Diff line change @@ -180,3 +180,13 @@ func test() -> Selector {
180
180
func testWithThrowing( obj: AnyObject ) {
181
181
_ = #selector( HasThrows . doSomething ( to: ) )
182
182
}
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