Skip to content

Commit ed06fde

Browse files
committed
Revert "Allow AsyncSequence operators to be inlined in their construction (#38310)"
This reverts commit 6a80196.
1 parent c2fd49c commit ed06fde

14 files changed

+26
-54
lines changed

stdlib/public/Concurrency/AsyncCompactMapSequence.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,14 @@ extension AsyncSequence {
5656
/// An asynchronous sequence that maps a given closure over the asynchronous
5757
/// sequence’s elements, omitting results that don't return a value.
5858
@available(SwiftStdlib 5.5, *)
59-
@frozen
6059
public struct AsyncCompactMapSequence<Base: AsyncSequence, ElementOfResult> {
6160
@usableFromInline
6261
let base: Base
6362

6463
@usableFromInline
6564
let transform: (Base.Element) async -> ElementOfResult?
6665

67-
@inlinable
66+
@usableFromInline
6867
init(
6968
_ base: Base,
7069
transform: @escaping (Base.Element) async -> ElementOfResult?
@@ -85,7 +84,6 @@ extension AsyncCompactMapSequence: AsyncSequence {
8584
public typealias AsyncIterator = Iterator
8685

8786
/// The iterator that produces elements of the compact map sequence.
88-
@frozen
8987
public struct Iterator: AsyncIteratorProtocol {
9088
public typealias Element = ElementOfResult
9189

@@ -95,7 +93,7 @@ extension AsyncCompactMapSequence: AsyncSequence {
9593
@usableFromInline
9694
let transform: (Base.Element) async -> ElementOfResult?
9795

98-
@inlinable
96+
@usableFromInline
9997
init(
10098
_ baseIterator: Base.AsyncIterator,
10199
transform: @escaping (Base.Element) async -> ElementOfResult?

stdlib/public/Concurrency/AsyncDropFirstSequence.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,14 @@ extension AsyncSequence {
4949
/// An asynchronous sequence which omits a specified number of elements from the
5050
/// base asynchronous sequence, then passes through all remaining elements.
5151
@available(SwiftStdlib 5.5, *)
52-
@frozen
5352
public struct AsyncDropFirstSequence<Base: AsyncSequence> {
5453
@usableFromInline
5554
let base: Base
5655

5756
@usableFromInline
5857
let count: Int
5958

60-
@inlinable
59+
@usableFromInline
6160
init(_ base: Base, dropping count: Int) {
6261
self.base = base
6362
self.count = count
@@ -75,15 +74,14 @@ extension AsyncDropFirstSequence: AsyncSequence {
7574
public typealias AsyncIterator = Iterator
7675

7776
/// The iterator that produces elements of the drop-first sequence.
78-
@frozen
7977
public struct Iterator: AsyncIteratorProtocol {
8078
@usableFromInline
8179
var baseIterator: Base.AsyncIterator
8280

8381
@usableFromInline
8482
var count: Int
8583

86-
@inlinable
84+
@usableFromInline
8785
init(_ baseIterator: Base.AsyncIterator, count: Int) {
8886
self.baseIterator = baseIterator
8987
self.count = count

stdlib/public/Concurrency/AsyncDropWhileSequence.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,14 @@ extension AsyncSequence {
5353
/// given closure returns false, after which it passes through all remaining
5454
/// elements.
5555
@available(SwiftStdlib 5.5, *)
56-
@frozen
5756
public struct AsyncDropWhileSequence<Base: AsyncSequence> {
5857
@usableFromInline
5958
let base: Base
6059

6160
@usableFromInline
6261
let predicate: (Base.Element) async -> Bool
6362

64-
@inlinable
63+
@usableFromInline
6564
init(
6665
_ base: Base,
6766
predicate: @escaping (Base.Element) async -> Bool
@@ -83,15 +82,14 @@ extension AsyncDropWhileSequence: AsyncSequence {
8382
public typealias AsyncIterator = Iterator
8483

8584
/// The iterator that produces elements of the drop-while sequence.
86-
@frozen
8785
public struct Iterator: AsyncIteratorProtocol {
8886
@usableFromInline
8987
var baseIterator: Base.AsyncIterator
9088

9189
@usableFromInline
9290
var predicate: ((Base.Element) async -> Bool)?
9391

94-
@inlinable
92+
@usableFromInline
9593
init(
9694
_ baseIterator: Base.AsyncIterator,
9795
predicate: @escaping (Base.Element) async -> Bool

stdlib/public/Concurrency/AsyncFilterSequence.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,14 @@ extension AsyncSequence {
4444
/// An asynchronous sequence that contains, in order, the elements of
4545
/// the base sequence that satisfy a given predicate.
4646
@available(SwiftStdlib 5.5, *)
47-
@frozen
4847
public struct AsyncFilterSequence<Base: AsyncSequence> {
4948
@usableFromInline
5049
let base: Base
5150

5251
@usableFromInline
5352
let isIncluded: (Element) async -> Bool
5453

55-
@inlinable
54+
@usableFromInline
5655
init(
5756
_ base: Base,
5857
isIncluded: @escaping (Base.Element) async -> Bool
@@ -73,15 +72,14 @@ extension AsyncFilterSequence: AsyncSequence {
7372
public typealias AsyncIterator = Iterator
7473

7574
/// The iterator that produces elements of the filter sequence.
76-
@frozen
7775
public struct Iterator: AsyncIteratorProtocol {
7876
@usableFromInline
7977
var baseIterator: Base.AsyncIterator
8078

8179
@usableFromInline
8280
let isIncluded: (Base.Element) async -> Bool
8381

84-
@inlinable
82+
@usableFromInline
8583
init(
8684
_ baseIterator: Base.AsyncIterator,
8785
isIncluded: @escaping (Base.Element) async -> Bool

stdlib/public/Concurrency/AsyncFlatMapSequence.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,14 @@ extension AsyncSequence {
5050
/// An asynchronous sequence that concatenates the results of calling a given
5151
/// transformation with each element of this sequence.
5252
@available(SwiftStdlib 5.5, *)
53-
@frozen
5453
public struct AsyncFlatMapSequence<Base: AsyncSequence, SegmentOfResult: AsyncSequence> {
5554
@usableFromInline
5655
let base: Base
5756

5857
@usableFromInline
5958
let transform: (Base.Element) async -> SegmentOfResult
6059

61-
@inlinable
60+
@usableFromInline
6261
init(
6362
_ base: Base,
6463
transform: @escaping (Base.Element) async -> SegmentOfResult
@@ -79,7 +78,6 @@ extension AsyncFlatMapSequence: AsyncSequence {
7978
public typealias AsyncIterator = Iterator
8079

8180
/// The iterator that produces elements of the flat map sequence.
82-
@frozen
8381
public struct Iterator: AsyncIteratorProtocol {
8482
@usableFromInline
8583
var baseIterator: Base.AsyncIterator
@@ -93,7 +91,7 @@ extension AsyncFlatMapSequence: AsyncSequence {
9391
@usableFromInline
9492
var finished = false
9593

96-
@inlinable
94+
@usableFromInline
9795
init(
9896
_ baseIterator: Base.AsyncIterator,
9997
transform: @escaping (Base.Element) async -> SegmentOfResult

stdlib/public/Concurrency/AsyncMapSequence.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,14 @@ extension AsyncSequence {
5454
/// An asynchronous sequence that maps the given closure over the asynchronous
5555
/// sequence’s elements.
5656
@available(SwiftStdlib 5.5, *)
57-
@frozen
5857
public struct AsyncMapSequence<Base: AsyncSequence, Transformed> {
5958
@usableFromInline
6059
let base: Base
6160

6261
@usableFromInline
6362
let transform: (Base.Element) async -> Transformed
6463

65-
@inlinable
64+
@usableFromInline
6665
init(
6766
_ base: Base,
6867
transform: @escaping (Base.Element) async -> Transformed
@@ -83,15 +82,14 @@ extension AsyncMapSequence: AsyncSequence {
8382
public typealias AsyncIterator = Iterator
8483

8584
/// The iterator that produces elements of the map sequence.
86-
@frozen
8785
public struct Iterator: AsyncIteratorProtocol {
8886
@usableFromInline
8987
var baseIterator: Base.AsyncIterator
9088

9189
@usableFromInline
9290
let transform: (Base.Element) async -> Transformed
9391

94-
@inlinable
92+
@usableFromInline
9593
init(
9694
_ baseIterator: Base.AsyncIterator,
9795
transform: @escaping (Base.Element) async -> Transformed

stdlib/public/Concurrency/AsyncPrefixSequence.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,14 @@ extension AsyncSequence {
4949
/// An asynchronous sequence, up to a specified maximum length,
5050
/// containing the initial elements of a base asynchronous sequence.
5151
@available(SwiftStdlib 5.5, *)
52-
@frozen
5352
public struct AsyncPrefixSequence<Base: AsyncSequence> {
5453
@usableFromInline
5554
let base: Base
5655

5756
@usableFromInline
5857
let count: Int
5958

60-
@inlinable
59+
@usableFromInline
6160
init(_ base: Base, count: Int) {
6261
self.base = base
6362
self.count = count
@@ -75,15 +74,14 @@ extension AsyncPrefixSequence: AsyncSequence {
7574
public typealias AsyncIterator = Iterator
7675

7776
/// The iterator that produces elements of the prefix sequence.
78-
@frozen
7977
public struct Iterator: AsyncIteratorProtocol {
8078
@usableFromInline
8179
var baseIterator: Base.AsyncIterator
8280

8381
@usableFromInline
8482
var remaining: Int
8583

86-
@inlinable
84+
@usableFromInline
8785
init(_ baseIterator: Base.AsyncIterator, count: Int) {
8886
self.baseIterator = baseIterator
8987
self.remaining = count

stdlib/public/Concurrency/AsyncPrefixWhileSequence.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,14 @@ extension AsyncSequence {
4949
/// An asynchronous sequence, containing the initial, consecutive
5050
/// elements of the base sequence that satisfy a given predicate.
5151
@available(SwiftStdlib 5.5, *)
52-
@frozen
5352
public struct AsyncPrefixWhileSequence<Base: AsyncSequence> {
5453
@usableFromInline
5554
let base: Base
5655

5756
@usableFromInline
5857
let predicate: (Base.Element) async -> Bool
5958

60-
@inlinable
59+
@usableFromInline
6160
init(
6261
_ base: Base,
6362
predicate: @escaping (Base.Element) async -> Bool
@@ -78,7 +77,6 @@ extension AsyncPrefixWhileSequence: AsyncSequence {
7877
public typealias AsyncIterator = Iterator
7978

8079
/// The iterator that produces elements of the prefix-while sequence.
81-
@frozen
8280
public struct Iterator: AsyncIteratorProtocol {
8381
@usableFromInline
8482
var predicateHasFailed = false
@@ -89,7 +87,7 @@ extension AsyncPrefixWhileSequence: AsyncSequence {
8987
@usableFromInline
9088
let predicate: (Base.Element) async -> Bool
9189

92-
@inlinable
90+
@usableFromInline
9391
init(
9492
_ baseIterator: Base.AsyncIterator,
9593
predicate: @escaping (Base.Element) async -> Bool

stdlib/public/Concurrency/AsyncThrowingCompactMapSequence.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,14 @@ extension AsyncSequence {
6868
/// An asynchronous sequence that maps an error-throwing closure over the base
6969
/// sequence’s elements, omitting results that don't return a value.
7070
@available(SwiftStdlib 5.5, *)
71-
@frozen
7271
public struct AsyncThrowingCompactMapSequence<Base: AsyncSequence, ElementOfResult> {
7372
@usableFromInline
7473
let base: Base
7574

7675
@usableFromInline
7776
let transform: (Base.Element) async throws -> ElementOfResult?
7877

79-
@inlinable
78+
@usableFromInline
8079
init(
8180
_ base: Base,
8281
transform: @escaping (Base.Element) async throws -> ElementOfResult?
@@ -97,7 +96,6 @@ extension AsyncThrowingCompactMapSequence: AsyncSequence {
9796
public typealias AsyncIterator = Iterator
9897

9998
/// The iterator that produces elements of the compact map sequence.
100-
@frozen
10199
public struct Iterator: AsyncIteratorProtocol {
102100
public typealias Element = ElementOfResult
103101

@@ -110,7 +108,7 @@ extension AsyncThrowingCompactMapSequence: AsyncSequence {
110108
@usableFromInline
111109
var finished = false
112110

113-
@inlinable
111+
@usableFromInline
114112
init(
115113
_ baseIterator: Base.AsyncIterator,
116114
transform: @escaping (Base.Element) async throws -> ElementOfResult?

stdlib/public/Concurrency/AsyncThrowingDropWhileSequence.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,14 @@ extension AsyncSequence {
6666
/// given error-throwing closure returns false, after which it passes through
6767
/// all remaining elements.
6868
@available(SwiftStdlib 5.5, *)
69-
@frozen
7069
public struct AsyncThrowingDropWhileSequence<Base: AsyncSequence> {
7170
@usableFromInline
7271
let base: Base
7372

7473
@usableFromInline
7574
let predicate: (Base.Element) async throws -> Bool
7675

77-
@inlinable
76+
@usableFromInline
7877
init(
7978
_ base: Base,
8079
predicate: @escaping (Base.Element) async throws -> Bool
@@ -95,7 +94,6 @@ extension AsyncThrowingDropWhileSequence: AsyncSequence {
9594
public typealias AsyncIterator = Iterator
9695

9796
/// The iterator that produces elements of the drop-while sequence.
98-
@frozen
9997
public struct Iterator: AsyncIteratorProtocol {
10098
@usableFromInline
10199
var baseIterator: Base.AsyncIterator
@@ -109,7 +107,7 @@ extension AsyncThrowingDropWhileSequence: AsyncSequence {
109107
@usableFromInline
110108
var doneDropping = false
111109

112-
@inlinable
110+
@usableFromInline
113111
init(
114112
_ baseIterator: Base.AsyncIterator,
115113
predicate: @escaping (Base.Element) async throws -> Bool

stdlib/public/Concurrency/AsyncThrowingFilterSequence.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,14 @@ extension AsyncSequence {
5656
/// An asynchronous sequence that contains, in order, the elements of
5757
/// the base sequence that satisfy the given error-throwing predicate.
5858
@available(SwiftStdlib 5.5, *)
59-
@frozen
6059
public struct AsyncThrowingFilterSequence<Base: AsyncSequence> {
6160
@usableFromInline
6261
let base: Base
6362

6463
@usableFromInline
6564
let isIncluded: (Element) async throws -> Bool
6665

67-
@inlinable
66+
@usableFromInline
6867
init(
6968
_ base: Base,
7069
isIncluded: @escaping (Base.Element) async throws -> Bool
@@ -85,7 +84,6 @@ extension AsyncThrowingFilterSequence: AsyncSequence {
8584
public typealias AsyncIterator = Iterator
8685

8786
/// The iterator that produces elements of the filter sequence.
88-
@frozen
8987
public struct Iterator: AsyncIteratorProtocol {
9088
@usableFromInline
9189
var baseIterator: Base.AsyncIterator
@@ -96,7 +94,7 @@ extension AsyncThrowingFilterSequence: AsyncSequence {
9694
@usableFromInline
9795
var finished = false
9896

99-
@inlinable
97+
@usableFromInline
10098
init(
10199
_ baseIterator: Base.AsyncIterator,
102100
isIncluded: @escaping (Base.Element) async throws -> Bool

stdlib/public/Concurrency/AsyncThrowingFlatMapSequence.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ extension AsyncSequence {
6464
/// An asynchronous sequence that concatenates the results of calling a given
6565
/// error-throwing transformation with each element of this sequence.
6666
@available(SwiftStdlib 5.5, *)
67-
@frozen
6867
public struct AsyncThrowingFlatMapSequence<Base: AsyncSequence, SegmentOfResult: AsyncSequence> {
6968
@usableFromInline
7069
let base: Base
@@ -93,7 +92,6 @@ extension AsyncThrowingFlatMapSequence: AsyncSequence {
9392
public typealias AsyncIterator = Iterator
9493

9594
/// The iterator that produces elements of the flat map sequence.
96-
@frozen
9795
public struct Iterator: AsyncIteratorProtocol {
9896
@usableFromInline
9997
var baseIterator: Base.AsyncIterator

0 commit comments

Comments
 (0)