Skip to content

Commit 290f9a5

Browse files
committed
[Concurrency] Add an async let example with multiple initializer clauses
1 parent 779a36b commit 290f9a5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/decl/var/async_let.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,13 @@ func testAsyncFunc() async {
2525
await x = 1
2626
_ = y2
2727
}
28+
29+
// Cooking example
30+
func chopVegetables() async throws -> [String] { [] }
31+
func marinateMeat() async -> String { "MEAT" }
32+
33+
func cook() async throws {
34+
async let veggies = await try chopVegetables(), meat = await marinateMeat()
35+
_ = await try veggies
36+
_ = await meat
37+
}

0 commit comments

Comments
 (0)