@@ -155,7 +155,7 @@ func tryDo4() throws -> Int {
155155func tryDo5( ) throws -> Int {
156156 return try do { tryDo4 ( ) }
157157 // expected-warning@-1 {{'try' has no effect on 'do' expression}}
158- // expected-error @-2 {{call can throw but is not marked with 'try'}}
158+ // expected-warning @-2 {{call can throw but is not marked with 'try'; this is an error in Swift 6 }}
159159 // expected-note@-3 {{did you mean to use 'try'?}}
160160 // expected-note@-4 {{did you mean to handle error as optional value?}}
161161 // expected-note@-5 {{did you mean to disable error propagation?}}
@@ -164,7 +164,7 @@ func tryDo5() throws -> Int {
164164func tryDo6( ) throws -> Int {
165165 try do { tryDo4 ( ) }
166166 // expected-warning@-1 {{'try' has no effect on 'do' expression}}
167- // expected-error @-2 {{call can throw but is not marked with 'try'}}
167+ // expected-warning @-2 {{call can throw but is not marked with 'try'; this is an error in Swift 6 }}
168168 // expected-note@-3 {{did you mean to use 'try'?}}
169169 // expected-note@-4 {{did you mean to handle error as optional value?}}
170170 // expected-note@-5 {{did you mean to disable error propagation?}}
@@ -173,7 +173,7 @@ func tryDo6() throws -> Int {
173173func tryDo7( ) throws -> Int {
174174 let x = try do { tryDo4 ( ) }
175175 // expected-warning@-1 {{'try' has no effect on 'do' expression}}
176- // expected-error @-2 {{call can throw but is not marked with 'try'}}
176+ // expected-warning @-2 {{call can throw but is not marked with 'try'; this is an error in Swift 6 }}
177177 // expected-note@-3 {{did you mean to use 'try'?}}
178178 // expected-note@-4 {{did you mean to handle error as optional value?}}
179179 // expected-note@-5 {{did you mean to disable error propagation?}}
@@ -199,7 +199,7 @@ func tryDo10() throws -> Int {
199199func tryDo11( ) throws -> Int {
200200 let x = try do { try tryDo4 ( ) } catch { tryDo4 ( ) }
201201 // expected-warning@-1 {{'try' has no effect on 'do-catch' expression}}
202- // expected-error @-2 {{call can throw but is not marked with 'try'}}
202+ // expected-warning @-2 {{call can throw but is not marked with 'try'; this is an error in Swift 6 }}
203203 // expected-note@-3 {{did you mean to use 'try'?}}
204204 // expected-note@-4 {{did you mean to handle error as optional value?}}
205205 // expected-note@-5 {{did you mean to disable error propagation?}}
@@ -209,7 +209,7 @@ func tryDo11() throws -> Int {
209209func tryDo12( ) throws -> Int {
210210 let x = try do { tryDo4 ( ) } catch { tryDo4 ( ) }
211211 // expected-warning@-1 {{'try' has no effect on 'do-catch' expression}}
212- // expected-error @-2 2{{call can throw but is not marked with 'try'}}
212+ // expected-warning @-2 2{{call can throw but is not marked with 'try'; this is an error in Swift 6 }}
213213 // expected-note@-3 2{{did you mean to use 'try'?}}
214214 // expected-note@-4 2{{did you mean to handle error as optional value?}}
215215 // expected-note@-5 2{{did you mean to disable error propagation?}}
@@ -219,13 +219,13 @@ func tryDo12() throws -> Int {
219219func tryDo13( ) throws -> Int {
220220 let x = try do { // expected-warning {{'try' has no effect on 'do-catch' expression}}
221221 tryDo4 ( ) // expected-warning {{result of call to 'tryDo4()' is unused}}
222- // expected-error @-1 {{call can throw but is not marked with 'try'}}
222+ // expected-warning @-1 {{call can throw but is not marked with 'try'; this is an error in Swift 6 }}
223223 // expected-note@-2 {{did you mean to use 'try'?}}
224224 // expected-note@-3 {{did you mean to handle error as optional value?}}
225225 // expected-note@-4 {{did you mean to disable error propagation?}}
226226
227227 _ = tryDo4 ( )
228- // expected-error @-1 {{call can throw but is not marked with 'try'}}
228+ // expected-warning @-1 {{call can throw but is not marked with 'try'; this is an error in Swift 6 }}
229229 // expected-note@-2 {{did you mean to use 'try'?}}
230230 // expected-note@-3 {{did you mean to handle error as optional value?}}
231231 // expected-note@-4 {{did you mean to disable error propagation?}}
@@ -409,21 +409,21 @@ func awaitDo4() async -> Int {
409409func awaitDo5( ) async -> Int {
410410 return await do { awaitDo4 ( ) }
411411 // expected-warning@-1 {{'await' has no effect on 'do' expression}}
412- // expected-error @-2 {{expression is 'async' but is not marked with 'await'}}
412+ // expected-warning @-2 {{expression is 'async' but is not marked with 'await'}}
413413 // expected-note@-3 {{call is 'async'}}
414414}
415415
416416func awaitDo6( ) async -> Int {
417417 await do { awaitDo4 ( ) }
418418 // expected-warning@-1 {{'await' has no effect on 'do' expression}}
419- // expected-error @-2 {{expression is 'async' but is not marked with 'await'}}
419+ // expected-warning @-2 {{expression is 'async' but is not marked with 'await'}}
420420 // expected-note@-3 {{call is 'async'}}
421421}
422422
423423func awaitDo7( ) async -> Int {
424424 let x = await do { awaitDo4 ( ) }
425425 // expected-warning@-1 {{'await' has no effect on 'do' expression}}
426- // expected-error @-2 {{expression is 'async' but is not marked with 'await'}}
426+ // expected-warning @-2 {{expression is 'async' but is not marked with 'await'}}
427427 // expected-note@-3 {{call is 'async'}}
428428 return x
429429}
@@ -447,27 +447,27 @@ func awaitDo10() async -> Int {
447447func awaitDo11( ) async -> Int {
448448 let x = await do { try await tryAwaitDo1 ( ) } catch { awaitDo4 ( ) }
449449 // expected-warning@-1 {{'await' has no effect on 'do-catch' expression}}
450- // expected-error @-2 {{expression is 'async' but is not marked with 'await'}}
450+ // expected-warning @-2 {{expression is 'async' but is not marked with 'await'; this is an error in Swift 6 }}
451451 // expected-note@-3 {{call is 'async'}}
452452 return x
453453}
454454
455455func awaitDo12( ) async -> Int {
456456 let x = await do { try tryAwaitDo1 ( ) } catch { awaitDo4 ( ) }
457457 // expected-warning@-1 {{'await' has no effect on 'do-catch' expression}}
458- // expected-error @-2 2{{expression is 'async' but is not marked with 'await'}}
458+ // expected-warning @-2 2{{expression is 'async' but is not marked with 'await'; this is an error in Swift 6 }}
459459 // expected-note@-3 2{{call is 'async'}}
460460 return x
461461}
462462
463463func awaitDo13( ) async throws -> Int {
464464 let x = await do { // expected-warning {{'await' has no effect on 'do-catch' expression}}
465465 awaitDo4 ( ) // expected-warning {{result of call to 'awaitDo4()' is unused}}
466- // expected-error @-1 {{expression is 'async' but is not marked with 'await'}}
466+ // expected-warning @-1 {{expression is 'async' but is not marked with 'await'; this is an error in Swift 6 }}
467467 // expected-note@-2 {{call is 'async'}}
468468
469469 _ = awaitDo4 ( )
470- // expected-error @-1 {{expression is 'async' but is not marked with 'await'}}
470+ // expected-warning @-1 {{expression is 'async' but is not marked with 'await'; this is an error in Swift 6 }}
471471 // expected-note@-2 {{call is 'async'}}
472472
473473 _ = await awaitDo4 ( ) // Okay.
@@ -543,27 +543,27 @@ func tryAwaitDo3() async throws -> Int {
543543 try await do { tryAwaitDo2 ( ) } as Int
544544 // expected-warning@-1 {{'try' has no effect on 'do' expression}}
545545 // expected-warning@-2 {{'await' has no effect on 'do' expression}}
546- // expected-error @-3 {{call can throw but is not marked with 'try'}}
546+ // expected-warning @-3 {{call can throw but is not marked with 'try'; this is an error in Swift 6 }}
547547 // expected-note@-4 {{did you mean to use 'try'?}}
548548 // expected-note@-5 {{did you mean to handle error as optional value?}}
549549 // expected-note@-6 {{did you mean to disable error propagation?}}
550- // expected-error @-7 {{expression is 'async' but is not marked with 'await'}}
550+ // expected-warning @-7 {{expression is 'async' but is not marked with 'await'; this is an error in Swift 6 }}
551551 // expected-note@-8 {{call is 'async'}}
552552}
553553
554554func tryAwaitDo4( ) async throws -> Int {
555555 try await do { try tryAwaitDo2 ( ) } as Int
556556 // expected-warning@-1 {{'try' has no effect on 'do' expression}}
557557 // expected-warning@-2 {{'await' has no effect on 'do' expression}}
558- // expected-error @-3 {{expression is 'async' but is not marked with 'await'}}
558+ // expected-warning @-3 {{expression is 'async' but is not marked with 'await'; this is an error in Swift 6 }}
559559 // expected-note@-4 {{call is 'async'}}
560560}
561561
562562func tryAwaitDo5( ) async throws -> Int {
563563 try await do { await tryAwaitDo2 ( ) } as Int
564564 // expected-warning@-1 {{'try' has no effect on 'do' expression}}
565565 // expected-warning@-2 {{'await' has no effect on 'do' expression}}
566- // expected-error @-3 {{call can throw but is not marked with 'try'}}
566+ // expected-warning @-3 {{call can throw but is not marked with 'try'; this is an error in Swift 6 }}
567567 // expected-note@-4 {{did you mean to use 'try'?}}
568568 // expected-note@-5 {{did you mean to handle error as optional value?}}
569569 // expected-note@-6 {{did you mean to disable error propagation?}}
@@ -579,27 +579,27 @@ func tryAwaitDo7() async throws -> Int {
579579 try await do { tryAwaitDo2 ( ) }
580580 // expected-warning@-1 {{'try' has no effect on 'do' expression}}
581581 // expected-warning@-2 {{'await' has no effect on 'do' expression}}
582- // expected-error @-3 {{call can throw but is not marked with 'try'}}
582+ // expected-warning @-3 {{call can throw but is not marked with 'try'; this is an error in Swift 6 }}
583583 // expected-note@-4 {{did you mean to use 'try'?}}
584584 // expected-note@-5 {{did you mean to handle error as optional value?}}
585585 // expected-note@-6 {{did you mean to disable error propagation?}}
586- // expected-error @-7 {{expression is 'async' but is not marked with 'await'}}
586+ // expected-warning @-7 {{expression is 'async' but is not marked with 'await'; this is an error in Swift 6 }}
587587 // expected-note@-8 {{call is 'async'}}
588588}
589589
590590func tryAwaitDo8( ) async throws -> Int {
591591 try await do { try tryAwaitDo2 ( ) }
592592 // expected-warning@-1 {{'try' has no effect on 'do' expression}}
593593 // expected-warning@-2 {{'await' has no effect on 'do' expression}}
594- // expected-error @-3 {{expression is 'async' but is not marked with 'await'}}
594+ // expected-warning @-3 {{expression is 'async' but is not marked with 'await'; this is an error in Swift 6 }}
595595 // expected-note@-4 {{call is 'async'}}
596596}
597597
598598func tryAwaitDo9( ) async throws -> Int {
599599 try await do { await tryAwaitDo2 ( ) }
600600 // expected-warning@-1 {{'try' has no effect on 'do' expression}}
601601 // expected-warning@-2 {{'await' has no effect on 'do' expression}}
602- // expected-error @-3 {{call can throw but is not marked with 'try'}}
602+ // expected-warning @-3 {{call can throw but is not marked with 'try'; this is an error in Swift 6 }}
603603 // expected-note@-4 {{did you mean to use 'try'?}}
604604 // expected-note@-5 {{did you mean to handle error as optional value?}}
605605 // expected-note@-6 {{did you mean to disable error propagation?}}
0 commit comments