Commit Graph

4 Commits

Author SHA1 Message Date
Doug Gregor
a8f3bb5e5e Implement AsyncIteratorProtocol.next() in terms of next(isolation:).
New async iterators should be able to implement only `next(isolation:)` and
get the older `next()` implementation via a default. Implement the
appropriate default witness.

Fixes rdar://125447861.
2024-03-28 12:59:12 -07:00
Doug Gregor
9cbf165520 Infer AsyncIteratorProtocol.Failure from next() throws.
When inferring the `Failure` associated type from the `next()` witness,
account for the fact that it might itself use typed throws. Use the
specified thrown error type for the inferred witness of `Failure`.

Fixes rdar://125446918.
2024-03-28 12:59:12 -07:00
Doug Gregor
7e3911ea83 Treat @rethrows protocols inheriting AsyncSequence like AsyncSequence
This is a source compatibility hack for such protocols.
Fixes rdar://122577080.
2024-02-08 22:28:18 -08:00
Doug Gregor
4109315b9d Add a test for the rethrows behavior of async sequences and iterators 2024-01-25 16:04:44 -08:00