Skip to content

Commit 3b21a71

Browse files
committed
Fix up a test case
1 parent 40e853f commit 3b21a71

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/Concurrency/toplevel/no-async-6-top-level.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff 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'}}
1414
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}}
1818
}
1919

2020
@MainActor
@@ -25,7 +25,7 @@ func isolatedSync() {
2525

2626
func nonIsolatedAsync() async {
2727
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}}
2929
// expected-note@-1{{property access is 'async'}}
3030
// expected-error@-2{{expression is 'async' but is not marked with 'await'}}
3131
}

0 commit comments

Comments
 (0)