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
@@ -445,7 +445,7 @@ actor ActorWithWrapper {
445
445
@WrapperOnActorvarsynced:Int=0
446
446
// expected-note@-1 3{{property declared here}}
447
447
@WrapperWithMainActorDefaultInitvarproperty:Int // expected-minimal-targeted-error {{call to main actor-isolated initializer 'init()' in a synchronous actor-isolated context}}
448
-
// expected-complete-tns-error@-1 {{main actor-isolated default value in a actor-isolated context}}
448
+
// expected-complete-tns-warning@-1 {{main actor-isolated default value in a actor-isolated context; this is an error in Swift 6}}
449
449
func f(){
450
450
_ = synced // expected-error{{main actor-isolated property 'synced' can not be referenced on a different actor instance}}
451
451
_ = $synced // expected-error{{global actor 'SomeGlobalActor'-isolated property '$synced' can not be referenced on a different actor instance}}
// HasWrapperOnUnsafeActor gets an inferred @MainActor attribute.
563
563
structHasWrapperOnUnsafeActor{
564
-
@WrapperOnUnsafeActorvarsynced:Int=0 // expected-complete-tns-error {{global actor 'OtherGlobalActor'-isolated default value in a main actor-isolated context}}
564
+
@WrapperOnUnsafeActorvarsynced:Int=0 // expected-complete-tns-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}}
684
-
// expected-complete-tns-error@-1 {{main actor-isolated default value in a global actor 'SomeGlobalActor'-isolated context}}
684
+
// expected-complete-tns-warning@-1 {{main actor-isolated default value in a global actor 'SomeGlobalActor'-isolated context; this is an error in Swift 6}}
685
685
686
686
nonisolatedletb= statefulThingy // expected-minimal-targeted-error {{main actor-isolated var 'statefulThingy' can not be referenced from a non-isolated context}}
687
-
// expected-complete-tns-error@-1 {{main actor-isolated default value in a nonisolated context}}
687
+
// expected-complete-tns-warning@-1 {{main actor-isolated default value in a nonisolated context; this is an error in Swift 6}}
0 commit comments