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
@@ -437,13 +437,15 @@ actor WrapperActorBad2<Wrapped: Sendable> {
437
437
structWrapperWithMainActorDefaultInit{
438
438
varwrappedValue:Int{fatalError()}
439
439
440
-
@MainActorinit(){} // expected-note 2 {{calls to initializer 'init()' from outside of its actor context are implicitly asynchronous}}
440
+
@MainActorinit(){} // expected-note {{calls to initializer 'init()' from outside of its actor context are implicitly asynchronous}}
441
+
// expected-minimal-targeted-note@-1 {{calls to initializer 'init()' from outside of its actor context are implicitly asynchronous}}
441
442
}
442
443
443
444
actorActorWithWrapper{
444
445
@WrapperOnActorvarsynced:Int=0
445
446
// expected-note@-1 3{{property declared here}}
446
-
@WrapperWithMainActorDefaultInitvarproperty:Int // expected-error {{call to main actor-isolated initializer 'init()' in a synchronous actor-isolated context}}
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}}
447
449
func f(){
448
450
_ = synced // expected-error{{main actor-isolated property 'synced' can not be referenced on a different actor instance}}
449
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.
560
563
structHasWrapperOnUnsafeActor{
561
-
@WrapperOnUnsafeActorvarsynced:Int=0
564
+
@WrapperOnUnsafeActorvarsynced:Int=0 // expected-complete-tns-error {{global actor 'OtherGlobalActor'-isolated default value in a main actor-isolated context}}
// expected-complete-tns-error @-1 {{top-level code variables cannot have a global actor}}
648
651
649
652
@MainActor
650
-
func useFooInADefer()->String{ // expected-note {{calls to global function 'useFooInADefer()' from outside of its actor context are implicitly asynchronous}}
653
+
func useFooInADefer()->String{ // expected-minimal-targeted-note {{calls to global function 'useFooInADefer()' from outside of its actor context are implicitly asynchronous}}
651
654
defer{
652
655
statefulThingy =true
653
656
}
@@ -677,9 +680,11 @@ class Cutter {
677
680
678
681
@SomeGlobalActor
679
682
classButter{
680
-
vara=useFooInADefer() // expected-error {{call to main actor-isolated global function 'useFooInADefer()' in a synchronous global actor 'SomeGlobalActor'-isolated context}}
683
+
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}}
681
685
682
-
nonisolatedletb= statefulThingy // expected-error {{main actor-isolated var 'statefulThingy' can not be referenced from a non-isolated context}}
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}}
0 commit comments