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
globalVar =self // expected-note {{after making a copy of 'self', only non-isolated properties of 'self' can be accessed from this init}}
527
+
// expected-note@+2 {{after making a copy of 'self', only non-isolated properties of 'self' can be accessed from this init}}
528
+
// expected-warning@+1 {{reference to var 'globalVar' is not concurrency-safe because it involves shared mutable state}}
529
+
globalVar =self
530
+
531
+
// expected-warning@+1 {{reference to var 'globalVar' is not concurrency-safe because it involves shared mutable state}}
527
532
Task{await globalVar!.isolatedMethod()}
528
533
529
534
ifself.x ==0{ // expected-warning {{cannot access property 'x' here in non-isolated initializer; this is an error in Swift 6}}
@@ -700,3 +705,24 @@ actor OhBrother {
700
705
whatever =2 // expected-warning {{cannot access property 'whatever' here in non-isolated initializer; this is an error in Swift 6}}
701
706
}
702
707
}
708
+
709
+
@available(SwiftStdlib 5.1,*)
710
+
@MainActorclassAwesomeUIView{}
711
+
712
+
@available(SwiftStdlib 5.1,*)
713
+
classCheckDeinitFromClass:AwesomeUIView{
714
+
varns:NonSendableType?
715
+
deinit{
716
+
ns?.f() // expected-warning {{cannot access property 'ns' with a non-sendable type 'NonSendableType?' from non-isolated deinit; this is an error in Swift 6}}
717
+
ns =nil // expected-warning {{cannot access property 'ns' with a non-sendable type 'NonSendableType?' from non-isolated deinit; this is an error in Swift 6}}
718
+
}
719
+
}
720
+
721
+
@available(SwiftStdlib 5.1,*)
722
+
actorCheckDeinitFromActor{
723
+
varns:NonSendableType?
724
+
deinit{
725
+
ns?.f() // expected-warning {{cannot access property 'ns' with a non-sendable type 'NonSendableType?' from non-isolated deinit; this is an error in Swift 6}}
726
+
ns =nil // expected-warning {{cannot access property 'ns' with a non-sendable type 'NonSendableType?' from non-isolated deinit; this is an error in Swift 6}}
0 commit comments