Skip to content

Commit 7e9b1af

Browse files
[tests] Add Serialization tests for async let any_patter bit encode/decode
1 parent e8a8ecd commit 7e9b1af

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
11
public func doSomethingBig() async -> Int { return 0 }
2+
3+
@_alwaysEmitIntoClient
4+
public func doSerializedAsyncLet() async {
5+
async let _ = ()
6+
}
7+
8+
@_alwaysEmitIntoClient
9+
public func doSerializedAsyncLetTyped() async {
10+
async let _ : () = ()
11+
}

test/Serialization/async.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,13 @@ import def_async
1111
func testDoSomethingBig() {
1212
let _: () -> Int = doSomethingBig // expected-error{{invalid conversion from 'async' function of type '() async -> Int' to synchronous function type '() -> Int'}}
1313
}
14+
15+
// Verify serialization of async let _ = <expression> pattern
16+
func testSerializedAsyncLet() async {
17+
await doSerializedAsyncLet()
18+
}
19+
20+
// Verify serialization of async let _ : <type> = <expression> pattern
21+
func testSerializedAsyncLetTyped() async {
22+
await doSerializedAsyncLetTyped()
23+
}

0 commit comments

Comments
 (0)