Fix AsyncSubject's Failure type conflincting with Apple addition to AsyncSequence starting from Xcode 16 (iOS 18, MacOS 15, Vision OS 2, etc.)
Description
For more information on what caused the issue, see this discussion.
Fixed by:
Splitting AsyncSubject procotol into two protocols:
AsyncSubjectable, meant to define the send(element:) method and dependance to AsyncSequence and other protocols
AsyncSubjectTerminable, meant to define both the AsyncSubject's Failure type and the send(termination:) method
Making AsyncSubject a typealias to a conformance of both of these new protocols
This results in the compiler either:
using the AsyncSubjectTerminable's Failure type on its own when AsyncSequence doesn't defines it (up until Xcode 16)
allowing both AsyncSubjectTerminable and AsyncSequence's Failure type to be the same type when AsyncSequence does define its own Failure type (starting from Xcode 16)
Checklist
[x] this PR is based on the main branch and is up-to-date, if not please rebase your branch on the top of main
[x] the commits inside this PR have explicit commit messages
[x] unit tests cover the new feature or the bug fix
[ ] the feature is documented in the README.md if it makes sense
Fix AsyncSubject's Failure type conflincting with Apple addition to AsyncSequence starting from Xcode 16 (iOS 18, MacOS 15, Vision OS 2, etc.)
Description
For more information on what caused the issue, see this discussion.
Fixed by:
AsyncSubject
procotol into two protocols:send(element:)
method and dependance toAsyncSequence
and other protocolsFailure
type and thesend(termination:)
methodtypealias
to a conformance of both of these new protocolsThis results in the compiler either:
AsyncSubjectTerminable
's Failure type on its own whenAsyncSequence
doesn't defines it (up until Xcode 16)AsyncSubjectTerminable
andAsyncSequence
's Failure type to be the same type whenAsyncSequence
does define its own Failure type (starting from Xcode 16)Checklist