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/actor_isolation.swift
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -824,6 +824,7 @@ actor SomeActorWithInits {
824
824
// expected-note@+1 3 {{mutation of this property is only permitted within the actor}}
825
825
varmutableState:Int=17
826
826
varotherMutableState:Int
827
+
// expected-note@+1 {{mutation of this property is only permitted within the actor}}
827
828
letnonSendable:SomeClass
828
829
829
830
// Sema should not complain about referencing non-sendable members
@@ -887,7 +888,7 @@ actor SomeActorWithInits {
887
888
@MainActorinit(i5 x:SomeClass){
888
889
self.mutableState =42
889
890
self.otherMutableState =17
890
-
self.nonSendable = x
891
+
self.nonSendable = x // expected-warning {{actor-isolated property 'nonSendable' can not be mutated from the main actor; this is an error in Swift 6}}
891
892
892
893
self.isolated() // expected-warning{{actor-isolated instance method 'isolated()' can not be referenced from the main actor; this is an error in Swift 6}}
0 commit comments