Skip to content

Commit 9c61dbb

Browse files
authored
Merge pull request #38531 from hamishknight/out-of-sync
2 parents e12a81a + 007b91c commit 9c61dbb

File tree

4 files changed

+43
-43
lines changed

4 files changed

+43
-43
lines changed

lib/IDE/Refactoring.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5943,7 +5943,7 @@ class AsyncConverter : private SourceEntityWalker {
59435943
FuncDecl *FD = cast<FuncDecl>(StartNode.get<Decl *>());
59445944

59455945
OS << tok::l_brace << "\n"; // start function body
5946-
OS << "async " << tok::l_brace << "\n";
5946+
OS << "Task " << tok::l_brace << "\n";
59475947
addHoistedNamedCallback(FD, TopHandler, TopHandler.getNameStr(), [&]() {
59485948
if (TopHandler.HasError) {
59495949
OS << tok::kw_try << " ";
@@ -5952,7 +5952,7 @@ class AsyncConverter : private SourceEntityWalker {
59525952
addCallToAsyncMethod(FD, TopHandler);
59535953
});
59545954
OS << "\n";
5955-
OS << tok::r_brace << "\n"; // end 'async'
5955+
OS << tok::r_brace << "\n"; // end 'Task'
59565956
OS << tok::r_brace << "\n"; // end function body
59575957
return true;
59585958
}
@@ -7661,7 +7661,7 @@ class AsyncConverter : private SourceEntityWalker {
76617661
// causes the following legacy body to be created:
76627662
//
76637663
// func foo(completion: (String, Int) -> Void) {
7664-
// async {
7664+
// Task {
76657665
// let result = await foo()
76667666
// completion(result.0, result.1)
76677667
// }
@@ -7745,7 +7745,7 @@ class AsyncConverter : private SourceEntityWalker {
77457745
/// we generate
77467746
/// \code
77477747
/// func foo<GenericParam>(completion: (GenericParam) -> Void) {
7748-
/// async {
7748+
/// Task {
77497749
/// let result: GenericParam = await foo()
77507750
/// <------------>
77517751
/// completion(result)

test/refactoring/ConvertAsync/async_attribute_added.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ func simple(completion: @escaping (String) -> Void) { }
1010
// SIMPLE-EMPTY:
1111
// SIMPLE-NEXT: async_attribute_added.swift [[# @LINE-7]]:53 -> [[# @LINE-7]]:56
1212
// SIMPLE-NEXT: {
13-
// SIMPLE-NEXT: async {
13+
// SIMPLE-NEXT: Task {
1414
// SIMPLE-NEXT: let result = await simple()
1515
// SIMPLE-NEXT: completion(result)
1616
// SIMPLE-NEXT: }

test/refactoring/ConvertAsync/basic.swift

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func simple(completion: (String) -> Void) { }
2121
// ASYNC-SIMPLE-EMPTY:
2222
// ASYNC-SIMPLE-NEXT: basic.swift [[# @LINE-4]]:43 -> [[# @LINE-4]]:46
2323
// ASYNC-SIMPLE-NEXT: {
24-
// ASYNC-SIMPLE-NEXT: async {
24+
// ASYNC-SIMPLE-NEXT: Task {
2525
// ASYNC-SIMPLE-NEXT: let result = await simple()
2626
// ASYNC-SIMPLE-NEXT: completion(result)
2727
// ASYNC-SIMPLE-NEXT: }
@@ -37,7 +37,7 @@ func simple(completion: (String) -> Void) { }
3737
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=ASYNC-SIMPLENOLABEL %s
3838
func simpleWithoutLabel(_ completion: (String) -> Void) { }
3939
// ASYNC-SIMPLENOLABEL: {
40-
// ASYNC-SIMPLENOLABEL-NEXT: async {
40+
// ASYNC-SIMPLENOLABEL-NEXT: Task {
4141
// ASYNC-SIMPLENOLABEL-NEXT: let result = await simpleWithoutLabel()
4242
// ASYNC-SIMPLENOLABEL-NEXT: completion(result)
4343
// ASYNC-SIMPLENOLABEL-NEXT: }
@@ -47,7 +47,7 @@ func simpleWithoutLabel(_ completion: (String) -> Void) { }
4747
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=ASYNC-SIMPLEWITHARG %s
4848
func simpleWithArg(a: Int, completion: (String) -> Void) { }
4949
// ASYNC-SIMPLEWITHARG: {
50-
// ASYNC-SIMPLEWITHARG-NEXT: async {
50+
// ASYNC-SIMPLEWITHARG-NEXT: Task {
5151
// ASYNC-SIMPLEWITHARG-NEXT: let result = await simpleWithArg(a: a)
5252
// ASYNC-SIMPLEWITHARG-NEXT: completion(result)
5353
// ASYNC-SIMPLEWITHARG-NEXT: }
@@ -57,7 +57,7 @@ func simpleWithArg(a: Int, completion: (String) -> Void) { }
5757
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=ASYNC-MULTIPLERESULTS %s
5858
func multipleResults(completion: (String, Int) -> Void) { }
5959
// ASYNC-MULTIPLERESULTS: {
60-
// ASYNC-MULTIPLERESULTS-NEXT: async {
60+
// ASYNC-MULTIPLERESULTS-NEXT: Task {
6161
// ASYNC-MULTIPLERESULTS-NEXT: let result = await multipleResults()
6262
// ASYNC-MULTIPLERESULTS-NEXT: completion(result.0, result.1)
6363
// ASYNC-MULTIPLERESULTS-NEXT: }
@@ -67,7 +67,7 @@ func multipleResults(completion: (String, Int) -> Void) { }
6767
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=ASYNC-NONOPTIONALERROR %s
6868
func nonOptionalError(completion: (String, Error) -> Void) { }
6969
// ASYNC-NONOPTIONALERROR: {
70-
// ASYNC-NONOPTIONALERROR-NEXT: async {
70+
// ASYNC-NONOPTIONALERROR-NEXT: Task {
7171
// ASYNC-NONOPTIONALERROR-NEXT: let result = await nonOptionalError()
7272
// ASYNC-NONOPTIONALERROR-NEXT: completion(result.0, result.1)
7373
// ASYNC-NONOPTIONALERROR-NEXT: }
@@ -77,7 +77,7 @@ func nonOptionalError(completion: (String, Error) -> Void) { }
7777
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=ASYNC-NOPARAMS %s
7878
func noParams(completion: () -> Void) { }
7979
// ASYNC-NOPARAMS: {
80-
// ASYNC-NOPARAMS-NEXT: async {
80+
// ASYNC-NOPARAMS-NEXT: Task {
8181
// ASYNC-NOPARAMS-NEXT: await noParams()
8282
// ASYNC-NOPARAMS-NEXT: completion()
8383
// ASYNC-NOPARAMS-NEXT: }
@@ -87,7 +87,7 @@ func noParams(completion: () -> Void) { }
8787
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=ASYNC-ERROR %s
8888
func error(completion: (String?, Error?) -> Void) { }
8989
// ASYNC-ERROR: {
90-
// ASYNC-ERROR-NEXT: async {
90+
// ASYNC-ERROR-NEXT: Task {
9191
// ASYNC-ERROR-NEXT: do {
9292
// ASYNC-ERROR-NEXT: let result = try await error()
9393
// ASYNC-ERROR-NEXT: completion(result, nil)
@@ -100,7 +100,7 @@ func error(completion: (String?, Error?) -> Void) { }
100100
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=ASYNC-ERRORONLY %s
101101
func errorOnly(completion: (Error?) -> Void) { }
102102
// ASYNC-ERRORONLY: {
103-
// ASYNC-ERRORONLY-NEXT: async {
103+
// ASYNC-ERRORONLY-NEXT: Task {
104104
// ASYNC-ERRORONLY-NEXT: do {
105105
// ASYNC-ERRORONLY-NEXT: try await errorOnly()
106106
// ASYNC-ERRORONLY-NEXT: completion(nil)
@@ -114,7 +114,7 @@ func errorOnly(completion: (Error?) -> Void) { }
114114
// RUN: %refactor -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=ASYNC-ERRORNONOPTIONALRESULT %s
115115
func errorNonOptionalResult(completion: (String, Error?) -> Void) { }
116116
// ASYNC-ERRORNONOPTIONALRESULT: {
117-
// ASYNC-ERRORNONOPTIONALRESULT-NEXT: async {
117+
// ASYNC-ERRORNONOPTIONALRESULT-NEXT: Task {
118118
// ASYNC-ERRORNONOPTIONALRESULT-NEXT: do {
119119
// ASYNC-ERRORNONOPTIONALRESULT-NEXT: let result = try await errorNonOptionalResult()
120120
// ASYNC-ERRORNONOPTIONALRESULT-NEXT: completion(result, nil)
@@ -128,7 +128,7 @@ func errorNonOptionalResult(completion: (String, Error?) -> Void) { }
128128
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=ASYNC-CUSTOMERROR %s
129129
func customError(completion: (String?, CustomError?) -> Void) { }
130130
// ASYNC-CUSTOMERROR: {
131-
// ASYNC-CUSTOMERROR-NEXT: async {
131+
// ASYNC-CUSTOMERROR-NEXT: Task {
132132
// ASYNC-CUSTOMERROR-NEXT: do {
133133
// ASYNC-CUSTOMERROR-NEXT: let result = try await customError()
134134
// ASYNC-CUSTOMERROR-NEXT: completion(result, nil)
@@ -142,7 +142,7 @@ func customError(completion: (String?, CustomError?) -> Void) { }
142142
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=ASYNC-ALIAS %s
143143
func alias(completion: SomeCallback) { }
144144
// ASYNC-ALIAS: {
145-
// ASYNC-ALIAS-NEXT: async {
145+
// ASYNC-ALIAS-NEXT: Task {
146146
// ASYNC-ALIAS-NEXT: let result = await alias()
147147
// ASYNC-ALIAS-NEXT: completion(result)
148148
// ASYNC-ALIAS-NEXT: }
@@ -152,7 +152,7 @@ func alias(completion: SomeCallback) { }
152152
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=ASYNC-NESTEDALIAS %s
153153
func nestedAlias(completion: NestedAliasCallback) { }
154154
// ASYNC-NESTEDALIAS: {
155-
// ASYNC-NESTEDALIAS-NEXT: async {
155+
// ASYNC-NESTEDALIAS-NEXT: Task {
156156
// ASYNC-NESTEDALIAS-NEXT: let result = await nestedAlias()
157157
// ASYNC-NESTEDALIAS-NEXT: completion(result)
158158
// ASYNC-NESTEDALIAS-NEXT: }
@@ -162,7 +162,7 @@ func nestedAlias(completion: NestedAliasCallback) { }
162162
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=ASYNC-SIMPLERESULT %s
163163
func simpleResult(completion: (Result<String, Never>) -> Void) { }
164164
// ASYNC-SIMPLERESULT: {
165-
// ASYNC-SIMPLERESULT-NEXT: async {
165+
// ASYNC-SIMPLERESULT-NEXT: Task {
166166
// ASYNC-SIMPLERESULT-NEXT: let result = await simpleResult()
167167
// ASYNC-SIMPLERESULT-NEXT: completion(.success(result))
168168
// ASYNC-SIMPLERESULT-NEXT: }
@@ -172,7 +172,7 @@ func simpleResult(completion: (Result<String, Never>) -> Void) { }
172172
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=ASYNC-ERRORRESULT %s
173173
func errorResult(completion: (Result<String, Error>) -> Void) { }
174174
// ASYNC-ERRORRESULT: {
175-
// ASYNC-ERRORRESULT-NEXT: async {
175+
// ASYNC-ERRORRESULT-NEXT: Task {
176176
// ASYNC-ERRORRESULT-NEXT: do {
177177
// ASYNC-ERRORRESULT-NEXT: let result = try await errorResult()
178178
// ASYNC-ERRORRESULT-NEXT: completion(.success(result))
@@ -186,7 +186,7 @@ func errorResult(completion: (Result<String, Error>) -> Void) { }
186186
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=ASYNC-CUSTOMERRORRESULT %s
187187
func customErrorResult(completion: (Result<String, CustomError>) -> Void) { }
188188
// ASYNC-CUSTOMERRORRESULT: {
189-
// ASYNC-CUSTOMERRORRESULT-NEXT: async {
189+
// ASYNC-CUSTOMERRORRESULT-NEXT: Task {
190190
// ASYNC-CUSTOMERRORRESULT-NEXT: do {
191191
// ASYNC-CUSTOMERRORRESULT-NEXT: let result = try await customErrorResult()
192192
// ASYNC-CUSTOMERRORRESULT-NEXT: completion(.success(result))
@@ -200,7 +200,7 @@ func customErrorResult(completion: (Result<String, CustomError>) -> Void) { }
200200
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=ASYNC-ALIASRESULT %s
201201
func aliasedResult(completion: SomeResultCallback) { }
202202
// ASYNC-ALIASRESULT: {
203-
// ASYNC-ALIASRESULT-NEXT: async {
203+
// ASYNC-ALIASRESULT-NEXT: Task {
204204
// ASYNC-ALIASRESULT-NEXT: do {
205205
// ASYNC-ALIASRESULT-NEXT: let result = try await aliasedResult()
206206
// ASYNC-ALIASRESULT-NEXT: completion(.success(result))
@@ -214,7 +214,7 @@ func aliasedResult(completion: SomeResultCallback) { }
214214
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=MANY %s
215215
func many(_ completion: (String, Int) -> Void) { }
216216
// MANY: {
217-
// MANY-NEXT: async {
217+
// MANY-NEXT: Task {
218218
// MANY-NEXT: let result = await many()
219219
// MANY-NEXT: completion(result.0, result.1)
220220
// MANY-NEXT: }
@@ -224,7 +224,7 @@ func many(_ completion: (String, Int) -> Void) { }
224224
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=OPTIONAL-SINGLE %s
225225
func optionalSingle(completion: (String?) -> Void) { }
226226
// OPTIONAL-SINGLE: {
227-
// OPTIONAL-SINGLE-NEXT: async {
227+
// OPTIONAL-SINGLE-NEXT: Task {
228228
// OPTIONAL-SINGLE-NEXT: let result = await optionalSingle()
229229
// OPTIONAL-SINGLE-NEXT: completion(result)
230230
// OPTIONAL-SINGLE-NEXT: }
@@ -234,7 +234,7 @@ func optionalSingle(completion: (String?) -> Void) { }
234234
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=MANY-OPTIONAL %s
235235
func manyOptional(_ completion: (String?, Int?) -> Void) { }
236236
// MANY-OPTIONAL: {
237-
// MANY-OPTIONAL-NEXT: async {
237+
// MANY-OPTIONAL-NEXT: Task {
238238
// MANY-OPTIONAL-NEXT: let result = await manyOptional()
239239
// MANY-OPTIONAL-NEXT: completion(result.0, result.1)
240240
// MANY-OPTIONAL-NEXT: }
@@ -244,7 +244,7 @@ func manyOptional(_ completion: (String?, Int?) -> Void) { }
244244
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=MIXED %s
245245
func mixed(_ completion: (String?, Int) -> Void) { }
246246
// MIXED: {
247-
// MIXED-NEXT: async {
247+
// MIXED-NEXT: Task {
248248
// MIXED-NEXT: let result = await mixed()
249249
// MIXED-NEXT: completion(result.0, result.1)
250250
// MIXED-NEXT: }
@@ -254,7 +254,7 @@ func mixed(_ completion: (String?, Int) -> Void) { }
254254
// RUN: %refactor -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1
255255
func mixedOptionalError(_ completion: (String?, Int, Error?) -> Void) { }
256256
// MIXED-OPTIONAL-ERROR: {
257-
// MIXED-OPTIONAL-ERROR-NEXT: async {
257+
// MIXED-OPTIONAL-ERROR-NEXT: Task {
258258
// MIXED-OPTIONAL-ERROR-NEXT: do {
259259
// MIXED-OPTIONAL-ERROR-NEXT: let result = try await mixedOptionalError()
260260
// MIXED-OPTIONAL-ERROR-NEXT: completion(result.0, result.1, nil)
@@ -268,7 +268,7 @@ func mixedOptionalError(_ completion: (String?, Int, Error?) -> Void) { }
268268
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=MIXED-ERROR %s
269269
func mixedError(_ completion: (String?, Int, Error) -> Void) { }
270270
// MIXED-ERROR: {
271-
// MIXED-ERROR-NEXT: async {
271+
// MIXED-ERROR-NEXT: Task {
272272
// MIXED-ERROR-NEXT: let result = await mixedError()
273273
// MIXED-ERROR-NEXT: completion(result.0, result.1, result.2)
274274
// MIXED-ERROR-NEXT: }
@@ -278,7 +278,7 @@ func mixedError(_ completion: (String?, Int, Error) -> Void) { }
278278
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=GENERIC %s
279279
func generic<T, R>(completion: (T, R) -> Void) { }
280280
// GENERIC: {
281-
// GENERIC-NEXT: async {
281+
// GENERIC-NEXT: Task {
282282
// GENERIC-NEXT: let result: (T, R) = await generic()
283283
// GENERIC-NEXT: completion(result.0, result.1)
284284
// GENERIC-NEXT: }
@@ -288,7 +288,7 @@ func generic<T, R>(completion: (T, R) -> Void) { }
288288
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=GENERIC-RESULT %s
289289
func genericResult<T>(completion: (T?, Error?) -> Void) where T: Numeric { }
290290
// GENERIC-RESULT: {
291-
// GENERIC-RESULT-NEXT: async {
291+
// GENERIC-RESULT-NEXT: Task {
292292
// GENERIC-RESULT-NEXT: do {
293293
// GENERIC-RESULT-NEXT: let result: T = try await genericResult()
294294
// GENERIC-RESULT-NEXT: completion(result, nil)
@@ -303,7 +303,7 @@ func genericResult<T>(completion: (T?, Error?) -> Void) where T: Numeric { }
303303
// RUN: %refactor -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=GENERIC-ERROR %s
304304
func genericError<E>(completion: (String?, E?) -> Void) where E: Error { }
305305
// GENERIC-ERROR: {
306-
// GENERIC-ERROR-NEXT: async {
306+
// GENERIC-ERROR-NEXT: Task {
307307
// GENERIC-ERROR-NEXT: do {
308308
// GENERIC-ERROR-NEXT: let result: String = try await genericError()
309309
// GENERIC-ERROR-NEXT: completion(result, nil)
@@ -317,7 +317,7 @@ func genericError<E>(completion: (String?, E?) -> Void) where E: Error { }
317317
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=OTHER-NAME %s
318318
func otherName(execute: (String) -> Void) { }
319319
// OTHER-NAME: {
320-
// OTHER-NAME-NEXT: async {
320+
// OTHER-NAME-NEXT: Task {
321321
// OTHER-NAME-NEXT: let result = await otherName()
322322
// OTHER-NAME-NEXT: execute(result)
323323
// OTHER-NAME-NEXT: }
@@ -327,7 +327,7 @@ func otherName(execute: (String) -> Void) { }
327327
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix=DEFAULT_ARGS %s
328328
func defaultArgs(a: Int, b: Int = 10, completion: (String) -> Void) { }
329329
// DEFAULT_ARGS: {
330-
// DEFAULT_ARGS-NEXT: async {
330+
// DEFAULT_ARGS-NEXT: Task {
331331
// DEFAULT_ARGS-NEXT: let result = await defaultArgs(a: a, b: b)
332332
// DEFAULT_ARGS-NEXT: completion(result)
333333
// DEFAULT_ARGS-NEXT: }
@@ -419,7 +419,7 @@ func cConvention(completion: @convention(c) () -> Void) { }
419419
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix VOID-HANDLER %s
420420
func voidCompletion(completion: (Void) -> Void) {}
421421
// VOID-HANDLER: {
422-
// VOID-HANDLER-NEXT: async {
422+
// VOID-HANDLER-NEXT: Task {
423423
// VOID-HANDLER-NEXT: await voidCompletion()
424424
// VOID-HANDLER-NEXT: completion(())
425425
// VOID-HANDLER-NEXT: }
@@ -429,7 +429,7 @@ func voidCompletion(completion: (Void) -> Void) {}
429429
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix OPT-VOID-AND-ERROR-HANDLER %s
430430
func optVoidAndErrorCompletion(completion: (Void?, Error?) -> Void) {}
431431
// OPT-VOID-AND-ERROR-HANDLER: {
432-
// OPT-VOID-AND-ERROR-HANDLER-NEXT: async {
432+
// OPT-VOID-AND-ERROR-HANDLER-NEXT: Task {
433433
// OPT-VOID-AND-ERROR-HANDLER-NEXT: do {
434434
// OPT-VOID-AND-ERROR-HANDLER-NEXT: try await optVoidAndErrorCompletion()
435435
// OPT-VOID-AND-ERROR-HANDLER-NEXT: completion((), nil)
@@ -443,7 +443,7 @@ func optVoidAndErrorCompletion(completion: (Void?, Error?) -> Void) {}
443443
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix TOO-MUCH-VOID-AND-ERROR-HANDLER %s
444444
func tooMuchVoidAndErrorCompletion(completion: (Void?, Void?, Error?) -> Void) {}
445445
// TOO-MUCH-VOID-AND-ERROR-HANDLER: {
446-
// TOO-MUCH-VOID-AND-ERROR-HANDLER-NEXT: async {
446+
// TOO-MUCH-VOID-AND-ERROR-HANDLER-NEXT: Task {
447447
// TOO-MUCH-VOID-AND-ERROR-HANDLER-NEXT: do {
448448
// TOO-MUCH-VOID-AND-ERROR-HANDLER-NEXT: try await tooMuchVoidAndErrorCompletion()
449449
// TOO-MUCH-VOID-AND-ERROR-HANDLER-NEXT: completion((), (), nil)
@@ -457,7 +457,7 @@ func tooMuchVoidAndErrorCompletion(completion: (Void?, Void?, Error?) -> Void) {
457457
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1 | %FileCheck -check-prefix VOID-PROPER-AND-ERROR-HANDLER %s
458458
func tooVoidProperAndErrorCompletion(completion: (Void?, String?, Error?) -> Void) {}
459459
// VOID-PROPER-AND-ERROR-HANDLER: {
460-
// VOID-PROPER-AND-ERROR-HANDLER-NEXT: async {
460+
// VOID-PROPER-AND-ERROR-HANDLER-NEXT: Task {
461461
// VOID-PROPER-AND-ERROR-HANDLER-NEXT: do {
462462
// VOID-PROPER-AND-ERROR-HANDLER-NEXT: let result = try await tooVoidProperAndErrorCompletion()
463463
// VOID-PROPER-AND-ERROR-HANDLER-NEXT: completion((), result.1, nil)
@@ -471,7 +471,7 @@ func tooVoidProperAndErrorCompletion(completion: (Void?, String?, Error?) -> Voi
471471
// RUN: %refactor-check-compiles -add-async-alternative -dump-text -source-filename %s -pos=%(line+1):1
472472
func voidAndErrorCompletion(completion: (Void, Error?) -> Void) {}
473473
// VOID-AND-ERROR-HANDLER: {
474-
// VOID-AND-ERROR-HANDLER-NEXT: async {
474+
// VOID-AND-ERROR-HANDLER-NEXT: Task {
475475
// VOID-AND-ERROR-HANDLER-NEXT: do {
476476
// VOID-AND-ERROR-HANDLER-NEXT: try await voidAndErrorCompletion()
477477
// VOID-AND-ERROR-HANDLER-NEXT: completion((), nil)

0 commit comments

Comments
 (0)