@@ -168,7 +168,7 @@ func someAsyncFunc() async {
168
168
169
169
_ = await a. deposit ( b. withdraw ( a. deposit ( b. withdraw ( b. balance ( ) ) ) ) )
170
170
171
- // expected-error@+1 {{expression is 'async' but is not marked with 'await'}} {{3-3=await }} expected-note@+1 {{call is 'async' }}
171
+ // expected-error@+1 {{actor-isolated instance method 'testSelfBalance()' cannot be called from outside of the actor}} {{3-3=await }}
172
172
a. testSelfBalance ( )
173
173
174
174
await a. testThrowing ( ) // expected-error {{call can throw, but it is not marked with 'try' and the error is not handled}}
@@ -177,16 +177,16 @@ func someAsyncFunc() async {
177
177
// effectful properties from outside the actor instance
178
178
179
179
// expected-warning@+2 {{non-sendable type 'Box' of property 'effPropA' cannot exit actor-isolated context}}
180
- // expected-error@+1{{expression is 'async' but is not marked with 'await' }} {{7-7=await }} expected-note@+1{{property access is 'async' }}
180
+ // expected-error@+1{{actor-isolated property 'effPropA' cannot be accessed from outside of the actor }} {{7-7=await }}
181
181
_ = a. effPropA
182
182
183
183
// expected-warning@+3 {{non-sendable type 'Box' of property 'effPropT' cannot exit actor-isolated context}}
184
184
// expected-error@+2{{property access can throw, but it is not marked with 'try' and the error is not handled}}
185
- // expected-error@+1{{expression is 'async' but is not marked with 'await' }} {{7-7=await }} expected-note@+1{{property access is 'async' }}
185
+ // expected-error@+1{{actor-isolated property 'effPropT' cannot be accessed from outside of the actor }} {{7-7=await }}
186
186
_ = a. effPropT
187
187
188
188
// expected-error@+2{{property access can throw, but it is not marked with 'try' and the error is not handled}}
189
- // expected-error@+1{{expression is 'async' but is not marked with 'await' }} {{7-7=await }} expected-note@+1{{property access is 'async' }}
189
+ // expected-error@+1{{actor-isolated property 'effPropAT' cannot be accessed from outside of the actor }} {{7-7=await }}
190
190
_ = a. effPropAT
191
191
192
192
// (mostly) corrected ones
@@ -204,9 +204,9 @@ func someAsyncFunc() async {
204
204
205
205
extension BankAccount {
206
206
func totalBalance( including other: BankAccount ) async -> Int {
207
- //expected-error@+1{{expression is 'async' but is not marked with 'await'}}{{12-12=await }}
208
207
return balance ( )
209
- + other. balance ( ) // expected-note{{calls to instance method 'balance()' from outside of its actor context are implicitly asynchronous}}
208
+ + other. balance ( )
209
+ // expected-error@-1 {{actor-isolated instance method 'balance()' cannot be called from outside of the actor}}{{207:12-12=await }}
210
210
}
211
211
212
212
func breakAccounts( other: BankAccount ) async {
@@ -223,19 +223,17 @@ func anotherAsyncFunc() async {
223
223
let a = BankAccount ( initialDeposit: 34 )
224
224
let b = BankAccount ( initialDeposit: 35 )
225
225
226
- // expected-error@+2{{expression is 'async' but is not marked with 'await'}} {{7-7=await }}
227
- // expected-note@+1{{calls to instance method 'deposit' from outside of its actor context are implicitly asynchronous}}
226
+ // expected-error@+1{{actor-isolated instance method 'deposit' cannot be called from outside of the actor}} {{7-7=await }}
228
227
_ = a. deposit ( 1 )
229
- // expected-error@+2{{expression is 'async' but is not marked with 'await'}} {{7-7=await }}
230
- // expected-note@+1{{calls to instance method 'balance()' from outside of its actor context are implicitly asynchronous}}
228
+ // expected-error@+1{{actor-isolated instance method 'balance()' cannot be called from outside of the actor}} {{7-7=await }}
231
229
_ = b. balance ( )
232
230
233
231
_ = b. balance // expected-error {{actor-isolated instance method 'balance()' can not be partially applied}}
234
232
235
233
// expected-error@+2{{actor-isolated property 'owner' can not be mutated from a nonisolated context}}
236
234
// expected-note@+1{{consider declaring an isolated method on 'BankAccount' to perform the mutation}}
237
235
a. owner = " cat "
238
- // expected-error@+1{{expression is 'async' but is not marked with 'await' }} {{7-7=await }} expected-note@+1{{property access is 'async' }}
236
+ // expected-error@+1{{actor-isolated property 'owner' cannot be accessed from outside of the actor }} {{7-7=await }}
239
237
_ = b. owner
240
238
_ = await b. owner == " cat "
241
239
@@ -334,7 +332,7 @@ func walkChain(chain : Chain) async {
334
332
335
333
@OrangeActor func quinoa( ) async {
336
334
337
- // expected-error@+1{{expression is 'async' but is not marked with 'await' }}{{3-3=await }} expected-note@+1 {{call is 'async' }}
335
+ // expected-error@+1{{global actor 'BananaActor'-isolated global function 'rice()' cannot be called from outside of the actor }}{{3-3=await }}
338
336
rice ( )
339
337
}
340
338
@@ -458,21 +456,21 @@ func tryEffPropsFromSync() {
458
456
}
459
457
460
458
@OrangeActor func tryEffPropertiesFromGlobalActor( ) async throws {
461
- // expected-error@+1{{expression is 'async' but is not marked with 'await' }}{{7-7=await }} expected-note@+1 {{property access is 'async' }}
459
+ // expected-error@+1{{global actor 'BananaActor'-isolated var 'effPropA' cannot be accessed from outside of the actor }}{{7-7=await }}
462
460
_ = effPropA
463
461
464
462
// expected-note@+5{{did you mean to handle error as optional value?}}
465
463
// expected-note@+4{{did you mean to use 'try'?}}
466
464
// expected-note@+3{{did you mean to disable error propagation?}}
467
465
// expected-error@+2{{property access can throw but is not marked with 'try'}}
468
- // expected-error@+1{{expression is 'async' but is not marked with 'await' }}{{7-7=await }} expected-note@+1 {{property access is 'async' }}
466
+ // expected-error@+1{{global actor 'BananaActor'-isolated var 'effPropT' cannot be accessed from outside of the actor }}{{7-7=await }}
469
467
_ = effPropT
470
468
471
469
// expected-note@+5{{did you mean to handle error as optional value?}}
472
470
// expected-note@+4{{did you mean to use 'try'?}}
473
471
// expected-note@+3{{did you mean to disable error propagation?}}
474
472
// expected-error@+2{{property access can throw but is not marked with 'try'}}
475
- // expected-error@+1{{expression is 'async' but is not marked with 'await' }}{{7-7=await }} expected-note@+1 {{property access is 'async' }}
473
+ // expected-error@+1{{global actor 'BananaActor'-isolated var 'effPropAT' cannot be accessed from outside of the actor }}{{7-7=await }}
476
474
_ = effPropAT
477
475
478
476
_ = await effPropA
@@ -494,7 +492,7 @@ actor SubscriptA {
494
492
495
493
func f( ) async {
496
494
497
- // expected-error@+1{{expression is 'async' but is not marked with 'await' }} {{9-9=await }} expected-note@+1{{subscript access is 'async' }}
495
+ // expected-error@+1{{actor-isolated subscript 'subscript(_:)' cannot be accessed from outside of the actor }} {{9-9=await }}
498
496
_ = self [ 0 ]
499
497
}
500
498
}
@@ -543,7 +541,7 @@ actor SubscriptAT {
543
541
}
544
542
545
543
func tryTheActorSubscripts( a : SubscriptA , t : SubscriptT , at : SubscriptAT ) async throws {
546
- // expected-error@+1 {{expression is 'async' but is not marked with 'await' }}{{7-7=await }} expected-note@+1 {{subscript access is 'async' }}
544
+ // expected-error@+1 {{actor-isolated subscript 'subscript(_:)' cannot be accessed from outside of the actor }}{{7-7=await }}
547
545
_ = a [ 0 ]
548
546
549
547
_ = await a [ 0 ]
@@ -552,7 +550,7 @@ func tryTheActorSubscripts(a : SubscriptA, t : SubscriptT, at : SubscriptAT) asy
552
550
// expected-note@+4{{did you mean to use 'try'?}}
553
551
// expected-note@+3{{did you mean to disable error propagation?}}
554
552
// expected-error@+2{{subscript access can throw but is not marked with 'try'}}
555
- // expected-error@+1 {{expression is 'async' but is not marked with 'await' }}{{7-7=await }} expected-note@+1 {{subscript access is 'async' }}
553
+ // expected-error@+1 {{actor-isolated subscript 'subscript(_:)' cannot be accessed from outside of the actor }}{{7-7=await }}
556
554
_ = t [ 0 ]
557
555
558
556
_ = try await t [ 0 ]
@@ -563,7 +561,7 @@ func tryTheActorSubscripts(a : SubscriptA, t : SubscriptT, at : SubscriptAT) asy
563
561
// expected-note@+4{{did you mean to use 'try'?}}
564
562
// expected-note@+3{{did you mean to disable error propagation?}}
565
563
// expected-error@+2{{subscript access can throw but is not marked with 'try'}}
566
- // expected-error@+1 {{expression is 'async' but is not marked with 'await' }}{{7-7=await }} expected-note@+1 {{subscript access is 'async' }}
564
+ // expected-error@+1 {{actor-isolated subscript 'subscript(_:)' cannot be accessed from outside of the actor }}{{7-7=await }}
567
565
_ = at [ 0 ]
568
566
569
567
_ = try await at [ 0 ]
@@ -583,8 +581,7 @@ final class IsolatedOperator: @preconcurrency Equatable {
583
581
584
582
nonisolated func callEqual( ) async -> Bool {
585
583
let foo = await IsolatedOperator ( )
586
- // expected-error@+2{{expression is 'async' but is not marked with 'await'}}
587
- // expected-note@+1{{calls to operator function '==' from outside of its actor context are implicitly asynchronous}}
584
+ // expected-error@+1{{main actor-isolated operator function '==' cannot be called from outside of the actor}} {{12-12=await }}
588
585
return foo == self
589
586
}
590
587
}
0 commit comments