Commit Graph

7 Commits

Author SHA1 Message Date
Doug Gregor
bb7a563e6c Switch async for-each loop over to _nextElement and drop @rethrows.
This couples together several changes to move entirely from
`@rethrows` over to typed throws:

* Use the `Failure` type to determine whether an async for-each loop
will throw, rather than depending on rethrows checking

* Introduce a special carve-out for `rethrows` functions that have a
generic requirement on an `AsyncSequence` or `AsyncIteratorProtocol`,
which uses that requirement's `Failure` type as potentially being part
of the thrown error type. This allows existing generic functions like
the following to continue to work:

    func f<S: AsyncSequence>(_: S) rethrows

* Switch SIL generation for the async for-each loop from the prior
`next()` over to the typed-throws version `_nextElement`.

* Remove `@rethrows` from `AsyncSequence` and `AsyncIteratorProtocol`
entirely. We are now fully dependent on typed throws.
2024-01-25 16:04:43 -08:00
Hamish Knight
137279750b [AST] Add an EffectKind OptionSet 2021-05-26 12:40:35 +01:00
Slava Pestov
09dedaa5fe Sema: Start abstracting out the 'effect' in rethrows-checking logic
For now, this is NFC, but it lays the groundwork for implementing
'reasync'.
2021-02-17 18:34:18 -05:00
swift-ci
06513524e9 Merge pull request #35940 from AnthonyLatsis/eof-warn 2021-02-12 11:37:40 -08:00
Anthony Latsis
39649161d0 Gardening: See to some missing newline warnings 2021-02-12 17:00:47 +03:00
Slava Pestov
e2d4eb64e0 Sema: Fix recursion into associated conformances when checking for rethrows
The logic for recursively expanding protocol requirements was broken.
Instead, let's do the recursive visitation when evaluating a
conformance to a @rethrows protocol.
2021-02-10 16:30:30 -05:00
Slava Pestov
6630383643 AST: Split off Effects.h from Decl.h
Also remove the hash and equality operations on ProtocolRethrowsRequirementList;
this is no longer needed now that the AnyValue type eraser is gone.
2021-02-09 00:11:01 -05:00