Skip to content

Commit 147b2e9

Browse files
committed
Don't mark calls to async methods of distributed actors implicitly-async
1 parent 72796b2 commit 147b2e9

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

lib/Sema/TypeCheckConcurrency.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2209,8 +2209,6 @@ namespace {
22092209
if (func->isStatic()) {
22102210
// no additional checks for static functions
22112211
} else if (func->isDistributed()) {
2212-
tryMarkImplicitlyAsync(memberLoc, memberRef, context,
2213-
ImplicitActorHopTarget::forInstanceSelf());
22142212
tryMarkImplicitlyThrows(memberLoc, memberRef, context);
22152213
markNearestCallAsImplicitly(/*setAsync*/None, /*setThrows*/false,
22162214
/*setDistributedThunk*/true);

test/Distributed/distributed_actor_func_implicitly_async_throws.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ func test_outside(distributed: D) async throws {
4848

4949
distributed.distHelloAsync()// expected-error{{expression is 'async' but is not marked with 'await'}}
5050
// expected-error@-1{{call can throw but is not marked with 'try'}}
51-
// expected-note@-2{{calls to instance method 'distHelloAsync()' from outside of its actor context are implicitly asynchronous}}
51+
// expected-note@-2{{call is 'async'}}
5252
// expected-note@-3{{did you mean to use 'try'?}}
5353
// expected-note@-4{{did you mean to disable error propagation?}}
5454
// expected-note@-5{{did you mean to handle error as optional value?}}
5555
try distributed.distHelloAsync() // expected-error{{expression is 'async' but is not marked with 'await'}}
56-
// expected-note@-1{{calls to instance method 'distHelloAsync()' from outside of its actor context are implicitly asynchronous}}
56+
// expected-note@-1{{call is 'async'}}
5757
await distributed.distHelloAsync() // expected-error{{call can throw but is not marked with 'try'}}
5858
// expected-note@-1{{did you mean to use 'try'?}}
5959
// expected-note@-2{{did you mean to disable error propagation?}}
@@ -76,12 +76,12 @@ func test_outside(distributed: D) async throws {
7676

7777
distributed.distHelloAsyncThrows() // expected-error{{expression is 'async' but is not marked with 'await'}}
7878
// expected-error@-1{{call can throw but is not marked with 'try'}}
79-
// expected-note@-2{{calls to instance method 'distHelloAsyncThrows()' from outside of its actor context are implicitly asynchronous}}
79+
// expected-note@-2{{call is 'async'}}
8080
// expected-note@-3{{did you mean to use 'try'?}}
8181
// expected-note@-4{{did you mean to disable error propagation?}}
8282
// expected-note@-5{{did you mean to handle error as optional value?}}
8383
try distributed.distHelloAsyncThrows() // expected-error{{expression is 'async' but is not marked with 'await'}}
84-
// expected-note@-1{{calls to instance method 'distHelloAsyncThrows()' from outside of its actor context are implicitly asynchronous}}
84+
// expected-note@-1{{call is 'async'}}
8585
await distributed.distHelloAsyncThrows() // expected-error{{call can throw but is not marked with 'try'}}
8686
// expected-note@-1{{did you mean to use 'try'?}}
8787
// expected-note@-2{{did you mean to disable error propagation?}}

0 commit comments

Comments
 (0)