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
@MainActorvarx=useFooInADefer() // expected-warning {{expression requiring global actor 'MainActor' cannot appear in default-value expression of property 'x'; this is an error in Swift 6}}
626
+
@MainActorvarx=useFooInADefer()
627
627
@MainActorvary={()->Boolin
628
-
varz= statefulThingy // expected-warning {{expression requiring global actor 'MainActor' cannot appear in default-value expression of property 'y'; this is an error in Swift 6}}
628
+
varz= statefulThingy
629
629
return z
630
630
}()
631
631
}
@@ -637,7 +637,7 @@ class Butter {
637
637
nonisolatedletb= statefulThingy // expected-error {{var 'statefulThingy' isolated to global actor 'MainActor' can not be referenced from a non-isolated synchronous context}}
638
638
639
639
varc:Int={
640
-
returngetGlobal7() // expected-warning {{expression requiring global actor 'SomeGlobalActor' cannot appear in default-value expression of property 'c'; this is an error in Swift 6}}
Copy file name to clipboardExpand all lines: test/Concurrency/property_initializers_swift6.swift
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -9,11 +9,11 @@ actor GlobalActor {
9
9
}
10
10
11
11
@GlobalActor
12
-
func globalActorFn()->Int{return0} // expected-note 2 {{calls to global function 'globalActorFn()' from outside of its actor context are implicitly asynchronous}}
12
+
func globalActorFn()->Int{return0} // expected-note {{calls to global function 'globalActorFn()' from outside of its actor context are implicitly asynchronous}}
13
13
14
14
@GlobalActor
15
15
classC{
16
-
varx:Int=globalActorFn() // expected-error {{call to global actor 'GlobalActor'-isolated global function 'globalActorFn()' in a synchronous nonisolated context}}
0 commit comments