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_inout_isolation.swift
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -119,7 +119,7 @@ extension TestActor {
119
119
func passStateIntoDifferentClassMethod()async{
120
120
letother=NonAsyncClass()
121
121
letotherCurry= other.modifyOtherAsync
122
-
// expected-targeted-complete-tns-warning @-1 {{non-sendable type 'NonAsyncClass' exiting actor-isolated context in call to non-isolated instance method 'modifyOtherAsync' cannot cross actor boundary}}
122
+
// expected-targeted-complete-tns-warning @-1 {{non-sendable type 'NonAsyncClass' exiting actor-isolated context in call to nonisolated instance method 'modifyOtherAsync' cannot cross actor boundary}}
123
123
await other.modifyOtherAsync(&value2)
124
124
// expected-error @-1 {{actor-isolated property 'value2' cannot be passed 'inout' to 'async' function call}}
125
125
@@ -194,7 +194,7 @@ actor MyActor {
194
194
195
195
// expected-error@+1{{cannot pass immutable value of type 'Int' as inout argument}}
196
196
awaitmodifyAsynchronously(&(maybePoint?.z)!)
197
-
// expected-error@+2{{actor-isolated property 'position' can not be used 'inout' on a non-isolated actor instance}}
197
+
// expected-error@+2{{actor-isolated property 'position' can not be used 'inout' on a nonisolated actor instance}}
198
198
// expected-error@+1{{actor-isolated property 'myActor' cannot be passed 'inout' to 'async' function call}}
199
199
awaitmodifyAsynchronously(&myActor.position.x)
200
200
}
@@ -219,8 +219,8 @@ struct MyGlobalActor {
219
219
if #available(SwiftStdlib 5.1,*){
220
220
let _ =Task.detached{await{(_ foo:inoutInt)asyncin foo +=1}(&number)}
221
221
// expected-error @-1 {{actor-isolated var 'number' cannot be passed 'inout' to 'async' function call}}
222
-
// expected-minimal-error @-2 {{global actor 'MyGlobalActor'-isolated var 'number' can not be used 'inout' from a non-isolated context}}
223
-
// expected-complete-tns-error @-3 {{main actor-isolated var 'number' can not be used 'inout' from a non-isolated context}}
222
+
// expected-minimal-error @-2 {{global actor 'MyGlobalActor'-isolated var 'number' can not be used 'inout' from a nonisolated context}}
223
+
// expected-complete-tns-error @-3 {{main actor-isolated var 'number' can not be used 'inout' from a nonisolated context}}
224
224
}
225
225
226
226
// attempt to pass global state owned by the global actor to another async function
@@ -288,11 +288,11 @@ actor ProtectArray {
288
288
func test()async{
289
289
// FIXME: this is invalid too!
290
290
_ =await array.mutateAsynchronously
291
-
// expected-targeted-complete-tns-warning@-1 {{non-sendable type '@lvalue [Int]' exiting actor-isolated context in call to non-isolated property 'mutateAsynchronously' cannot cross actor boundary}}
291
+
// expected-targeted-complete-tns-warning@-1 {{non-sendable type '@lvalue [Int]' exiting actor-isolated context in call to nonisolated property 'mutateAsynchronously' cannot cross actor boundary}}
292
292
293
293
_ =awaitarray[mutateAsynchronously:0]
294
294
// expected-error@-1 {{actor-isolated property 'array' cannot be passed 'inout' to 'async' function call}}
295
-
// expected-targeted-complete-tns-warning@-2 {{non-sendable type 'inout Array<Int>' exiting actor-isolated context in call to non-isolated subscript 'subscript(mutateAsynchronously:)' cannot cross actor boundary}}
295
+
// expected-targeted-complete-tns-warning@-2 {{non-sendable type 'inout Array<Int>' exiting actor-isolated context in call to nonisolated subscript 'subscript(mutateAsynchronously:)' cannot cross actor boundary}}
0 commit comments