@@ -34,11 +34,11 @@ final class ConcurrencyHelpersTests: XCTestCase {
3434 await doTestLockable ( Lock . self)
3535 }
3636
37- struct Data {
37+ private struct Data {
3838 @Protected var valueA : Int = 1
39- @Protected var valueB : Int ? = nil
39+ @Protected var valueB : Int ?
4040
41- public mutating func setA( _ a: Int ) {
41+ mutating func setA( _ a: Int ) {
4242 _valueA. write {
4343 $0 = a
4444 }
@@ -77,7 +77,7 @@ final class ConcurrencyHelpersTests: XCTestCase {
7777 await doTestLockable ( Spinlock . self)
7878 }
7979
80- private func doTestLockable< Mutex: Lockable > ( _: Mutex . Type ) async {
80+ private func doTestLockable< Mutex: Lockable & Sendable > ( _: Mutex . Type ) async {
8181 let taskCount = 10
8282 let iterationCount = 10_000
8383
@@ -108,6 +108,28 @@ final class ConcurrencyHelpersTests: XCTestCase {
108108 XCTAssertEqual ( result, 34 * 2 )
109109 }
110110
111+ func testRunSyncInRunSync( ) throws {
112+ #if !compiler(>=6.2)
113+ throw XCTSkip ( " Skipping test: compiler version does not support immediate tasks " )
114+ #endif
115+ guard #available( macOS 26 , iOS 26 , * ) else {
116+ throw XCTSkip ( " Skipping test: OS version does not support immediate tasks " )
117+ }
118+
119+ func runSyncRec( recursion: Int ) -> Int {
120+ if recursion <= 0 {
121+ return runSync {
122+ await self . someAsyncMethod ( argument: 34 )
123+ }
124+ }
125+ return runSync {
126+ runSyncRec ( recursion: recursion - 1 )
127+ }
128+ }
129+ let result = runSyncRec ( recursion: 100 )
130+ XCTAssertEqual ( result, 34 * 2 )
131+ }
132+
111133 func testRunSyncWithPriority( ) {
112134 let result = runSync ( priority: . userInitiated) { await self . someAsyncMethod ( argument: 34 ) }
113135 XCTAssertEqual ( result, 34 * 2 )
@@ -155,7 +177,7 @@ final class ConcurrencyHelpersTests: XCTestCase {
155177 print ( " Never " )
156178 }
157179 }
158-
180+
159181 wrapper. exception = exception
160182 }
161183 let exception = wrapper. exception
@@ -191,7 +213,7 @@ final class ConcurrencyHelpersTests: XCTestCase {
191213 }
192214}
193215
194- extension AsyncStream . Continuation . YieldResult : Equatable where Element: Equatable {
216+ extension AsyncStream . Continuation . YieldResult : @ retroactive Equatable where Element: Equatable {
195217 public static func == ( lhs: Self , rhs: Self ) -> Bool {
196218 switch lhs {
197219 case . enqueued( let lhsRemaining) :
0 commit comments