Skip to content

Commit eaafe3f

Browse files
committed
[TaskGroup] Stop using group.spawn in warning messages
1 parent 7020cf3 commit eaafe3f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

stdlib/public/Concurrency/TaskLocal.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ static void swift_task_reportIllegalTaskLocalBindingWithinWithTaskGroupImpl(
248248
"The following example is illegal:\n\n"
249249
" await withTaskGroup(...) { group in \n"
250250
" await <task-local>.withValue(1234) {\n"
251-
" group.spawn { ... }\n"
251+
" group.addTask { ... }\n"
252252
" }\n"
253253
" }\n"
254254
"\n"
@@ -257,21 +257,21 @@ static void swift_task_reportIllegalTaskLocalBindingWithinWithTaskGroupImpl(
257257
" // bind task-local for all tasks spawned within the group\n"
258258
" await <task-local>.withValue(1234) {\n"
259259
" await withTaskGroup(...) { group in\n"
260-
" group.spawn { ... }\n"
260+
" group.addTask { ... }\n"
261261
" }\n"
262262
" }\n"
263263
"\n"
264264
"or, inside the specific task-group child task:\n"
265265
"\n"
266266
" // bind-task-local for only specific child-task\n"
267267
" await withTaskGroup(...) { group in\n"
268-
" group.spawn {\n"
268+
" group.addTask {\n"
269269
" await <task-local>.withValue(1234) {\n"
270270
" ... \n"
271271
" }\n"
272272
" }\n"
273273
"\n"
274-
" group.spawn { ... }\n"
274+
" group.addTask { ... }\n"
275275
" }\n",
276276
(int)fileLength, file,
277277
(int)line);

0 commit comments

Comments
 (0)