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
_ = mutable // expected-error{{actor-isolated property 'mutable' can not be referenced from an '@actorIndependent'}}
105
-
_ =text[0] // expected-error{{actor-isolated property 'text' can not be referenced from an '@actorIndependent' context}}
106
-
_ =synchronous() // expected-error{{actor-isolated instance method 'synchronous()' can not be referenced from an '@actorIndependent' context}}
104
+
_ = mutable // expected-error{{actor-isolated property 'mutable' can not be referenced from a non-isolated}}
105
+
_ =text[0] // expected-error{{actor-isolated property 'text' can not be referenced from a non-isolated context}}
106
+
_ =synchronous() // expected-error{{actor-isolated instance method 'synchronous()' can not be referenced from a non-isolated context}}
107
107
108
108
// @actorIndependent
109
109
_ =actorIndependentFunc(otherActor:self)
@@ -120,24 +120,24 @@ extension MyActor {
120
120
otherActor.actorIndependentVar =17
121
121
122
122
// async promotion
123
-
_ =synchronous() // expected-error{{actor-isolated instance method 'synchronous()' can not be referenced from an '@actorIndependent' context}}
123
+
_ =synchronous() // expected-error{{actor-isolated instance method 'synchronous()' can not be referenced from a non-isolated context}}
124
124
125
125
// Global actors
126
-
syncGlobalActorFunc() /// expected-error{{global function 'syncGlobalActorFunc()' isolated to global actor 'SomeGlobalActor' can not be referenced from an '@actorIndependent' synchronous context}}
127
-
_ = syncGlobalActorFunc // expected-error{{global function 'syncGlobalActorFunc()' isolated to global actor 'SomeGlobalActor' can not be referenced from an '@actorIndependent' context}}
126
+
syncGlobalActorFunc() /// expected-error{{global function 'syncGlobalActorFunc()' isolated to global actor 'SomeGlobalActor' can not be referenced from a non-isolated synchronous context}}
127
+
_ = syncGlobalActorFunc // expected-error{{global function 'syncGlobalActorFunc()' isolated to global actor 'SomeGlobalActor' can not be referenced from a non-isolated context}}
128
128
129
129
// Global data is okay if it is immutable.
130
130
_ = immutableGlobal
131
131
_ = mutableGlobal // expected-warning{{reference to var 'mutableGlobal' is not concurrency-safe because it involves shared mutable state}}
132
132
133
133
// Partial application
134
-
_ = synchronous // expected-error{{actor-isolated instance method 'synchronous()' can not be referenced from an '@actorIndependent' context}}
135
-
_ = super.superMethod // expected-error{{actor-isolated instance method 'superMethod()' can not be referenced from an '@actorIndependent' context}}
136
-
acceptClosure(synchronous) // expected-error{{actor-isolated instance method 'synchronous()' can not be referenced from an '@actorIndependent' context}}
137
-
acceptClosure(self.synchronous) // expected-error{{actor-isolated instance method 'synchronous()' can not be referenced from an '@actorIndependent' context}}
134
+
_ = synchronous // expected-error{{actor-isolated instance method 'synchronous()' can not be referenced from a non-isolated context}}
135
+
_ = super.superMethod // expected-error{{actor-isolated instance method 'superMethod()' can not be referenced from a non-isolated context}}
136
+
acceptClosure(synchronous) // expected-error{{actor-isolated instance method 'synchronous()' can not be referenced from a non-isolated context}}
137
+
acceptClosure(self.synchronous) // expected-error{{actor-isolated instance method 'synchronous()' can not be referenced from a non-isolated context}}
138
138
acceptClosure(otherActor.synchronous) // expected-error{{actor-isolated instance method 'synchronous()' can only be referenced on 'self'}}
139
-
acceptEscapingClosure(synchronous) // expected-error{{actor-isolated instance method 'synchronous()' can not be referenced from an '@actorIndependent' context}}}}
140
-
acceptEscapingClosure(self.synchronous) // expected-error{{actor-isolated instance method 'synchronous()' can not be referenced from an '@actorIndependent'}}
139
+
acceptEscapingClosure(synchronous) // expected-error{{actor-isolated instance method 'synchronous()' can not be referenced from a non-isolated context}}}}
140
+
acceptEscapingClosure(self.synchronous) // expected-error{{actor-isolated instance method 'synchronous()' can not be referenced from a non-isolated}}
141
141
acceptEscapingClosure(otherActor.synchronous) // expected-error{{actor-isolated instance method 'synchronous()' can only be referenced on 'self'}}
142
142
143
143
return5
@@ -281,7 +281,7 @@ extension MyActor {
281
281
282
282
// Partial application
283
283
_ = synchronous // expected-error{{actor-isolated instance method 'synchronous()' can not be partially applied}}
284
-
_ = super.superMethod // expected-error{{actor-isolated instance method 'superMethod()' can not be referenced from an '@actorIndependent' context}}
284
+
_ = super.superMethod // expected-error{{actor-isolated instance method 'superMethod()' can not be referenced from a non-isolated context}}
285
285
acceptClosure(synchronous)
286
286
acceptClosure(self.synchronous)
287
287
acceptClosure(otherActor.synchronous) // expected-error{{actor-isolated instance method 'synchronous()' can only be referenced on 'self'}}
@@ -585,7 +585,7 @@ actor LazyActor {
585
585
lazy varl12:Int= v
586
586
lazy varl13:Int={self.v }()
587
587
lazy varl14:Int=self.v
588
-
lazy varl15:Int={[unowned self]inself.v }() // expected-error{{actor-isolated property 'v' can not be referenced from an '@actorIndependent' context}}
588
+
lazy varl15:Int={[unowned self]inself.v }() // expected-error{{actor-isolated property 'v' can not be referenced from a non-isolated context}}
589
589
590
590
lazy varl21:Int={ l }()
591
591
lazy varl22:Int= l
@@ -594,15 +594,15 @@ actor LazyActor {
594
594
lazy varl25:Int={[unowned self]inself.l }()
595
595
596
596
nonisolated lazy varl31:Int={ v }()
597
-
// expected-error@-1 {{actor-isolated property 'v' can not be referenced from an '@actorIndependent' context}}
597
+
// expected-error@-1 {{actor-isolated property 'v' can not be referenced from a non-isolated context}}
598
598
nonisolated lazy varl32:Int= v
599
-
// expected-error@-1 {{actor-isolated property 'v' can not be referenced from an '@actorIndependent' context}}
599
+
// expected-error@-1 {{actor-isolated property 'v' can not be referenced from a non-isolated context}}
600
600
nonisolated lazy varl33:Int={self.v }()
601
-
// expected-error@-1 {{actor-isolated property 'v' can not be referenced from an '@actorIndependent' context}}
601
+
// expected-error@-1 {{actor-isolated property 'v' can not be referenced from a non-isolated context}}
602
602
nonisolated lazy varl34:Int=self.v
603
-
// expected-error@-1 {{actor-isolated property 'v' can not be referenced from an '@actorIndependent' context}}
603
+
// expected-error@-1 {{actor-isolated property 'v' can not be referenced from a non-isolated context}}
Copy file name to clipboardExpand all lines: test/Concurrency/actor_isolation_unsafe.swift
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ class C2: C1 {
47
47
48
48
classC3:C1{
49
49
@actorIndependentoverridefunc method(){
50
-
globalSome() // expected-error{{global function 'globalSome()' isolated to global actor 'SomeGlobalActor' can not be referenced from an '@actorIndependent' synchronous context}}
50
+
globalSome() // expected-error{{global function 'globalSome()' isolated to global actor 'SomeGlobalActor' can not be referenced from a non-isolated synchronous context}}
0 commit comments