99//
1010//===----------------------------------------------------------------------===//
1111
12+ #if compiler(>=6.2)
13+
1214import Synchronization
1315import DequeModule
1416
@@ -338,22 +340,15 @@ where Base.Element: Sendable, Base: AsyncSequenceSendableMetatype, Base.AsyncIte
338340 failure = error
339341 }
340342 }
341- #if compiler(>=6.1)
343+
342344 let state : Mutex < State >
343- #else
344- let state : ManagedCriticalState < State >
345- #endif
346345 let limit : Int ?
347346
348347 init (
349348 _ iteratorFactory: @escaping @Sendable ( ) -> sending Base. AsyncIterator ,
350349 bufferingPolicy: AsyncBufferSequencePolicy
351350 ) {
352- #if compiler(>=6.1)
353351 state = Mutex ( State ( iteratorFactory, bufferingPolicy: bufferingPolicy) )
354- #else
355- state = ManagedCriticalState ( State ( iteratorFactory, bufferingPolicy: bufferingPolicy) )
356- #endif
357352 switch bufferingPolicy. policy {
358353 case . bounded( let limit) :
359354 self . limit = limit
@@ -644,7 +639,7 @@ where Base.Element: Sendable, Base: AsyncSequenceSendableMetatype, Base.AsyncIte
644639 // Using this priority escalation means that the base task can avoid being detached.
645640 //
646641 // This is disabled for now until the 9999 availability is removed from `withTaskPriorityEscalationHandler`
647- #if false // TODO: replace with compiler(>=6.2)
642+ #if false // TODO: remove when this is resolved
648643 guard #available( macOS 26 . 0 , iOS 26 . 0 , tvOS 26 . 0 , visionOS 26 . 0 , * ) else {
649644 return try await nextIteration ( id) . get ( )
650645 }
@@ -727,3 +722,5 @@ extension AsyncShareSequence: AsyncSequence {
727722 Iterator ( extent. iteration)
728723 }
729724}
725+
726+ #endif
0 commit comments