File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
test/Concurrency/toplevel Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -12,9 +12,9 @@ var a = 10 // expected-note 2 {{var declared here}}
12
12
13
13
// expected-note@+1 3{{add '@MainActor' to make global function 'nonIsolatedSync()' part of global actor 'MainActor'}}
14
14
func nonIsolatedSync( ) {
15
- print ( a) // expected-error {{main actor- isolated var 'a ' can not be referenced from a non-isolated context}}
16
- a = a + 10 // expected-error{{main actor- isolated var 'a ' can not be referenced from a non-isolated context}}
17
- // expected-error@-1{{main actor- isolated var 'a ' can not be mutated from a non-isolated context}}
15
+ print ( a) // expected-error {{var 'a' isolated to global actor 'MainActor ' can not be referenced from this synchronous context}}
16
+ a = a + 10 // expected-error{{var 'a' isolated to global actor 'MainActor ' can not be referenced from this synchronous context}}
17
+ // expected-error@-1{{var 'a' isolated to global actor 'MainActor ' can not be mutated from this context}}
18
18
}
19
19
20
20
@MainActor
@@ -25,7 +25,7 @@ func isolatedSync() {
25
25
26
26
func nonIsolatedAsync( ) async {
27
27
await print ( a)
28
- a = a + 10 // expected-error{{main actor- isolated var 'a ' can not be mutated from a non-isolated context}}
28
+ a = a + 10 // expected-error{{var 'a' isolated to global actor 'MainActor ' can not be mutated from this context}}
29
29
// expected-note@-1{{property access is 'async'}}
30
30
// expected-error@-2{{expression is 'async' but is not marked with 'await'}}
31
31
}
You can’t perform that action at this time.
0 commit comments