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_call_implicitly_async.swift
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -358,23 +358,23 @@ actor Calculator {
358
358
359
359
@OrangeActorfunc doSomething()async{
360
360
let _ =(awaitbananaAdd(1))(2)
361
-
// expected-warning@-1{{cannot call function returning non-sendable type}}
361
+
// expected-warning@-1{{non-sendable type '(Int) -> Int' returned by call to global actor 'BananaActor'-isolated function cannot cross actor boundary}}
362
362
// expected-note@-2{{a function type must be marked '@Sendable' to conform to 'Sendable'}}
363
363
let _ =await(awaitbananaAdd(1))(2) // expected-warning{{no 'async' operations occur within 'await' expression}}
364
-
// expected-warning@-1{{cannot call function returning non-sendable type}}
364
+
// expected-warning@-1{{non-sendable type '(Int) -> Int' returned by call to global actor 'BananaActor'-isolated function cannot cross actor boundary}}
365
365
// expected-note@-2{{a function type must be marked '@Sendable' to conform to 'Sendable'}}
366
366
367
367
letcalc=Calculator()
368
368
369
369
let _ =(await calc.addCurried(1))(2)
370
-
// expected-warning@-1{{cannot call function returning non-sendable type}}
370
+
// expected-warning@-1{{non-sendable type '(Int) -> Int' returned by implicitly asynchronous call to actor-isolated instance method 'addCurried' cannot cross actor boundary}}
371
371
// expected-note@-2{{a function type must be marked '@Sendable' to conform to 'Sendable'}}
372
372
let _ =await(await calc.addCurried(1))(2) // expected-warning{{no 'async' operations occur within 'await' expression}}
373
-
// expected-warning@-1{{cannot call function returning non-sendable type}}
373
+
// expected-warning@-1{{non-sendable type '(Int) -> Int' returned by implicitly asynchronous call to actor-isolated instance method 'addCurried' cannot cross actor boundary}}
374
374
// expected-note@-2{{a function type must be marked '@Sendable' to conform to 'Sendable'}}
// expected-warning@-1{{cannot call function returning non-sendable type}}
377
+
// expected-warning@-1{{non-sendable type '(Int) -> Int' returned by implicitly asynchronous call to actor-isolated instance method 'addCurried' cannot cross actor boundary}}
378
378
// expected-note@-2{{a function type must be marked '@Sendable' to conform to 'Sendable'}}
Copy file name to clipboardExpand all lines: test/Concurrency/concurrent_value_checking.swift
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ extension A1 {
51
51
52
52
// Across to a different actor, so Sendable restriction is enforced.
53
53
_ = other.localLet // expected-warning{{cannot use property 'localLet' with a non-sendable type 'NotConcurrent' across actors}}
54
-
_ =await other.synchronous() // expected-warning{{cannot call function returning non-sendable type 'NotConcurrent?' across actors}}
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{{cannot pass argument of non-sendable type 'NotConcurrent?' across actors}}
awaitglobalAsync(a) // expected-warning{{cannot pass argument of non-sendable type 'NotConcurrent?' across actors}}
106
106
awaitglobalSync(a) // expected-warning{{cannot pass argument of non-sendable type 'NotConcurrent?' across actors}}
107
107
_ =awaitClassWithGlobalActorInits(nc) // expected-warning{{cannot pass argument of non-sendable type 'NotConcurrent' across actors}}
108
-
// expected-warning@-1{{cannot call function returning non-sendable type 'ClassWithGlobalActorInits' across actors}}
109
-
_ =awaitClassWithGlobalActorInits() // expected-warning{{cannot call function returning non-sendable type 'ClassWithGlobalActorInits' across actors}}
108
+
// expected-warning@-1{{non-sendable type 'ClassWithGlobalActorInits' returned by call to global actor 'SomeGlobalActor'-isolated function cannot cross actor boundary}}
109
+
_ =awaitClassWithGlobalActorInits() // expected-warning{{non-sendable type 'ClassWithGlobalActorInits' returned by call to global actor 'SomeGlobalActor'-isolated function cannot cross actor boundary}}
func f()async->NotSendable{NotSendable()} // expected-warning{{cannot call function returning non-sendable type 'NotSendable' across actors}}
43
+
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
45
varprop:NotSendable{ // expected-warning{{cannot use property 'prop' with a non-sendable type 'NotSendable' across actors}}
46
46
get async{
@@ -53,7 +53,7 @@ actor A3: AsyncProtocolWithNotSendable {
53
53
// actor's domain.
54
54
@available(SwiftStdlib 5.1,*)
55
55
actorA4:AsyncProtocolWithNotSendable{
56
-
func f()->NotSendable{NotSendable()} // expected-warning{{cannot call function returning non-sendable type 'NotSendable' across actors}}
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
58
varprop:NotSendable{ // expected-warning{{cannot use property 'prop' with a non-sendable type 'NotSendable' across actors}}
func f()async->NotSendable{NotSendable()} // expected-warning{{cannot call function returning non-sendable type 'NotSendable' across actors}}
101
+
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
103
varprop:NotSendable{ // expected-warning{{cannot use property 'prop' with a non-sendable type 'NotSendable' across actors}}
104
104
get async{
@@ -111,7 +111,7 @@ actor A7: AsyncThrowingProtocolWithNotSendable {
111
111
// actor's domain.
112
112
@available(SwiftStdlib 5.1,*)
113
113
actorA8:AsyncThrowingProtocolWithNotSendable{
114
-
func f()->NotSendable{NotSendable()} // expected-warning{{cannot call function returning non-sendable type 'NotSendable' across actors}}
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
116
varprop:NotSendable{ // expected-warning{{cannot use property 'prop' with a non-sendable type 'NotSendable' across actors}}
// expected-warning@-1{{cannot call function returning non-sendable type '(AnyObject, Int)' across actors}}
37
+
// expected-warning@-1{{non-sendable type '(AnyObject, Int)' returned by actor-isolated '@objc' instance method 'doBigJobOrFail' cannot cross actor boundary}}
38
38
39
39
// Actor-isolated entities cannot be exposed to Objective-C.
40
40
@objcfunc synchronousBad(){} // expected-error{{actor-isolated instance method 'synchronousBad()' cannot be @objc}}
0 commit comments