@@ -155,7 +155,7 @@ func tryDo4() throws -> Int {
155
155
func tryDo5( ) throws -> Int {
156
156
return try do { tryDo4 ( ) }
157
157
// 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 }}
159
159
// expected-note@-3 {{did you mean to use 'try'?}}
160
160
// expected-note@-4 {{did you mean to handle error as optional value?}}
161
161
// expected-note@-5 {{did you mean to disable error propagation?}}
@@ -164,7 +164,7 @@ func tryDo5() throws -> Int {
164
164
func tryDo6( ) throws -> Int {
165
165
try do { tryDo4 ( ) }
166
166
// 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 }}
168
168
// expected-note@-3 {{did you mean to use 'try'?}}
169
169
// expected-note@-4 {{did you mean to handle error as optional value?}}
170
170
// expected-note@-5 {{did you mean to disable error propagation?}}
@@ -173,7 +173,7 @@ func tryDo6() throws -> Int {
173
173
func tryDo7( ) throws -> Int {
174
174
let x = try do { tryDo4 ( ) }
175
175
// 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 }}
177
177
// expected-note@-3 {{did you mean to use 'try'?}}
178
178
// expected-note@-4 {{did you mean to handle error as optional value?}}
179
179
// expected-note@-5 {{did you mean to disable error propagation?}}
@@ -199,7 +199,7 @@ func tryDo10() throws -> Int {
199
199
func tryDo11( ) throws -> Int {
200
200
let x = try do { try tryDo4 ( ) } catch { tryDo4 ( ) }
201
201
// 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 }}
203
203
// expected-note@-3 {{did you mean to use 'try'?}}
204
204
// expected-note@-4 {{did you mean to handle error as optional value?}}
205
205
// expected-note@-5 {{did you mean to disable error propagation?}}
@@ -209,7 +209,7 @@ func tryDo11() throws -> Int {
209
209
func tryDo12( ) throws -> Int {
210
210
let x = try do { tryDo4 ( ) } catch { tryDo4 ( ) }
211
211
// 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 }}
213
213
// expected-note@-3 2{{did you mean to use 'try'?}}
214
214
// expected-note@-4 2{{did you mean to handle error as optional value?}}
215
215
// expected-note@-5 2{{did you mean to disable error propagation?}}
@@ -219,13 +219,13 @@ func tryDo12() throws -> Int {
219
219
func tryDo13( ) throws -> Int {
220
220
let x = try do { // expected-warning {{'try' has no effect on 'do-catch' expression}}
221
221
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 }}
223
223
// expected-note@-2 {{did you mean to use 'try'?}}
224
224
// expected-note@-3 {{did you mean to handle error as optional value?}}
225
225
// expected-note@-4 {{did you mean to disable error propagation?}}
226
226
227
227
_ = 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 }}
229
229
// expected-note@-2 {{did you mean to use 'try'?}}
230
230
// expected-note@-3 {{did you mean to handle error as optional value?}}
231
231
// expected-note@-4 {{did you mean to disable error propagation?}}
@@ -409,21 +409,21 @@ func awaitDo4() async -> Int {
409
409
func awaitDo5( ) async -> Int {
410
410
return await do { awaitDo4 ( ) }
411
411
// 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'}}
413
413
// expected-note@-3 {{call is 'async'}}
414
414
}
415
415
416
416
func awaitDo6( ) async -> Int {
417
417
await do { awaitDo4 ( ) }
418
418
// 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'}}
420
420
// expected-note@-3 {{call is 'async'}}
421
421
}
422
422
423
423
func awaitDo7( ) async -> Int {
424
424
let x = await do { awaitDo4 ( ) }
425
425
// 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'}}
427
427
// expected-note@-3 {{call is 'async'}}
428
428
return x
429
429
}
@@ -447,27 +447,27 @@ func awaitDo10() async -> Int {
447
447
func awaitDo11( ) async -> Int {
448
448
let x = await do { try await tryAwaitDo1 ( ) } catch { awaitDo4 ( ) }
449
449
// 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 }}
451
451
// expected-note@-3 {{call is 'async'}}
452
452
return x
453
453
}
454
454
455
455
func awaitDo12( ) async -> Int {
456
456
let x = await do { try tryAwaitDo1 ( ) } catch { awaitDo4 ( ) }
457
457
// 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 }}
459
459
// expected-note@-3 2{{call is 'async'}}
460
460
return x
461
461
}
462
462
463
463
func awaitDo13( ) async throws -> Int {
464
464
let x = await do { // expected-warning {{'await' has no effect on 'do-catch' expression}}
465
465
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 }}
467
467
// expected-note@-2 {{call is 'async'}}
468
468
469
469
_ = 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 }}
471
471
// expected-note@-2 {{call is 'async'}}
472
472
473
473
_ = await awaitDo4 ( ) // Okay.
@@ -543,27 +543,27 @@ func tryAwaitDo3() async throws -> Int {
543
543
try await do { tryAwaitDo2 ( ) } as Int
544
544
// expected-warning@-1 {{'try' has no effect on 'do' expression}}
545
545
// 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 }}
547
547
// expected-note@-4 {{did you mean to use 'try'?}}
548
548
// expected-note@-5 {{did you mean to handle error as optional value?}}
549
549
// 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 }}
551
551
// expected-note@-8 {{call is 'async'}}
552
552
}
553
553
554
554
func tryAwaitDo4( ) async throws -> Int {
555
555
try await do { try tryAwaitDo2 ( ) } as Int
556
556
// expected-warning@-1 {{'try' has no effect on 'do' expression}}
557
557
// 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 }}
559
559
// expected-note@-4 {{call is 'async'}}
560
560
}
561
561
562
562
func tryAwaitDo5( ) async throws -> Int {
563
563
try await do { await tryAwaitDo2 ( ) } as Int
564
564
// expected-warning@-1 {{'try' has no effect on 'do' expression}}
565
565
// 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 }}
567
567
// expected-note@-4 {{did you mean to use 'try'?}}
568
568
// expected-note@-5 {{did you mean to handle error as optional value?}}
569
569
// expected-note@-6 {{did you mean to disable error propagation?}}
@@ -579,27 +579,27 @@ func tryAwaitDo7() async throws -> Int {
579
579
try await do { tryAwaitDo2 ( ) }
580
580
// expected-warning@-1 {{'try' has no effect on 'do' expression}}
581
581
// 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 }}
583
583
// expected-note@-4 {{did you mean to use 'try'?}}
584
584
// expected-note@-5 {{did you mean to handle error as optional value?}}
585
585
// 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 }}
587
587
// expected-note@-8 {{call is 'async'}}
588
588
}
589
589
590
590
func tryAwaitDo8( ) async throws -> Int {
591
591
try await do { try tryAwaitDo2 ( ) }
592
592
// expected-warning@-1 {{'try' has no effect on 'do' expression}}
593
593
// 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 }}
595
595
// expected-note@-4 {{call is 'async'}}
596
596
}
597
597
598
598
func tryAwaitDo9( ) async throws -> Int {
599
599
try await do { await tryAwaitDo2 ( ) }
600
600
// expected-warning@-1 {{'try' has no effect on 'do' expression}}
601
601
// 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 }}
603
603
// expected-note@-4 {{did you mean to use 'try'?}}
604
604
// expected-note@-5 {{did you mean to handle error as optional value?}}
605
605
// expected-note@-6 {{did you mean to disable error propagation?}}
0 commit comments