@@ -1305,81 +1305,81 @@ func tryIf29(_ fn: () throws -> Int) rethrows -> Int {
13051305
13061306func awaitIf1( ) async -> Int {
13071307 await if . random( ) { 0 } else { 1 }
1308- // expected-warning@-1 {{'await' has no effect on 'if' expression}}
1308+ // expected-warning@-1 {{'await' has no effect on 'if' expression}}{{3-9=}}
13091309}
13101310
13111311func awaitIf2( ) async -> Int {
13121312 let x = await if . random( ) { 0 } else { 1 }
1313- // expected-warning@-1 {{'await' has no effect on 'if' expression}}
1313+ // expected-warning@-1 {{'await' has no effect on 'if' expression}}{{11-17=}}
13141314 return x
13151315}
13161316
13171317func awaitIf3( ) async -> Int {
13181318 return await if . random( ) { 0 } else { 1 }
1319- // expected-warning@-1 {{'await' has no effect on 'if' expression}}
1319+ // expected-warning@-1 {{'await' has no effect on 'if' expression}}{{10-16=}}
13201320}
13211321
13221322func awaitIf4( ) async -> Int {
13231323 return await if . random( ) { 0 } else { 1 }
1324- // expected-warning@-1 {{'await' has no effect on 'if' expression}}
1324+ // expected-warning@-1 {{'await' has no effect on 'if' expression}}{{10-16=}}
13251325}
13261326
13271327func awaitIf5( ) async -> Int {
13281328 return await if . random( ) { awaitIf4 ( ) } else { 1 }
1329- // expected-warning@-1 {{'await' has no effect on 'if' expression}}
1329+ // expected-warning@-1 {{'await' has no effect on 'if' expression}}{{10-16=}}
13301330 // expected-warning@-2 {{expression is 'async' but is not marked with 'await'; this is an error in the Swift 6 language mode}}
13311331 // expected-note@-3 {{call is 'async'}}
13321332}
13331333
13341334func awaitIf6( ) async -> Int {
13351335 await if . random( ) { awaitIf4 ( ) } else { 1 }
1336- // expected-warning@-1 {{'await' has no effect on 'if' expression}}
1336+ // expected-warning@-1 {{'await' has no effect on 'if' expression}}{{3-9=}}
13371337 // expected-warning@-2 {{expression is 'async' but is not marked with 'await'; this is an error in the Swift 6 language mode}}
13381338 // expected-note@-3 {{call is 'async'}}
13391339}
13401340
13411341func awaitIf7( ) async -> Int {
13421342 let x = await if . random( ) { awaitIf4 ( ) } else { 1 }
1343- // expected-warning@-1 {{'await' has no effect on 'if' expression}}
1343+ // expected-warning@-1 {{'await' has no effect on 'if' expression}}{{11-17=}}
13441344 // expected-warning@-2 {{expression is 'async' but is not marked with 'await'; this is an error in the Swift 6 language mode}}
13451345 // expected-note@-3 {{call is 'async'}}
13461346 return x
13471347}
13481348
13491349func awaitIf8( ) async -> Int {
13501350 return await if . random( ) { await awaitIf4 ( ) } else { 1 }
1351- // expected-warning@-1 {{'await' has no effect on 'if' expression}}
1351+ // expected-warning@-1 {{'await' has no effect on 'if' expression}}{{10-16=}}
13521352}
13531353
13541354func awaitIf9( ) async -> Int {
13551355 await if . random( ) { await awaitIf4 ( ) } else { 1 }
1356- // expected-warning@-1 {{'await' has no effect on 'if' expression}}
1356+ // expected-warning@-1 {{'await' has no effect on 'if' expression}}{{3-9=}}
13571357}
13581358
13591359func awaitIf10( ) async -> Int {
13601360 let x = await if . random( ) { await awaitIf4 ( ) } else { 1 }
1361- // expected-warning@-1 {{'await' has no effect on 'if' expression}}
1361+ // expected-warning@-1 {{'await' has no effect on 'if' expression}}{{11-17=}}
13621362 return x
13631363}
13641364
13651365func awaitIf11( ) async -> Int {
13661366 let x = await if . random( ) { await awaitIf4 ( ) } else { awaitIf4 ( ) }
1367- // expected-warning@-1 {{'await' has no effect on 'if' expression}}
1367+ // expected-warning@-1 {{'await' has no effect on 'if' expression}}{{11-17=}}
13681368 // expected-warning@-2 {{expression is 'async' but is not marked with 'await'; this is an error in the Swift 6 language mode}}
13691369 // expected-note@-3 {{call is 'async'}}
13701370 return x
13711371}
13721372
13731373func awaitIf12( ) async -> Int {
13741374 let x = await if . random( ) { awaitIf4 ( ) } else { awaitIf4 ( ) }
1375- // expected-warning@-1 {{'await' has no effect on 'if' expression}}
1375+ // expected-warning@-1 {{'await' has no effect on 'if' expression}}{{11-17=}}
13761376 // expected-warning@-2 2{{expression is 'async' but is not marked with 'await'; this is an error in the Swift 6 language mode}}
13771377 // expected-note@-3 2{{call is 'async'}}
13781378 return x
13791379}
13801380
13811381func awaitIf13( ) async throws -> Int {
1382- let x = await if . random( ) { // expected-warning {{'await' has no effect on 'if' expression}}
1382+ let x = await if . random( ) { // expected-warning {{'await' has no effect on 'if' expression}}{{11-17=}}
13831383 awaitIf4 ( ) // expected-warning {{result of call to 'awaitIf4()' is unused}}
13841384 // expected-warning@-1 {{expression is 'async' but is not marked with 'await'; this is an error in the Swift 6 language mode}}
13851385 // expected-note@-2 {{call is 'async'}}
@@ -1407,14 +1407,14 @@ func asyncBool() async -> Bool { true }
14071407
14081408func awaitIf14( ) async -> Int {
14091409 await if asyncBool ( ) { 0 } else { 1 }
1410- // expected-warning@-1 {{'await' has no effect on 'if' expression}}
1410+ // expected-warning@-1 {{'await' has no effect on 'if' expression}}{{3-9=}}
14111411 // expected-warning@-2 {{expression is 'async' but is not marked with 'await'; this is an error in the Swift 6 language mode}}
14121412 // expected-note@-3 {{call is 'async'}}
14131413}
14141414
14151415func awaitIf15( ) async -> Int {
14161416 await if await asyncBool ( ) { 0 } else { 1 }
1417- // expected-warning@-1 {{'await' has no effect on 'if' expression}}
1417+ // expected-warning@-1 {{'await' has no effect on 'if' expression}}{{3-9=}}
14181418}
14191419
14201420func awaitIf16( ) async -> Int {
@@ -1447,19 +1447,19 @@ func awaitIf20() async -> Int {
14471447func tryAwaitIf1( ) async throws -> Int {
14481448 try await if . random( ) { 0 } else { 1 }
14491449 // expected-warning@-1 {{'try' has no effect on 'if' expression}}
1450- // expected-warning@-2 {{'await' has no effect on 'if' expression}}
1450+ // expected-warning@-2 {{'await' has no effect on 'if' expression}}{{7-13=}}
14511451}
14521452
14531453func tryAwaitIf2( ) async throws -> Int {
14541454 try await if . random( ) { 0 } else { 1 } as Int
14551455 // expected-warning@-1 {{'try' has no effect on 'if' expression}}
1456- // expected-warning@-2 {{'await' has no effect on 'if' expression}}
1456+ // expected-warning@-2 {{'await' has no effect on 'if' expression}}{{7-13=}}
14571457}
14581458
14591459func tryAwaitIf3( ) async throws -> Int {
14601460 try await if . random( ) { tryAwaitIf2 ( ) } else { 1 } as Int
14611461 // expected-warning@-1 {{'try' has no effect on 'if' expression}}
1462- // expected-warning@-2 {{'await' has no effect on 'if' expression}}
1462+ // expected-warning@-2 {{'await' has no effect on 'if' expression}}{{7-13=}}
14631463 // expected-warning@-3 {{call can throw but is not marked with 'try'; this is an error in the Swift 6 language mode}}
14641464 // expected-note@-4 {{did you mean to use 'try'?}}
14651465 // expected-note@-5 {{did you mean to handle error as optional value?}}
@@ -1471,15 +1471,15 @@ func tryAwaitIf3() async throws -> Int {
14711471func tryAwaitIf4( ) async throws -> Int {
14721472 try await if . random( ) { try tryAwaitIf2 ( ) } else { 1 } as Int
14731473 // expected-warning@-1 {{'try' has no effect on 'if' expression}}
1474- // expected-warning@-2 {{'await' has no effect on 'if' expression}}
1474+ // expected-warning@-2 {{'await' has no effect on 'if' expression}}{{7-13=}}
14751475 // expected-warning@-3 {{expression is 'async' but is not marked with 'await'; this is an error in the Swift 6 language mode}}
14761476 // expected-note@-4 {{call is 'async'}}
14771477}
14781478
14791479func tryAwaitIf5( ) async throws -> Int {
14801480 try await if . random( ) { await tryAwaitIf2 ( ) } else { 1 } as Int
14811481 // expected-warning@-1 {{'try' has no effect on 'if' expression}}
1482- // expected-warning@-2 {{'await' has no effect on 'if' expression}}
1482+ // expected-warning@-2 {{'await' has no effect on 'if' expression}}{{7-13=}}
14831483 // expected-warning@-3 {{call can throw but is not marked with 'try'; this is an error in the Swift 6 language mode}}
14841484 // expected-note@-4 {{did you mean to use 'try'?}}
14851485 // expected-note@-5 {{did you mean to handle error as optional value?}}
@@ -1489,13 +1489,13 @@ func tryAwaitIf5() async throws -> Int {
14891489func tryAwaitIf6( ) async throws -> Int {
14901490 try await if . random( ) { try await tryAwaitIf2 ( ) } else { 1 } as Int
14911491 // expected-warning@-1 {{'try' has no effect on 'if' expression}}
1492- // expected-warning@-2 {{'await' has no effect on 'if' expression}}
1492+ // expected-warning@-2 {{'await' has no effect on 'if' expression}}{{7-13=}}
14931493}
14941494
14951495func tryAwaitIf7( ) async throws -> Int {
14961496 try await if . random( ) { tryAwaitIf2 ( ) } else { 1 }
14971497 // expected-warning@-1 {{'try' has no effect on 'if' expression}}
1498- // expected-warning@-2 {{'await' has no effect on 'if' expression}}
1498+ // expected-warning@-2 {{'await' has no effect on 'if' expression}}{{7-13=}}
14991499 // expected-warning@-3 {{call can throw but is not marked with 'try'; this is an error in the Swift 6 language mode}}
15001500 // expected-note@-4 {{did you mean to use 'try'?}}
15011501 // expected-note@-5 {{did you mean to handle error as optional value?}}
@@ -1507,15 +1507,15 @@ func tryAwaitIf7() async throws -> Int {
15071507func tryAwaitIf8( ) async throws -> Int {
15081508 try await if . random( ) { try tryAwaitIf2 ( ) } else { 1 }
15091509 // expected-warning@-1 {{'try' has no effect on 'if' expression}}
1510- // expected-warning@-2 {{'await' has no effect on 'if' expression}}
1510+ // expected-warning@-2 {{'await' has no effect on 'if' expression}}{{7-13=}}
15111511 // expected-warning@-3 {{expression is 'async' but is not marked with 'await'; this is an error in the Swift 6 language mode}}
15121512 // expected-note@-4 {{call is 'async'}}
15131513}
15141514
15151515func tryAwaitIf9( ) async throws -> Int {
15161516 try await if . random( ) { await tryAwaitIf2 ( ) } else { 1 }
15171517 // expected-warning@-1 {{'try' has no effect on 'if' expression}}
1518- // expected-warning@-2 {{'await' has no effect on 'if' expression}}
1518+ // expected-warning@-2 {{'await' has no effect on 'if' expression}}{{7-13=}}
15191519 // expected-warning@-3 {{call can throw but is not marked with 'try'; this is an error in the Swift 6 language mode}}
15201520 // expected-note@-4 {{did you mean to use 'try'?}}
15211521 // expected-note@-5 {{did you mean to handle error as optional value?}}
@@ -1525,7 +1525,7 @@ func tryAwaitIf9() async throws -> Int {
15251525func tryAwaitIf10( ) async throws -> Int {
15261526 try await if . random( ) { try await tryAwaitIf2 ( ) } else { 1 }
15271527 // expected-warning@-1 {{'try' has no effect on 'if' expression}}
1528- // expected-warning@-2 {{'await' has no effect on 'if' expression}}
1528+ // expected-warning@-2 {{'await' has no effect on 'if' expression}}{{7-13=}}
15291529}
15301530
15311531func tryAwaitIf11( _ fn: ( ) async throws -> Int ) async rethrows -> Int {
0 commit comments