# AnyAsyncSequence

**URL:** <https://forums.swift.org/t/anyasyncsequence/50828>\
**Category:** Discussion\
**Created:** [August 2, 2021, 1:04pm UTC](https://forums.swift.org/t/anyasyncsequence/50828 "2021-08-02T13:04:14Z")\
**Posts on this page:** 1\
**Showing post:** 25

<div class="post-metadata">

**Author:** ![tevelee](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/tevelee/32/9775_2.png) [@tevelee](https://forums.swift.org/u/tevelee)\
**Post date:** [March 17, 2023, 7:46pm UTC](https://forums.swift.org/t/anyasyncsequence/50828/25 "2023-03-17T19:46:54Z")

</div>

The problem is about error handling. @hborla summarized it well in [the SE-0346 review thread](https://forums.swift.org/t/se-0346-lightweight-same-type-requirements-for-primary-associated-types/55869/70):

> [@SE-0346: Lightweight same-type requirements for primary associated types](https://forums.swift.org/t/se-0346-lightweight-same-type-requirements-for-primary-associated-types/55869/70):
>
> Currently, the default effect for code that's generic over a rethrowing protocol conformance is `throws`. If we want the syntax `some AsyncSequence<Element>` to default to non-throwing, we should _not_ adopt primary associated types for `AsyncSequence` until there is a way to express that default. This proposal does not include adopting primary associated types in the standard library (that will be a separate proposal and discussion) so this proposal doesn't preclude that either.

See also the [Pitch thread of SE-0358](https://forums.swift.org/t/pitch-primary-associated-types-in-the-standard-library/56426):

> [@\[Pitch\] Primary Associated Types in the Standard Library](https://forums.swift.org/t/pitch-primary-associated-types-in-the-standard-library/56426/1):
>
> (1) `AsyncSequence` and `AsyncIteratorProtocol` logically ought to have `Element` as their primary associated type. However, we have [ongoing evolution discussions](https://forums.swift.org/t/se-0346-lightweight-same-type-requirements-for-primary-associated-types/55869/70) about adding a precise error type to these. If those discussions bear fruit, then the new `Error` associated type would need to also be marked primary. To prevent source compatibility complications, adding primary associated types to these two protocols is deferred to a future proposal.

---

_[View the full topic](https://forums.swift.org/t/anyasyncsequence/50828)._
