@@ -267,20 +267,21 @@ extension AsyncFlatMapSequence: AsyncSequence {
267267
268268 /// Produces the next element in the flat map sequence.
269269 ///
270- /// This iterator calls `next()` on its base iterator; if this call
271- /// returns `nil`, `next()` returns `nil`. Otherwise, `next()`
272- /// calls the transforming closure on the received element, takes the
273- /// resulting asynchronous sequence, and creates an asynchronous iterator
274- /// from it. `next()` then consumes values from this iterator until
275- /// it terminates. At this point, `next()` is ready to receive the
276- /// next value from the base sequence.
270+ /// This iterator calls `next(isolation:)` on its base iterator; if this
271+ /// call returns `nil`, `next(isolation:)` returns `nil`. Otherwise,
272+ /// `next(isolation:)` calls the transforming closure on the received
273+ /// element, takes the resulting asynchronous sequence, and creates an
274+ /// asynchronous iterator from it. `next(isolation:)` then consumes values
275+ /// from this iterator until it terminates. At this point,
276+ /// `next(isolation:)` is ready to receive the next value from the base
277+ /// sequence.
277278 @available ( SwiftStdlib 5 . 11 , * )
278279 @inlinable
279- public mutating func next( _ actor : isolated ( any Actor ) ? ) async throws ( Failure) -> SegmentOfResult . Element ? {
280+ public mutating func next( isolation actor : isolated ( any Actor ) ? ) async throws ( Failure) -> SegmentOfResult . Element ? {
280281 while !finished {
281282 if var iterator = currentIterator {
282283 do {
283- let optElement = try await iterator. next ( actor )
284+ let optElement = try await iterator. next ( isolation : actor )
284285 guard let element = optElement else {
285286 currentIterator = nil
286287 continue
@@ -293,15 +294,15 @@ extension AsyncFlatMapSequence: AsyncSequence {
293294 throw error as! Failure
294295 }
295296 } else {
296- let optItem = try await baseIterator. next ( actor )
297+ let optItem = try await baseIterator. next ( isolation : actor )
297298 guard let item = optItem else {
298299 finished = true
299300 return nil
300301 }
301302 do {
302303 let segment = await transform ( item)
303304 var iterator = segment. makeAsyncIterator ( )
304- let optElement = try await iterator. next ( actor )
305+ let optElement = try await iterator. next ( isolation : actor )
305306 guard let element = optElement else {
306307 currentIterator = nil
307308 continue
0 commit comments