Skip to content

Commit 3442d3d

Browse files
gsl-anthonymerletwittemb
authored andcommitted
Fix AsyncSubject's Failure type conflincting with Apple addition to AsyncSequence starting from Xcode 16 (iOS 18, MacOS 15, Vision OS 2, etc.)
1 parent bcb778b commit 3442d3d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Sources/AsyncSubjects/AsyncSubject.swift

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,17 @@
66
//
77

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

12-
func send(_ element: Element)
13-
func send(_ termination: Termination<Failure>)
13+
public protocol AsyncSubjectTerminable {
14+
associatedtype Failure: Error
15+
16+
func send(_ termination: Termination<Failure>)
1417
}
18+
19+
public typealias AsyncSubject = AsyncSubjectable & AsyncSubjectTerminable
1520
#else
1621
public protocol AsyncSubject: AnyObject, AsyncSequence, Sendable where AsyncIterator: AsyncSubjectIterator {
1722
associatedtype Failure: Error

0 commit comments

Comments
 (0)