Skip to content

Commit

Permalink
Fix AsyncSubject's Failure type conflincting with Apple addition to A…
Browse files Browse the repository at this point in the history
…syncSequence starting from Xcode 16 (iOS 18, MacOS 15, Vision OS 2, etc.)
  • Loading branch information
gsl-anthonymerle authored and twittemb committed Jun 27, 2024
1 parent bcb778b commit 3442d3d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Sources/AsyncSubjects/AsyncSubject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@
//

#if swift(>=5.7)
public protocol AsyncSubject<Element, Failure>: AnyObject, AsyncSequence, Sendable where AsyncIterator: AsyncSubjectIterator {
associatedtype Failure: Error
public protocol AsyncSubjectable<Element>: AnyObject, AsyncSequence, Sendable where AsyncIterator: AsyncSubjectIterator {
func send(_ element: Element)
}

func send(_ element: Element)
func send(_ termination: Termination<Failure>)
public protocol AsyncSubjectTerminable {
associatedtype Failure: Error

func send(_ termination: Termination<Failure>)
}

public typealias AsyncSubject = AsyncSubjectable & AsyncSubjectTerminable
#else
public protocol AsyncSubject: AnyObject, AsyncSequence, Sendable where AsyncIterator: AsyncSubjectIterator {
associatedtype Failure: Error
Expand Down

0 comments on commit 3442d3d

Please sign in to comment.