You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enforce safe access to unsafe global actor declarations only from "new" code.
Allow references to unsafe global actor-isolated declarations only from
existing code that has not adopted concurrency features (such as
async, @Concurrent closures, etc.). This allows declarations that
should be isolated to a global actor to be annotated as such without
breaking existing code (as if isolation was unspecified), while code
that does adopt concurrency will treat the declaration as being part
of that global actor.
@SomeGlobalActor(unsafe)func req() // expected-note{{calls to instance method 'req()' from outside of its actor context are implicitly asynchronous}}
243
243
}
244
244
245
245
structStructUGA1:UGA{
@@ -252,7 +252,7 @@ struct StructUGA2: UGA {
252
252
253
253
@GenericGlobalActor<String>
254
254
func testUGA<T:UGA>(_ value:T){
255
-
value.req()
255
+
value.req() // expected-error{{instance method 'req()' isolated to global actor 'SomeGlobalActor' can not be referenced from different global actor 'GenericGlobalActor<String>'}}
0 commit comments