-
Notifications
You must be signed in to change notification settings - Fork 29
[BUG] AsyncSubject's Failure associated type conflicts with iOS 18's AsyncSequence Failure associated type #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
bug
Something isn't working
Comments
Yes, seeing this with Swift 6.0 on Linux as well. |
+1 |
Possible solutions that I'd like to explore:
|
Fuck Apple! Here is my temporary solution, which can be viewed in my branch. #if swift(>=5.9)
public protocol AsyncSubjectable: AnyObject, AsyncSequence, Sendable where AsyncIterator: AsyncSubjectIterator {
func send(_ element: Element)
}
public protocol AsyncSubjectTerminator {
associatedtype Failure: Error
func send(_ termination: Termination<Failure>)
}
public typealias AsyncSubject = AsyncSubjectable & AsyncSubjectTerminator
#elseif swift(>=5.7)
public protocol AsyncSubject<Element, Failure>: AnyObject, AsyncSequence, Sendable where AsyncIterator: AsyncSubjectIterator {
associatedtype Failure: Error
func send(_ element: Element)
func send(_ termination: Termination<Failure>)
}
#else
...
#endif |
5 tasks
Thanks @0xfeedface1993! :o This works like a charm! |
fixed here: #42 Thanks a lot. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Hi, so I updated Xcode to v16 and tried to build my app for iOS 18 but the AsyncExtensions module got some compilation errors regarding AsyncSubject's Failure associated type.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The application should build without any error
Screenshots

Environment:
Additional context
After digging a bit into the code, I think that's because
AsyncSubject
end up defining twoFailure
associated type from iOS 18:AsyncSubject
has its ownFailure
associated typeAsyncSubject
needs to conform to Swift Concurrency'sAsyncSequence
AsyncSequence
defines its ownFailure
associated type starting iOS 18The text was updated successfully, but these errors were encountered: