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/attr_execution/adoption_mode.swift
+26-7Lines changed: 26 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -220,45 +220,64 @@ do {
220
220
do {
221
221
nonisolated
222
222
func nonisolatedF(){
223
+
letx=0
224
+
223
225
let _ ={()->Voidin}
224
226
225
227
let _ ={@concurrent()async->Voidin}
226
228
let _ ={@MainActor()async->Voidin}
227
229
228
230
// expected-warning@+1:13 {{feature 'NonisolatedNonsendingByDefault' will cause nonisolated async closure to run on the caller's actor; use @concurrent to preserve behavior}}{{15-15=@concurrent }}{{none}}
229
231
let _ ={()async->Voidin}
230
-
231
-
func takesInts(_:Int...){}
232
+
// expected-warning@+1:13 {{feature 'NonisolatedNonsendingByDefault' will cause nonisolated async closure to run on the caller's actor; use @concurrent to preserve behavior}}{{15-15=@concurrent }}{{none}}
233
+
let _ ={[x]()async->Voidin _ = x }
232
234
233
235
// expected-warning@+1:13 {{feature 'NonisolatedNonsendingByDefault' will cause nonisolated async closure to run on the caller's actor; use @concurrent to preserve behavior}}{{14-14= @concurrent in }}{{none}}
234
236
let _ ={awaitglobalAsyncF()}
237
+
// expected-warning@+1:13 {{feature 'NonisolatedNonsendingByDefault' will cause nonisolated async closure to run on the caller's actor; use @concurrent to preserve behavior}}{{14-14=@concurrent }}{{none}}
238
+
let _ ={[x]inawaitglobalAsyncF(); _ = x}
239
+
235
240
// expected-warning@+1:13 {{feature 'NonisolatedNonsendingByDefault' will cause nonisolated async closure to run on the caller's actor; use @concurrent to preserve behavior}}{{14-14= @concurrent in }}{{none}}
236
241
let _ ={
237
242
awaitglobalAsyncF()
238
243
}
239
244
// expected-warning@+1:13 {{feature 'NonisolatedNonsendingByDefault' will cause nonisolated async closure to run on the caller's actor; use @concurrent to preserve behavior}}{{14-14= @concurrent in }}{{none}}
240
245
let _ ={
241
246
awaitglobalAsyncF()
247
+
func takesInts(_:Int...){}
242
248
takesInts($0, $1, $2)
243
249
}
250
+
244
251
// expected-warning@+1:13 {{feature 'NonisolatedNonsendingByDefault' will cause nonisolated async closure to run on the caller's actor; use @concurrent to preserve behavior}}{{25-25=@concurrent }}{{none}}
245
252
let _ ={@Sendablein
246
253
awaitglobalAsyncF()
247
254
}
255
+
// expected-warning@+1:13 {{feature 'NonisolatedNonsendingByDefault' will cause nonisolated async closure to run on the caller's actor; use @concurrent to preserve behavior}}{{25-25=@concurrent }}{{none}}
256
+
let _ ={@Sendable[x]in
257
+
_ = x
258
+
awaitglobalAsyncF()
259
+
}
260
+
248
261
// expected-warning@+2:18 {{feature 'NonisolatedNonsendingByDefault' will cause nonisolated async function type to be treated as specified to run on the caller's actor; use @concurrent to preserve behavior}}{{18-18=@concurrent }}{{none}}
249
262
// expected-warning@+1:45 {{feature 'NonisolatedNonsendingByDefault' will cause nonisolated async closure to run on the caller's actor; use @concurrent to preserve behavior}}{{47-47=@concurrent }}{{none}}
250
263
varclosure:(Int,Int)async->Void={ a, b in
251
264
awaitglobalAsyncF()
252
265
}
266
+
// expected-warning@+1:15 {{feature 'NonisolatedNonsendingByDefault' will cause nonisolated async closure to run on the caller's actor; use @concurrent to preserve behavior}}{{17-17=@concurrent }}{{none}}
267
+
closure ={[x] a, b in _ = x }
253
268
// expected-warning@+1:15 {{feature 'NonisolatedNonsendingByDefault' will cause nonisolated async closure to run on the caller's actor; use @concurrent to preserve behavior}}{{+1:7-7=@concurrent }}{{none}}
254
269
closure ={
255
-
a, b asyncin
256
-
awaitglobalAsyncF()
270
+
a, b asyncin()
257
271
}
258
-
// expected-warning@+1:15 {{feature 'NonisolatedNonsendingByDefault' will cause nonisolated async closure to run on the caller's actor; use @concurrent to preserve behavior}}{{17-17=@concurrent }}{{none}}
259
-
closure ={(a, b)in
260
-
awaitglobalAsyncF()
272
+
// expected-warning@+1:15 {{feature 'NonisolatedNonsendingByDefault' will cause nonisolated async closure to run on the caller's actor; use @concurrent to preserve behavior}}{{+1:7-7=@concurrent }}{{none}}
273
+
closure ={
274
+
[x] a, b asyncin _ = x
261
275
}
276
+
// expected-warning@+1:15 {{feature 'NonisolatedNonsendingByDefault' will cause nonisolated async closure to run on the caller's actor; use @concurrent to preserve behavior}}{{17-17=@concurrent }}{{none}}
277
+
closure ={(a, b)in()}
278
+
279
+
// expected-warning@+1:15 {{feature 'NonisolatedNonsendingByDefault' will cause nonisolated async closure to run on the caller's actor; use @concurrent to preserve behavior}}{{17-17=@concurrent }}{{none}}
0 commit comments