Skip to content

Commit ceee764

Browse files
authored
Merge pull request #72645 from tshortli/async-sequence-condfails
Concurrency: Declare explicit Failure typealiases on AsyncSequence iterators
2 parents 418dd95 + 9e875f9 commit ceee764

8 files changed

+32
-0
lines changed

stdlib/public/Concurrency/AsyncCompactMapSequence.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ extension AsyncCompactMapSequence: AsyncSequence {
9494
public struct Iterator: AsyncIteratorProtocol {
9595
public typealias Element = ElementOfResult
9696

97+
// FIXME: Remove when $AssociatedTypeImplements is no longer needed
98+
@available(SwiftStdlib 6.0, *)
99+
public typealias Failure = Base.Failure
100+
97101
@usableFromInline
98102
var baseIterator: Base.AsyncIterator
99103

stdlib/public/Concurrency/AsyncDropFirstSequence.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ extension AsyncDropFirstSequence: AsyncSequence {
8181

8282
/// The iterator that produces elements of the drop-first sequence.
8383
public struct Iterator: AsyncIteratorProtocol {
84+
// FIXME: Remove when $AssociatedTypeImplements is no longer needed
85+
@available(SwiftStdlib 6.0, *)
86+
public typealias Failure = Base.Failure
87+
8488
@usableFromInline
8589
var baseIterator: Base.AsyncIterator
8690

stdlib/public/Concurrency/AsyncDropWhileSequence.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ extension AsyncDropWhileSequence: AsyncSequence {
9090

9191
/// The iterator that produces elements of the drop-while sequence.
9292
public struct Iterator: AsyncIteratorProtocol {
93+
// FIXME: Remove when $AssociatedTypeImplements is no longer needed
94+
@available(SwiftStdlib 6.0, *)
95+
public typealias Failure = Base.Failure
96+
9397
@usableFromInline
9498
var baseIterator: Base.AsyncIterator
9599

stdlib/public/Concurrency/AsyncFilterSequence.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ extension AsyncFilterSequence: AsyncSequence {
8080

8181
/// The iterator that produces elements of the filter sequence.
8282
public struct Iterator: AsyncIteratorProtocol {
83+
// FIXME: Remove when $AssociatedTypeImplements is no longer needed
84+
@available(SwiftStdlib 6.0, *)
85+
public typealias Failure = Base.Failure
86+
8387
@usableFromInline
8488
var baseIterator: Base.AsyncIterator
8589

stdlib/public/Concurrency/AsyncFlatMapSequence.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@ extension AsyncFlatMapSequence: AsyncSequence {
197197

198198
/// The iterator that produces elements of the flat map sequence.
199199
public struct Iterator: AsyncIteratorProtocol {
200+
// FIXME: Remove when $AssociatedTypeImplements is no longer needed
201+
@available(SwiftStdlib 6.0, *)
202+
public typealias Failure = Base.Failure
203+
200204
@usableFromInline
201205
var baseIterator: Base.AsyncIterator
202206

stdlib/public/Concurrency/AsyncMapSequence.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ extension AsyncMapSequence: AsyncSequence {
9090

9191
/// The iterator that produces elements of the map sequence.
9292
public struct Iterator: AsyncIteratorProtocol {
93+
// FIXME: Remove when $AssociatedTypeImplements is no longer needed
94+
@available(SwiftStdlib 6.0, *)
95+
public typealias Failure = Base.Failure
96+
9397
@usableFromInline
9498
var baseIterator: Base.AsyncIterator
9599

stdlib/public/Concurrency/AsyncPrefixSequence.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ extension AsyncPrefixSequence: AsyncSequence {
8181

8282
/// The iterator that produces elements of the prefix sequence.
8383
public struct Iterator: AsyncIteratorProtocol {
84+
// FIXME: Remove when $AssociatedTypeImplements is no longer needed
85+
@available(SwiftStdlib 6.0, *)
86+
public typealias Failure = Base.Failure
87+
8488
@usableFromInline
8589
var baseIterator: Base.AsyncIterator
8690

stdlib/public/Concurrency/AsyncPrefixWhileSequence.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ extension AsyncPrefixWhileSequence: AsyncSequence {
8585

8686
/// The iterator that produces elements of the prefix-while sequence.
8787
public struct Iterator: AsyncIteratorProtocol {
88+
// FIXME: Remove when $AssociatedTypeImplements is no longer needed
89+
@available(SwiftStdlib 6.0, *)
90+
public typealias Failure = Base.Failure
91+
8892
@usableFromInline
8993
var predicateHasFailed = false
9094

0 commit comments

Comments
 (0)