We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 32b7e36 + 5bca066 commit 7afb399Copy full SHA for 7afb399
test/Concurrency/global_actor_from_ordinary_context.swift
@@ -128,4 +128,11 @@ func fromAsync() async {
128
129
_ = a[1] // expected-error{{subscript 'subscript(_:)' isolated to global actor 'SomeGlobalActor' can not be referenced from this context}}
130
a[0] = 1 // expected-error{{subscript 'subscript(_:)' isolated to global actor 'SomeGlobalActor' can not be referenced from this context}}
131
-}
+}
132
+
133
+// expected-note@+1{{mutable state is only available within the actor instance}}
134
+@SomeGlobalActor var value: Int = 42
135
136
+func topLevelSyncFunction(_ number: inout Int) { }
137
+// expected-error@+1{{var 'value' isolated to global actor 'SomeGlobalActor' can not be referenced from this context}}
138
+topLevelSyncFunction(&value)
0 commit comments