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
func syncMethod(){} // expected-note {{calls to instance method 'syncMethod()' from outside of its actor context are implicitly asynchronous}}
80
+
func syncMethod(){} // expected-note 2{{calls to instance method 'syncMethod()' from outside of its actor context are implicitly asynchronous}}
81
81
82
82
func independentMethod(){
83
83
syncMethod() // expected-error{{ctor-isolated instance method 'syncMethod()' can not be referenced from a non-isolated context}}
@@ -88,7 +88,7 @@ actor MySubclassCheckingSwiftAttributes : ProtocolWithSwiftAttributes {
88
88
}
89
89
90
90
func mainActorMethod(){
91
-
syncMethod()
91
+
syncMethod() // expected-error{{actor-isolated instance method 'syncMethod()' can not be referenced from synchronous context of global actor 'MainActor'}}
Copy file name to clipboardExpand all lines: test/Concurrency/global_actor_inference.swift
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -361,6 +361,13 @@ struct StructUGA2: UGA {
361
361
nonisolatedfunc req(){}
362
362
}
363
363
364
+
@SomeGlobalActor
365
+
structStructUGA3:UGA{
366
+
func req(){
367
+
sibling()
368
+
}
369
+
}
370
+
364
371
@GenericGlobalActor<String>
365
372
func testUGA<T:UGA>(_ value:T){
366
373
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