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
// expected-note@+1 8{{mutation of this property is only permitted within the actor}}
53
+
// expected-note@+2 2{{property declared here}}
54
+
// expected-note@+1 6{{mutation of this property is only permitted within the actor}}
55
55
varmutable:Int=71
56
56
57
57
// expected-note@+2 3 {{mutation of this property is only permitted within the actor}}
58
-
// expected-note@+1 5{{property declared here}}
58
+
// expected-note@+1 4{{property declared here}}
59
59
vartext:[String]=[]
60
60
61
61
letpoint:Point=Point()
@@ -70,7 +70,7 @@ actor MyActor: MySuperActor {
70
70
classfunc synchronousClass(){}
71
71
staticfunc synchronousStatic(){}
72
72
73
-
func synchronous()->String{ text.first ??"nothing"} // expected-note 20{{calls to instance method 'synchronous()' from outside of its actor context are implicitly asynchronous}}
73
+
func synchronous()->String{ text.first ??"nothing"} // expected-note 19{{calls to instance method 'synchronous()' from outside of its actor context are implicitly asynchronous}}
74
74
func asynchronous()async->String{
75
75
super.superState +=4
76
76
returnsynchronous()
@@ -254,15 +254,15 @@ extension MyActor {
254
254
_ = otherLocalVar
255
255
}
256
256
257
-
// Escaping closures might run concurrently.
257
+
// Escaping closures are still actor-isolated
258
258
acceptEscapingClosure{
259
-
_ =self.text[0] // expected-error{{actor-isolated property 'text' cannot be referenced from an '@escaping' closure}}
260
-
_ =self.mutable // expected-error{{actor-isolated property 'mutable' cannot be referenced from an '@escaping' closure}}
261
-
self.mutable =0 // expected-error{{actor-isolated property 'mutable' cannot be mutated from an '@escaping' closure}}
262
-
acceptInout(&self.mutable) // expected-error{{actor-isolated property 'mutable' cannot be used 'inout' from an '@escaping' closure}}
259
+
_ =self.text[0]
260
+
_ =self.mutable
261
+
self.mutable =0
262
+
acceptInout(&self.mutable)
263
263
_ =self.immutable
264
-
_ =self.synchronous() // expected-error{{actor-isolated instance method 'synchronous()' cannot be referenced from an '@escaping' closure}}
265
-
_ = localVar // okay, don't complain about escaping
264
+
_ =self.synchronous()
265
+
_ = localVar
266
266
_ = localConstant
267
267
}
268
268
@@ -294,7 +294,7 @@ extension MyActor {
294
294
295
295
// Partial application
296
296
_ = synchronous // expected-error{{actor-isolated instance method 'synchronous()' can not be partially applied}}
297
-
_ = super.superMethod // expected-error{{actor-isolated instance method 'superMethod()' can not be referenced from a non-isolated context}}
297
+
_ = super.superMethod
298
298
acceptClosure(synchronous)
299
299
acceptClosure(self.synchronous)
300
300
acceptClosure(otherActor.synchronous) // expected-error{{actor-isolated instance method 'synchronous()' can only be referenced on 'self'}}
0 commit comments