File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-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}}
1212
1313// expected-note@+1 3{{add '@MainActor' to make global function 'nonIsolatedSync()' part of global actor 'MainActor'}}
1414func nonIsolatedSync( ) {
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}}
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}}
1818}
1919
2020@MainActor
@@ -25,7 +25,7 @@ func isolatedSync() {
2525
2626func nonIsolatedAsync( ) async {
2727 await print ( a)
28- a = a + 10 // expected-error{{var 'a' isolated to global actor 'MainActor ' can not be mutated from this context}}
28+ a = a + 10 // expected-error{{main actor- isolated var 'a ' can not be mutated from a non-isolated context}}
2929 // expected-note@-1{{property access is 'async'}}
3030 // expected-error@-2{{expression is 'async' but is not marked with 'await'}}
3131}
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ struct A {
2121}
2222
2323
24+ @_nonSendable
2425class NonSendableObject { // expected-note{{class 'NonSendableObject' does not conform to the 'Sendable' protocol}}
2526 var property = 0
2627}
You can’t perform that action at this time.
0 commit comments