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
+15Lines changed: 15 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -307,3 +307,18 @@ actor ProtectArray {
307
307
}
308
308
}
309
309
}
310
+
311
+
extensionOptional{
312
+
mutatingfunc mutate()async{}
313
+
}
314
+
315
+
@available(SwiftStdlib 5.1,*)
316
+
actorProtectDictionary{
317
+
vardict:[Int:Int]=[:]
318
+
319
+
func invalid()async{
320
+
awaitdict[0].mutate()
321
+
// expected-warning@-1 {{cannot call mutating async function 'mutate()' on actor-isolated property 'dict'; this is an error in Swift 6}}
322
+
// expected-targeted-complete-warning@-2 {{passing argument of non-sendable type 'inout Optional<Int>' outside of actor-isolated context may introduce data races}}
0 commit comments