@@ -1010,7 +1010,7 @@ func tryIf4() throws -> Int {
1010
1010
func tryIf5( ) throws -> Int {
1011
1011
return try if . random( ) { tryIf4 ( ) } else { 1 }
1012
1012
// 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 }}
1014
1014
// expected-note@-3 {{did you mean to use 'try'?}}
1015
1015
// expected-note@-4 {{did you mean to handle error as optional value?}}
1016
1016
// expected-note@-5 {{did you mean to disable error propagation?}}
@@ -1019,7 +1019,7 @@ func tryIf5() throws -> Int {
1019
1019
func tryIf6( ) throws -> Int {
1020
1020
try if . random( ) { tryIf4 ( ) } else { 1 }
1021
1021
// 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 }}
1023
1023
// expected-note@-3 {{did you mean to use 'try'?}}
1024
1024
// expected-note@-4 {{did you mean to handle error as optional value?}}
1025
1025
// expected-note@-5 {{did you mean to disable error propagation?}}
@@ -1028,7 +1028,7 @@ func tryIf6() throws -> Int {
1028
1028
func tryIf7( ) throws -> Int {
1029
1029
let x = try if . random( ) { tryIf4 ( ) } else { 1 }
1030
1030
// 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 }}
1032
1032
// expected-note@-3 {{did you mean to use 'try'?}}
1033
1033
// expected-note@-4 {{did you mean to handle error as optional value?}}
1034
1034
// expected-note@-5 {{did you mean to disable error propagation?}}
@@ -1054,7 +1054,7 @@ func tryIf10() throws -> Int {
1054
1054
func tryIf11( ) throws -> Int {
1055
1055
let x = try if . random( ) { try tryIf4 ( ) } else { tryIf4 ( ) }
1056
1056
// 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 }}
1058
1058
// expected-note@-3 {{did you mean to use 'try'?}}
1059
1059
// expected-note@-4 {{did you mean to handle error as optional value?}}
1060
1060
// expected-note@-5 {{did you mean to disable error propagation?}}
@@ -1064,7 +1064,7 @@ func tryIf11() throws -> Int {
1064
1064
func tryIf12( ) throws -> Int {
1065
1065
let x = try if . random( ) { tryIf4 ( ) } else { tryIf4 ( ) }
1066
1066
// 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 }}
1068
1068
// expected-note@-3 2{{did you mean to use 'try'?}}
1069
1069
// expected-note@-4 2{{did you mean to handle error as optional value?}}
1070
1070
// expected-note@-5 2{{did you mean to disable error propagation?}}
@@ -1074,13 +1074,13 @@ func tryIf12() throws -> Int {
1074
1074
func tryIf13( ) throws -> Int {
1075
1075
let x = try if . random( ) { // expected-warning {{'try' has no effect on 'if' expression}}
1076
1076
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 }}
1078
1078
// expected-note@-2 {{did you mean to use 'try'?}}
1079
1079
// expected-note@-3 {{did you mean to handle error as optional value?}}
1080
1080
// expected-note@-4 {{did you mean to disable error propagation?}}
1081
1081
1082
1082
_ = 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 }}
1084
1084
// expected-note@-2 {{did you mean to use 'try'?}}
1085
1085
// expected-note@-3 {{did you mean to handle error as optional value?}}
1086
1086
// expected-note@-4 {{did you mean to disable error propagation?}}
@@ -1105,7 +1105,7 @@ func throwsBool() throws -> Bool { true }
1105
1105
func tryIf14( ) throws -> Int {
1106
1106
try if throwsBool ( ) { 0 } else { 1 }
1107
1107
// 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 }}
1109
1109
// expected-note@-3 {{did you mean to use 'try'?}}
1110
1110
// expected-note@-4 {{did you mean to handle error as optional value?}}
1111
1111
// expected-note@-5 {{did you mean to disable error propagation?}}
@@ -1245,21 +1245,21 @@ func awaitIf4() async -> Int {
1245
1245
func awaitIf5( ) async -> Int {
1246
1246
return await if . random( ) { awaitIf4 ( ) } else { 1 }
1247
1247
// 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 }}
1249
1249
// expected-note@-3 {{call is 'async'}}
1250
1250
}
1251
1251
1252
1252
func awaitIf6( ) async -> Int {
1253
1253
await if . random( ) { awaitIf4 ( ) } else { 1 }
1254
1254
// 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 }}
1256
1256
// expected-note@-3 {{call is 'async'}}
1257
1257
}
1258
1258
1259
1259
func awaitIf7( ) async -> Int {
1260
1260
let x = await if . random( ) { awaitIf4 ( ) } else { 1 }
1261
1261
// 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 }}
1263
1263
// expected-note@-3 {{call is 'async'}}
1264
1264
return x
1265
1265
}
@@ -1283,27 +1283,27 @@ func awaitIf10() async -> Int {
1283
1283
func awaitIf11( ) async -> Int {
1284
1284
let x = await if . random( ) { await awaitIf4 ( ) } else { awaitIf4 ( ) }
1285
1285
// 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 }}
1287
1287
// expected-note@-3 {{call is 'async'}}
1288
1288
return x
1289
1289
}
1290
1290
1291
1291
func awaitIf12( ) async -> Int {
1292
1292
let x = await if . random( ) { awaitIf4 ( ) } else { awaitIf4 ( ) }
1293
1293
// 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 }}
1295
1295
// expected-note@-3 2{{call is 'async'}}
1296
1296
return x
1297
1297
}
1298
1298
1299
1299
func awaitIf13( ) async throws -> Int {
1300
1300
let x = await if . random( ) { // expected-warning {{'await' has no effect on 'if' expression}}
1301
1301
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 }}
1303
1303
// expected-note@-2 {{call is 'async'}}
1304
1304
1305
1305
_ = 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 }}
1307
1307
// expected-note@-2 {{call is 'async'}}
1308
1308
1309
1309
_ = await awaitIf4 ( ) // Okay.
@@ -1326,7 +1326,7 @@ func asyncBool() async -> Bool { true }
1326
1326
func awaitIf14( ) async -> Int {
1327
1327
await if asyncBool ( ) { 0 } else { 1 }
1328
1328
// 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 }}
1330
1330
// expected-note@-3 {{call is 'async'}}
1331
1331
}
1332
1332
@@ -1378,27 +1378,27 @@ func tryAwaitIf3() async throws -> Int {
1378
1378
try await if . random( ) { tryAwaitIf2 ( ) } else { 1 } as Int
1379
1379
// expected-warning@-1 {{'try' has no effect on 'if' expression}}
1380
1380
// 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 }}
1382
1382
// expected-note@-4 {{did you mean to use 'try'?}}
1383
1383
// expected-note@-5 {{did you mean to handle error as optional value?}}
1384
1384
// 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 }}
1386
1386
// expected-note@-8 {{call is 'async'}}
1387
1387
}
1388
1388
1389
1389
func tryAwaitIf4( ) async throws -> Int {
1390
1390
try await if . random( ) { try tryAwaitIf2 ( ) } else { 1 } as Int
1391
1391
// expected-warning@-1 {{'try' has no effect on 'if' expression}}
1392
1392
// 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 }}
1394
1394
// expected-note@-4 {{call is 'async'}}
1395
1395
}
1396
1396
1397
1397
func tryAwaitIf5( ) async throws -> Int {
1398
1398
try await if . random( ) { await tryAwaitIf2 ( ) } else { 1 } as Int
1399
1399
// expected-warning@-1 {{'try' has no effect on 'if' expression}}
1400
1400
// 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 }}
1402
1402
// expected-note@-4 {{did you mean to use 'try'?}}
1403
1403
// expected-note@-5 {{did you mean to handle error as optional value?}}
1404
1404
// expected-note@-6 {{did you mean to disable error propagation?}}
@@ -1414,27 +1414,27 @@ func tryAwaitIf7() async throws -> Int {
1414
1414
try await if . random( ) { tryAwaitIf2 ( ) } else { 1 }
1415
1415
// expected-warning@-1 {{'try' has no effect on 'if' expression}}
1416
1416
// 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 }}
1418
1418
// expected-note@-4 {{did you mean to use 'try'?}}
1419
1419
// expected-note@-5 {{did you mean to handle error as optional value?}}
1420
1420
// 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 }}
1422
1422
// expected-note@-8 {{call is 'async'}}
1423
1423
}
1424
1424
1425
1425
func tryAwaitIf8( ) async throws -> Int {
1426
1426
try await if . random( ) { try tryAwaitIf2 ( ) } else { 1 }
1427
1427
// expected-warning@-1 {{'try' has no effect on 'if' expression}}
1428
1428
// 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 }}
1430
1430
// expected-note@-4 {{call is 'async'}}
1431
1431
}
1432
1432
1433
1433
func tryAwaitIf9( ) async throws -> Int {
1434
1434
try await if . random( ) { await tryAwaitIf2 ( ) } else { 1 }
1435
1435
// expected-warning@-1 {{'try' has no effect on 'if' expression}}
1436
1436
// 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 }}
1438
1438
// expected-note@-4 {{did you mean to use 'try'?}}
1439
1439
// expected-note@-5 {{did you mean to handle error as optional value?}}
1440
1440
// expected-note@-6 {{did you mean to disable error propagation?}}
0 commit comments