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
Copy file name to clipboardExpand all lines: test/Concurrency/global_actor_from_ordinary_context.swift
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -61,12 +61,12 @@ func callGlobalActor() {
61
61
62
62
func fromClosure(){
63
63
{()->Voidin
64
-
// expected-error@+1 {{global function 'syncGlobActorFn()' isolated to global actor 'SomeGlobalActor' can not be referenced from this context}}
64
+
// expected-error@+1 {{global function 'syncGlobActorFn()' isolated to global actor 'SomeGlobalActor' can not be referenced from a non-isolated context}}
65
65
letx= syncGlobActorFn
66
66
x()
67
67
}()
68
68
69
-
// expected-error@+1 {{global function 'syncGlobActorFn()' isolated to global actor 'SomeGlobalActor' can not be referenced from this synchronous context}}
69
+
// expected-error@+1 {{global function 'syncGlobActorFn()' isolated to global actor 'SomeGlobalActor' can not be referenced from a non-isolated synchronous context}}
@SomeGlobalActorfunc getGlobal7()->Int{7} // expected-note{{calls to global function 'getGlobal7()' from outside of its actor context are implicitly asynchronous}}
434
+
func acceptClosure<T>(_:()->T){}
435
+
436
+
@SomeGlobalActorfunc someGlobalActorFunc()async{
437
+
acceptClosure{getGlobal7()} // okay
438
+
acceptClosure{@actorIndependentingetGlobal7()} // expected-error{{global function 'getGlobal7()' isolated to global actor 'SomeGlobalActor' can not be referenced from a non-isolated synchronous context}}
0 commit comments