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
// effectful properties from outside the actor instance
177
177
178
-
// expected-warning@+2 {{cannot use property 'effPropA' with a non-sendable type 'Box' across actors}}
178
+
// expected-warning@+2 {{non-sendable type 'Box' in asynchronous access to actor-isolated property 'effPropA' cannot cross actor boundary}}
179
179
// expected-error@+1{{expression is 'async' but is not marked with 'await'}} {{7-7=await }} expected-note@+1{{property access is 'async'}}
180
180
_ = a.effPropA
181
181
182
-
// expected-warning@+3 {{cannot use property 'effPropT' with a non-sendable type 'Box' across actors}}
182
+
// expected-warning@+3 {{non-sendable type 'Box' in implicitly asynchronous access to actor-isolated property 'effPropT' cannot cross actor boundary}}
183
183
// expected-error@+2{{property access can throw, but it is not marked with 'try' and the error is not handled}}
184
184
// expected-error@+1{{expression is 'async' but is not marked with 'await'}} {{7-7=await }} expected-note@+1{{property access is 'async'}}
185
185
_ = a.effPropT
@@ -189,8 +189,8 @@ func someAsyncFunc() async {
189
189
_ = a.effPropAT
190
190
191
191
// (mostly) corrected ones
192
-
_ =await a.effPropA // expected-warning {{cannot use property 'effPropA' with a non-sendable type 'Box' across actors}}
193
-
_ =try!await a.effPropT // expected-warning {{cannot use property 'effPropT' with a non-sendable type 'Box' across actors}}
192
+
_ =await a.effPropA // expected-warning {{non-sendable type 'Box' in asynchronous access to actor-isolated property 'effPropA' cannot cross actor boundary}}
193
+
_ =try!await a.effPropT // expected-warning {{non-sendable type 'Box' in implicitly asynchronous access to actor-isolated property 'effPropT' cannot cross actor boundary}}
_ =actor.c // expected-error{{expression is 'async' but is not marked with 'await'}}
874
874
// expected-note@-1{{property access is 'async'}}
875
-
// expected-warning@-2{{cannot use property 'c' with a non-sendable type 'SomeClass' across actors}}
876
-
_ =awaitactor.c // expected-warning{{cannot use property 'c' with a non-sendable type 'SomeClass' across actors}}
875
+
// expected-warning@-2{{non-sendable type 'SomeClass' in implicitly asynchronous access to actor-isolated property 'c' cannot cross actor boundary}}
876
+
_ =awaitactor.c // expected-warning{{non-sendable type 'SomeClass' in implicitly asynchronous access to actor-isolated property 'c' cannot cross actor boundary}}
Copy file name to clipboardExpand all lines: test/Concurrency/concurrent_value_checking.swift
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,7 @@ extension A1 {
50
50
_ =awaitself.asynchronous(nil)
51
51
52
52
// Across to a different actor, so Sendable restriction is enforced.
53
-
_ = other.localLet // expected-warning{{cannot use property 'localLet' with a non-sendable type 'NotConcurrent' across actors}}
53
+
_ = other.localLet // expected-warning{{non-sendable type 'NotConcurrent' in asynchronous access to actor-isolated property 'localLet' cannot cross actor boundary}}
54
54
_ =await other.synchronous() // expected-warning{{non-sendable type 'NotConcurrent?' returned by implicitly asynchronous call to actor-isolated instance method 'synchronous()' cannot cross actor boundary}}
55
55
_ =await other.asynchronous(nil) // expected-warning{{non-sendable type 'NotConcurrent?' passed in call to actor-isolated instance method 'asynchronous' cannot cross actor boundary}}
leta= globalValue // expected-warning{{cannot use let 'globalValue' with a non-sendable type 'NotConcurrent?' across actors}}
83
+
leta= globalValue // expected-warning{{non-sendable type 'NotConcurrent?' in asynchronous access to global actor 'SomeGlobalActor'-isolated let 'globalValue' cannot cross actor boundary}}
84
84
awaitglobalAsync(a) // expected-warning{{non-sendable type 'NotConcurrent?' passed in implicitly asynchronous call to global actor 'SomeGlobalActor'-isolated function cannot cross actor boundary}}
85
85
awaitglobalSync(a) // expected-warning{{non-sendable type 'NotConcurrent?' passed in call to global actor 'SomeGlobalActor'-isolated function cannot cross actor boundary}}
leta= globalValue // expected-warning{{cannot use let 'globalValue' with a non-sendable type 'NotConcurrent?' across actors}}
104
+
leta= globalValue // expected-warning{{non-sendable type 'NotConcurrent?' in asynchronous access to global actor 'SomeGlobalActor'-isolated let 'globalValue' cannot cross actor boundary}}
105
105
awaitglobalAsync(a) // expected-warning{{non-sendable type 'NotConcurrent?' passed in implicitly asynchronous call to global actor 'SomeGlobalActor'-isolated function cannot cross actor boundary}}
106
106
awaitglobalSync(a) // expected-warning{{non-sendable type 'NotConcurrent?' passed in call to global actor 'SomeGlobalActor'-isolated function cannot cross actor boundary}}
107
107
_ =awaitClassWithGlobalActorInits(nc) // expected-warning{{non-sendable type 'NotConcurrent' passed in call to global actor 'SomeGlobalActor'-isolated function cannot cross actor boundary}}
@@ -180,7 +180,7 @@ actor ANI {
180
180
}
181
181
182
182
func testANI(ani:ANI)async{
183
-
_ = ani.nc // expected-warning{{cannot use property 'nc' with a non-sendable type 'NC' across actors}}
183
+
_ = ani.nc // expected-warning{{non-sendable type 'NC' in asynchronous access to nonisolated property 'nc' cannot cross actor boundary}}
func f()async->NotSendable{NotSendable()} // expected-warning{{non-sendable type 'NotSendable' returned by actor-isolated instance method 'f()' satisfying non-isolated protocol requirement cannot cross actor boundary}}
44
44
45
-
varprop:NotSendable{ // expected-warning{{cannot use property 'prop' with a non-sendable type 'NotSendable' across actors}}
45
+
varprop:NotSendable{ // expected-warning{{non-sendable type 'NotSendable' in conformance of actor-isolated property 'prop' to non-isolated protocol requirement cannot cross actor boundary}}
46
46
get async{
47
47
NotSendable()
48
48
}
@@ -55,7 +55,7 @@ actor A3: AsyncProtocolWithNotSendable {
55
55
actorA4:AsyncProtocolWithNotSendable{
56
56
func f()->NotSendable{NotSendable()} // expected-warning{{non-sendable type 'NotSendable' returned by actor-isolated instance method 'f()' satisfying non-isolated protocol requirement cannot cross actor boundary}}
57
57
58
-
varprop:NotSendable{ // expected-warning{{cannot use property 'prop' with a non-sendable type 'NotSendable' across actors}}
58
+
varprop:NotSendable{ // expected-warning{{non-sendable type 'NotSendable' in conformance of actor-isolated property 'prop' to non-isolated protocol requirement cannot cross actor boundary}}
func f()async->NotSendable{NotSendable()} // expected-warning{{non-sendable type 'NotSendable' returned by actor-isolated instance method 'f()' satisfying non-isolated protocol requirement cannot cross actor boundary}}
102
102
103
-
varprop:NotSendable{ // expected-warning{{cannot use property 'prop' with a non-sendable type 'NotSendable' across actors}}
103
+
varprop:NotSendable{ // expected-warning{{non-sendable type 'NotSendable' in conformance of actor-isolated property 'prop' to non-isolated protocol requirement cannot cross actor boundary}}
104
104
get async{
105
105
NotSendable()
106
106
}
@@ -113,7 +113,7 @@ actor A7: AsyncThrowingProtocolWithNotSendable {
113
113
actorA8:AsyncThrowingProtocolWithNotSendable{
114
114
func f()->NotSendable{NotSendable()} // expected-warning{{non-sendable type 'NotSendable' returned by actor-isolated instance method 'f()' satisfying non-isolated protocol requirement cannot cross actor boundary}}
115
115
116
-
varprop:NotSendable{ // expected-warning{{cannot use property 'prop' with a non-sendable type 'NotSendable' across actors}}
116
+
varprop:NotSendable{ // expected-warning{{non-sendable type 'NotSendable' in conformance of actor-isolated property 'prop' to non-isolated protocol requirement cannot cross actor boundary}}
0 commit comments