@@ -325,8 +325,8 @@ extension MyActor {
325
325
acceptInout ( & self . mutable) // expected-error{{actor-isolated property 'mutable' can not be used 'inout' from a Sendable closure}}
326
326
_ = self . immutable
327
327
_ = self . synchronous ( ) // expected-error{{call to actor-isolated instance method 'synchronous()' in a synchronous nonisolated context}}
328
- _ = localVar // expected-error {{reference to captured var 'localVar' in concurrently-executing code}}
329
- localVar = 25 // expected-error {{mutation of captured var 'localVar' in concurrently-executing code}}
328
+ _ = localVar // expected-warning {{reference to captured var 'localVar' in concurrently-executing code}}
329
+ localVar = 25 // expected-warning {{mutation of captured var 'localVar' in concurrently-executing code}}
330
330
_ = localConstant
331
331
332
332
_ = otherLocalVar
@@ -357,17 +357,17 @@ extension MyActor {
357
357
@Sendable func localFn1( ) {
358
358
_ = self . text [ 0 ] // expected-error{{actor-isolated property 'text' can not be referenced from a Sendable function}}
359
359
_ = self . synchronous ( ) // expected-error{{call to actor-isolated instance method 'synchronous()' in a synchronous nonisolated context}}
360
- _ = localVar // expected-error {{reference to captured var 'localVar' in concurrently-executing code}}
361
- localVar = 25 // expected-error {{mutation of captured var 'localVar' in concurrently-executing code}}
360
+ _ = localVar // expected-warning {{reference to captured var 'localVar' in concurrently-executing code}}
361
+ localVar = 25 // expected-warning {{mutation of captured var 'localVar' in concurrently-executing code}}
362
362
_ = localConstant
363
363
}
364
364
365
365
@Sendable func localFn2( ) {
366
366
acceptClosure {
367
367
_ = text [ 0 ] // expected-error{{actor-isolated property 'text' can not be referenced from a non-isolated context}}
368
368
_ = self . synchronous ( ) // expected-error{{call to actor-isolated instance method 'synchronous()' in a synchronous nonisolated context}}
369
- _ = localVar // expected-error {{reference to captured var 'localVar' in concurrently-executing code}}
370
- localVar = 25 // expected-error {{mutation of captured var 'localVar' in concurrently-executing code}}
369
+ _ = localVar // expected-warning {{reference to captured var 'localVar' in concurrently-executing code}}
370
+ localVar = 25 // expected-warning {{mutation of captured var 'localVar' in concurrently-executing code}}
371
371
_ = localConstant
372
372
}
373
373
}
@@ -640,8 +640,8 @@ func testGlobalRestrictions(actor: MyActor) async {
640
640
// code.
641
641
var i = 17
642
642
acceptConcurrentClosure {
643
- _ = i // expected-error {{reference to captured var 'i' in concurrently-executing code}}
644
- i = 42 // expected-error {{mutation of captured var 'i' in concurrently-executing code}}
643
+ _ = i // expected-warning {{reference to captured var 'i' in concurrently-executing code}}
644
+ i = 42 // expected-warning {{mutation of captured var 'i' in concurrently-executing code}}
645
645
}
646
646
print ( i)
647
647
@@ -738,7 +738,7 @@ func checkLocalFunctions() async {
738
738
}
739
739
740
740
func local3( ) { // expected-warning{{concurrently-executed local function 'local3()' must be marked as '@Sendable'}}
741
- k = 25 // expected-error {{mutation of captured var 'k' in concurrently-executing code}}
741
+ k = 25 // expected-warning {{mutation of captured var 'k' in concurrently-executing code}}
742
742
}
743
743
744
744
print ( k)
@@ -1158,12 +1158,12 @@ extension MyActor {
1158
1158
_ = synchronous ( ) // expected-error{{expression is 'async' but is not marked with 'await'}}
1159
1159
// expected-note@-1{{calls to instance method 'synchronous()' from outside of its actor context are implicitly asynchronous}}
1160
1160
1161
- counter += 1 // expected-error {{mutation of captured var 'counter' in concurrently-executing code}}
1161
+ counter += 1 // expected-warning {{mutation of captured var 'counter' in concurrently-executing code}}
1162
1162
}
1163
1163
1164
1164
acceptAsyncSendableClosure {
1165
1165
_ = await synchronous ( ) // ok
1166
- counter += 1 // expected-error {{mutation of captured var 'counter' in concurrently-executing code}}
1166
+ counter += 1 // expected-warning {{mutation of captured var 'counter' in concurrently-executing code}}
1167
1167
}
1168
1168
1169
1169
acceptAsyncSendableClosureInheriting {
@@ -1184,7 +1184,7 @@ func testGlobalActorInheritance() {
1184
1184
var counter = 0
1185
1185
1186
1186
acceptAsyncSendableClosure {
1187
- counter += 1 // expected-error {{mutation of captured var 'counter' in concurrently-executing code}}
1187
+ counter += 1 // expected-warning {{mutation of captured var 'counter' in concurrently-executing code}}
1188
1188
}
1189
1189
1190
1190
acceptAsyncSendableClosure { @SomeGlobalActor in
0 commit comments