Skip to content

Commit c55c2b6

Browse files
committed
[Tests] NFC: Bring back test-case that makes sure that closures discard result correctly
(cherry picked from commit 92a1b1f)
1 parent c7fb93d commit c55c2b6

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/Constraints/async.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,3 +180,20 @@ struct OverloadInImplicitAsyncClosure {
180180

181181
init(int: Int) throws { }
182182
}
183+
184+
@available(SwiftStdlib 5.5, *)
185+
func test(_: Int) async throws {}
186+
187+
@discardableResult
188+
@available(SwiftStdlib 5.5, *)
189+
func test(_: Int) -> String { "" }
190+
191+
@available(SwiftStdlib 5.5, *)
192+
func compute(_: @escaping () -> Void) {}
193+
194+
@available(SwiftStdlib 5.5, *)
195+
func test_sync_in_closure_context() {
196+
compute {
197+
test(42) // Ok (select sync overloads and discards the result)
198+
}
199+
}

0 commit comments

Comments
 (0)