@@ -1010,7 +1010,7 @@ func tryIf4() throws -> Int {
10101010func tryIf5( ) throws -> Int {
10111011 return try if . random( ) { tryIf4 ( ) } else { 1 }
10121012 // expected-warning@-1 {{'try' has no effect on 'if' expression}}
1013- // expected-error @-2 {{call can throw but is not marked with 'try'}}
1013+ // expected-warning @-2 {{call can throw but is not marked with 'try'; this is an error in Swift 6 }}
10141014 // expected-note@-3 {{did you mean to use 'try'?}}
10151015 // expected-note@-4 {{did you mean to handle error as optional value?}}
10161016 // expected-note@-5 {{did you mean to disable error propagation?}}
@@ -1019,7 +1019,7 @@ func tryIf5() throws -> Int {
10191019func tryIf6( ) throws -> Int {
10201020 try if . random( ) { tryIf4 ( ) } else { 1 }
10211021 // expected-warning@-1 {{'try' has no effect on 'if' expression}}
1022- // expected-error @-2 {{call can throw but is not marked with 'try'}}
1022+ // expected-warning @-2 {{call can throw but is not marked with 'try'; this is an error in Swift 6 }}
10231023 // expected-note@-3 {{did you mean to use 'try'?}}
10241024 // expected-note@-4 {{did you mean to handle error as optional value?}}
10251025 // expected-note@-5 {{did you mean to disable error propagation?}}
@@ -1028,7 +1028,7 @@ func tryIf6() throws -> Int {
10281028func tryIf7( ) throws -> Int {
10291029 let x = try if . random( ) { tryIf4 ( ) } else { 1 }
10301030 // expected-warning@-1 {{'try' has no effect on 'if' expression}}
1031- // expected-error @-2 {{call can throw but is not marked with 'try'}}
1031+ // expected-warning @-2 {{call can throw but is not marked with 'try'; this is an error in Swift 6 }}
10321032 // expected-note@-3 {{did you mean to use 'try'?}}
10331033 // expected-note@-4 {{did you mean to handle error as optional value?}}
10341034 // expected-note@-5 {{did you mean to disable error propagation?}}
@@ -1054,7 +1054,7 @@ func tryIf10() throws -> Int {
10541054func tryIf11( ) throws -> Int {
10551055 let x = try if . random( ) { try tryIf4 ( ) } else { tryIf4 ( ) }
10561056 // expected-warning@-1 {{'try' has no effect on 'if' expression}}
1057- // expected-error @-2 {{call can throw but is not marked with 'try'}}
1057+ // expected-warning @-2 {{call can throw but is not marked with 'try'; this is an error in Swift 6 }}
10581058 // expected-note@-3 {{did you mean to use 'try'?}}
10591059 // expected-note@-4 {{did you mean to handle error as optional value?}}
10601060 // expected-note@-5 {{did you mean to disable error propagation?}}
@@ -1064,7 +1064,7 @@ func tryIf11() throws -> Int {
10641064func tryIf12( ) throws -> Int {
10651065 let x = try if . random( ) { tryIf4 ( ) } else { tryIf4 ( ) }
10661066 // expected-warning@-1 {{'try' has no effect on 'if' expression}}
1067- // expected-error @-2 2{{call can throw but is not marked with 'try'}}
1067+ // expected-warning @-2 2{{call can throw but is not marked with 'try'; this is an error in Swift 6 }}
10681068 // expected-note@-3 2{{did you mean to use 'try'?}}
10691069 // expected-note@-4 2{{did you mean to handle error as optional value?}}
10701070 // expected-note@-5 2{{did you mean to disable error propagation?}}
@@ -1074,13 +1074,13 @@ func tryIf12() throws -> Int {
10741074func tryIf13( ) throws -> Int {
10751075 let x = try if . random( ) { // expected-warning {{'try' has no effect on 'if' expression}}
10761076 tryIf4 ( ) // expected-warning {{result of call to 'tryIf4()' is unused}}
1077- // expected-error @-1 {{call can throw but is not marked with 'try'}}
1077+ // expected-warning @-1 {{call can throw but is not marked with 'try'; this is an error in Swift 6 }}
10781078 // expected-note@-2 {{did you mean to use 'try'?}}
10791079 // expected-note@-3 {{did you mean to handle error as optional value?}}
10801080 // expected-note@-4 {{did you mean to disable error propagation?}}
10811081
10821082 _ = tryIf4 ( )
1083- // expected-error @-1 {{call can throw but is not marked with 'try'}}
1083+ // expected-warning @-1 {{call can throw but is not marked with 'try'; this is an error in Swift 6 }}
10841084 // expected-note@-2 {{did you mean to use 'try'?}}
10851085 // expected-note@-3 {{did you mean to handle error as optional value?}}
10861086 // expected-note@-4 {{did you mean to disable error propagation?}}
@@ -1105,7 +1105,7 @@ func throwsBool() throws -> Bool { true }
11051105func tryIf14( ) throws -> Int {
11061106 try if throwsBool ( ) { 0 } else { 1 }
11071107 // expected-warning@-1 {{'try' has no effect on 'if' expression}}
1108- // expected-error @-2 {{call can throw but is not marked with 'try'}}
1108+ // expected-warning @-2 {{call can throw but is not marked with 'try'; this is an error in Swift 6 }}
11091109 // expected-note@-3 {{did you mean to use 'try'?}}
11101110 // expected-note@-4 {{did you mean to handle error as optional value?}}
11111111 // expected-note@-5 {{did you mean to disable error propagation?}}
@@ -1245,21 +1245,21 @@ func awaitIf4() async -> Int {
12451245func awaitIf5( ) async -> Int {
12461246 return await if . random( ) { awaitIf4 ( ) } else { 1 }
12471247 // expected-warning@-1 {{'await' has no effect on 'if' expression}}
1248- // expected-error @-2 {{expression is 'async' but is not marked with 'await'}}
1248+ // expected-warning @-2 {{expression is 'async' but is not marked with 'await'; this is an error in Swift 6 }}
12491249 // expected-note@-3 {{call is 'async'}}
12501250}
12511251
12521252func awaitIf6( ) async -> Int {
12531253 await if . random( ) { awaitIf4 ( ) } else { 1 }
12541254 // expected-warning@-1 {{'await' has no effect on 'if' expression}}
1255- // expected-error @-2 {{expression is 'async' but is not marked with 'await'}}
1255+ // expected-warning @-2 {{expression is 'async' but is not marked with 'await'; this is an error in Swift 6 }}
12561256 // expected-note@-3 {{call is 'async'}}
12571257}
12581258
12591259func awaitIf7( ) async -> Int {
12601260 let x = await if . random( ) { awaitIf4 ( ) } else { 1 }
12611261 // expected-warning@-1 {{'await' has no effect on 'if' expression}}
1262- // expected-error @-2 {{expression is 'async' but is not marked with 'await'}}
1262+ // expected-warning @-2 {{expression is 'async' but is not marked with 'await'; this is an error in Swift 6 }}
12631263 // expected-note@-3 {{call is 'async'}}
12641264 return x
12651265}
@@ -1283,27 +1283,27 @@ func awaitIf10() async -> Int {
12831283func awaitIf11( ) async -> Int {
12841284 let x = await if . random( ) { await awaitIf4 ( ) } else { awaitIf4 ( ) }
12851285 // expected-warning@-1 {{'await' has no effect on 'if' expression}}
1286- // expected-error @-2 {{expression is 'async' but is not marked with 'await'}}
1286+ // expected-warning @-2 {{expression is 'async' but is not marked with 'await'; this is an error in Swift 6 }}
12871287 // expected-note@-3 {{call is 'async'}}
12881288 return x
12891289}
12901290
12911291func awaitIf12( ) async -> Int {
12921292 let x = await if . random( ) { awaitIf4 ( ) } else { awaitIf4 ( ) }
12931293 // expected-warning@-1 {{'await' has no effect on 'if' expression}}
1294- // expected-error @-2 2{{expression is 'async' but is not marked with 'await'}}
1294+ // expected-warning @-2 2{{expression is 'async' but is not marked with 'await'; this is an error in Swift 6 }}
12951295 // expected-note@-3 2{{call is 'async'}}
12961296 return x
12971297}
12981298
12991299func awaitIf13( ) async throws -> Int {
13001300 let x = await if . random( ) { // expected-warning {{'await' has no effect on 'if' expression}}
13011301 awaitIf4 ( ) // expected-warning {{result of call to 'awaitIf4()' is unused}}
1302- // expected-error @-1 {{expression is 'async' but is not marked with 'await'}}
1302+ // expected-warning @-1 {{expression is 'async' but is not marked with 'await'; this is an error in Swift 6 }}
13031303 // expected-note@-2 {{call is 'async'}}
13041304
13051305 _ = awaitIf4 ( )
1306- // expected-error @-1 {{expression is 'async' but is not marked with 'await'}}
1306+ // expected-warning @-1 {{expression is 'async' but is not marked with 'await'; this is an error in Swift 6 }}
13071307 // expected-note@-2 {{call is 'async'}}
13081308
13091309 _ = await awaitIf4 ( ) // Okay.
@@ -1326,7 +1326,7 @@ func asyncBool() async -> Bool { true }
13261326func awaitIf14( ) async -> Int {
13271327 await if asyncBool ( ) { 0 } else { 1 }
13281328 // expected-warning@-1 {{'await' has no effect on 'if' expression}}
1329- // expected-error @-2 {{expression is 'async' but is not marked with 'await'}}
1329+ // expected-warning @-2 {{expression is 'async' but is not marked with 'await'; this is an error in Swift 6 }}
13301330 // expected-note@-3 {{call is 'async'}}
13311331}
13321332
@@ -1378,27 +1378,27 @@ func tryAwaitIf3() async throws -> Int {
13781378 try await if . random( ) { tryAwaitIf2 ( ) } else { 1 } as Int
13791379 // expected-warning@-1 {{'try' has no effect on 'if' expression}}
13801380 // expected-warning@-2 {{'await' has no effect on 'if' expression}}
1381- // expected-error @-3 {{call can throw but is not marked with 'try'}}
1381+ // expected-warning @-3 {{call can throw but is not marked with 'try'; this is an error in Swift 6 }}
13821382 // expected-note@-4 {{did you mean to use 'try'?}}
13831383 // expected-note@-5 {{did you mean to handle error as optional value?}}
13841384 // expected-note@-6 {{did you mean to disable error propagation?}}
1385- // expected-error @-7 {{expression is 'async' but is not marked with 'await'}}
1385+ // expected-warning @-7 {{expression is 'async' but is not marked with 'await'; this is an error in Swift 6 }}
13861386 // expected-note@-8 {{call is 'async'}}
13871387}
13881388
13891389func tryAwaitIf4( ) async throws -> Int {
13901390 try await if . random( ) { try tryAwaitIf2 ( ) } else { 1 } as Int
13911391 // expected-warning@-1 {{'try' has no effect on 'if' expression}}
13921392 // expected-warning@-2 {{'await' has no effect on 'if' expression}}
1393- // expected-error @-3 {{expression is 'async' but is not marked with 'await'}}
1393+ // expected-warning @-3 {{expression is 'async' but is not marked with 'await'; this is an error in Swift 6 }}
13941394 // expected-note@-4 {{call is 'async'}}
13951395}
13961396
13971397func tryAwaitIf5( ) async throws -> Int {
13981398 try await if . random( ) { await tryAwaitIf2 ( ) } else { 1 } as Int
13991399 // expected-warning@-1 {{'try' has no effect on 'if' expression}}
14001400 // expected-warning@-2 {{'await' has no effect on 'if' expression}}
1401- // expected-error @-3 {{call can throw but is not marked with 'try'}}
1401+ // expected-warning @-3 {{call can throw but is not marked with 'try'; this is an error in Swift 6 }}
14021402 // expected-note@-4 {{did you mean to use 'try'?}}
14031403 // expected-note@-5 {{did you mean to handle error as optional value?}}
14041404 // expected-note@-6 {{did you mean to disable error propagation?}}
@@ -1414,27 +1414,27 @@ func tryAwaitIf7() async throws -> Int {
14141414 try await if . random( ) { tryAwaitIf2 ( ) } else { 1 }
14151415 // expected-warning@-1 {{'try' has no effect on 'if' expression}}
14161416 // expected-warning@-2 {{'await' has no effect on 'if' expression}}
1417- // expected-error @-3 {{call can throw but is not marked with 'try'}}
1417+ // expected-warning @-3 {{call can throw but is not marked with 'try'; this is an error in Swift 6 }}
14181418 // expected-note@-4 {{did you mean to use 'try'?}}
14191419 // expected-note@-5 {{did you mean to handle error as optional value?}}
14201420 // expected-note@-6 {{did you mean to disable error propagation?}}
1421- // expected-error @-7 {{expression is 'async' but is not marked with 'await'}}
1421+ // expected-warning @-7 {{expression is 'async' but is not marked with 'await'; this is an error in Swift 6 }}
14221422 // expected-note@-8 {{call is 'async'}}
14231423}
14241424
14251425func tryAwaitIf8( ) async throws -> Int {
14261426 try await if . random( ) { try tryAwaitIf2 ( ) } else { 1 }
14271427 // expected-warning@-1 {{'try' has no effect on 'if' expression}}
14281428 // expected-warning@-2 {{'await' has no effect on 'if' expression}}
1429- // expected-error @-3 {{expression is 'async' but is not marked with 'await'}}
1429+ // expected-warning @-3 {{expression is 'async' but is not marked with 'await'; this is an error in Swift 6 }}
14301430 // expected-note@-4 {{call is 'async'}}
14311431}
14321432
14331433func tryAwaitIf9( ) async throws -> Int {
14341434 try await if . random( ) { await tryAwaitIf2 ( ) } else { 1 }
14351435 // expected-warning@-1 {{'try' has no effect on 'if' expression}}
14361436 // expected-warning@-2 {{'await' has no effect on 'if' expression}}
1437- // expected-error @-3 {{call can throw but is not marked with 'try'}}
1437+ // expected-warning @-3 {{call can throw but is not marked with 'try'; this is an error in Swift 6 }}
14381438 // expected-note@-4 {{did you mean to use 'try'?}}
14391439 // expected-note@-5 {{did you mean to handle error as optional value?}}
14401440 // expected-note@-6 {{did you mean to disable error propagation?}}
0 commit comments