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 mainActorFn()->Int{return0} // expected-note 2 {{calls to global function 'mainActorFn()' from outside of its actor context are implicitly asynchronous}}
7
+
8
+
@MainActor
9
+
classC{
10
+
varx:Int=mainActorFn() // expected-error {{call to main actor-isolated global function 'mainActorFn()' in a synchronous nonisolated context}}
11
+
12
+
lazy vary:Int=mainActorFn()
13
+
14
+
staticvarz:Int=mainActorFn()
15
+
}
16
+
17
+
@MainActor
18
+
varx:Int=mainActorFn() // expected-error {{call to main actor-isolated global function 'mainActorFn()' in a synchronous nonisolated context}}
0 commit comments