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_inference.swift
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -444,7 +444,7 @@ actor ActorWithWrapper {
444
444
@WrapperOnActorvarsynced:Int=0
445
445
// expected-note@-1 3{{property declared here}}
446
446
@WrapperWithMainActorDefaultInitvarproperty:Int // expected-minimal-targeted-error {{call to main actor-isolated initializer 'init()' in a synchronous actor-isolated context}}
447
-
// expected-complete-sns-error@-1 {{main actor-isolated default value in a actor-isolated context}}
447
+
// expected-complete-sns-warning@-1 {{main actor-isolated default value in a actor-isolated context; this is an error in Swift 6}}
448
448
func f(){
449
449
_ = synced // expected-error{{main actor-isolated property 'synced' can not be referenced on a different actor instance}}
450
450
_ = $synced // expected-error{{global actor 'SomeGlobalActor'-isolated property '$synced' can not be referenced on a different actor instance}}
// HasWrapperOnUnsafeActor gets an inferred @MainActor attribute.
562
562
structHasWrapperOnUnsafeActor{
563
-
@WrapperOnUnsafeActorvarsynced:Int=0 // expected-complete-sns-error {{global actor 'OtherGlobalActor'-isolated default value in a main actor-isolated context}}
563
+
@WrapperOnUnsafeActorvarsynced:Int=0 // expected-complete-sns-warning {{global actor 'OtherGlobalActor'-isolated default value in a main actor-isolated context; this is an error in Swift 6}}
vara=useFooInADefer() // expected-minimal-targeted-error {{call to main actor-isolated global function 'useFooInADefer()' in a synchronous global actor 'SomeGlobalActor'-isolated context}}
683
-
// expected-complete-sns-error@-1 {{main actor-isolated default value in a global actor 'SomeGlobalActor'-isolated context}}
683
+
// expected-complete-sns-warning@-1 {{main actor-isolated default value in a global actor 'SomeGlobalActor'-isolated context; this is an error in Swift 6}}
684
684
685
685
nonisolatedletb= statefulThingy // expected-minimal-targeted-error {{main actor-isolated var 'statefulThingy' can not be referenced from a non-isolated context}}
686
-
// expected-complete-sns-error@-1 {{main actor-isolated default value in a nonisolated context}}
686
+
// expected-complete-sns-warning@-1 {{main actor-isolated default value in a nonisolated context; this is an error in Swift 6}}}
0 commit comments