Skip to content

Commit e253ca9

Browse files
authored
Merge pull request #69056 from hborla/concurrency-regression-tests
[NFC][Concurrency] Add a regression test for a bogus missing `try` diagnostic with `async let`.
2 parents 51a3de8 + 3038f9d commit e253ca9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/expr/unary/async_await.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,13 @@ func testAsyncLet() async throws {
203203
_ = await x5
204204
}
205205

206+
func search(query: String) async throws -> [String] {
207+
let entities: [String] = []
208+
209+
async let r = entities.filter { $0.contains(query) }.map { String($0) }
210+
return await r
211+
}
212+
206213
// expected-note@+1 3{{add 'async' to function 'testAsyncLetOutOfAsync()' to make it asynchronous}} {{30-30= async}}
207214
func testAsyncLetOutOfAsync() {
208215
async let x = 1 // expected-error{{'async let' in a function that does not support concurrency}}

0 commit comments

Comments
 (0)