Skip to content

Commit e1f6c70

Browse files
Merge pull request #61175 from LucianoPAlmeida/test-case-sr
[NFC][test] Add additional test case for issue 57376
2 parents 9045388 + 8081b12 commit e1f6c70

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/Concurrency/issue-57376.swift

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,25 @@ func search(query: String, entities: [String]) async throws -> [String] {
5757
return await r // OK
5858
}
5959

60+
@rethrows protocol TestRethrowProtocol {
61+
func fn() async throws
62+
}
63+
extension TestRethrowProtocol {
64+
func testRethrow() async rethrows {
65+
try await self.fn()
66+
}
67+
}
68+
69+
struct TestRethrowStruct: TestRethrowProtocol {
70+
func fn() async throws {}
71+
}
72+
73+
func testStructRethrows() async throws {
74+
let s = TestRethrowStruct()
75+
async let rt: () = s.testRethrow()
76+
try await rt // OK
77+
}
78+
6079
// https://github.com/apple/swift/issues/60351
6180
func foo() async {
6281
let stream = AsyncStream<Int>{ _ in }

0 commit comments

Comments
 (0)