@@ -347,7 +347,7 @@ extension StoreDriverType {
347
347
_ file: StaticString = #file,
348
348
_ function: StaticString = #function,
349
349
_ line: UInt = #line,
350
- mutation: ( inout sending InoutRef< Scope > ) throws -> Result
350
+ mutation: ( inout InoutRef < Scope > ) throws -> Result
351
351
) rethrows -> Result {
352
352
353
353
let trace = MutationTrace (
@@ -357,9 +357,9 @@ extension StoreDriverType {
357
357
line: line
358
358
)
359
359
360
- return try store. asStore ( ) . _receive (
360
+ return try store. asStore ( ) . _receive_sending (
361
361
mutation: { [ scope] stateRef, _ -> Result in
362
- try stateRef. map ( keyPath: scope) { ( ref: inout sending InoutRef< Scope > ) -> Result in
362
+ try stateRef. map ( keyPath: scope) { ( ref: inout InoutRef < Scope > ) -> Result in
363
363
ref. append ( trace: trace)
364
364
return try mutation ( & ref)
365
365
}
@@ -376,7 +376,7 @@ extension StoreDriverType {
376
376
_ file: StaticString = #file,
377
377
_ function: StaticString = #function,
378
378
_ line: UInt = #line,
379
- mutation: ( inout sending InoutRef< Scope > , inout Transaction ) throws -> Result
379
+ mutation: ( inout InoutRef < Scope > , inout Transaction ) throws -> Result
380
380
) rethrows -> Result {
381
381
let trace = MutationTrace (
382
382
name: name,
@@ -385,9 +385,9 @@ extension StoreDriverType {
385
385
line: line
386
386
)
387
387
388
- return try store. asStore ( ) . _receive (
388
+ return try store. asStore ( ) . _receive_sending (
389
389
mutation: { [ scope] state, transaction -> Result in
390
- try state. map ( keyPath: scope) { ( ref: inout sending InoutRef< Scope > ) -> Result in
390
+ try state. map ( keyPath: scope) { ( ref: inout InoutRef < Scope > ) -> Result in
391
391
ref. append ( trace: trace)
392
392
return try mutation ( & ref, & transaction)
393
393
}
@@ -403,15 +403,15 @@ extension StoreDriverType {
403
403
_ file: StaticString = #file,
404
404
_ function: StaticString = #function,
405
405
_ line: UInt = #line,
406
- mutation: ( inout sending InoutRef< Scope > ) throws -> Result
406
+ mutation: ( inout InoutRef < Scope > ) throws -> Result
407
407
) rethrows -> Result where Scope == TargetStore . State {
408
408
let trace = MutationTrace (
409
409
name: name,
410
410
file: file,
411
411
function: function,
412
412
line: line
413
413
)
414
- return try store. asStore ( ) . _receive (
414
+ return try store. asStore ( ) . _receive_sending (
415
415
mutation: { ref, transaction -> Result in
416
416
ref. append ( trace: trace)
417
417
return try mutation ( & ref)
@@ -427,15 +427,15 @@ extension StoreDriverType {
427
427
_ file: StaticString = #file,
428
428
_ function: StaticString = #function,
429
429
_ line: UInt = #line,
430
- mutation: ( inout sending InoutRef< Scope > , inout Transaction ) throws -> Result
430
+ mutation: ( inout InoutRef < Scope > , inout Transaction ) throws -> Result
431
431
) rethrows -> Result where Scope == TargetStore . State {
432
432
let trace = MutationTrace (
433
433
name: name,
434
434
file: file,
435
435
function: function,
436
436
line: line
437
437
)
438
- return try store. asStore ( ) . _receive (
438
+ return try store. asStore ( ) . _receive_sending (
439
439
mutation: { ref, transaction -> Result in
440
440
ref. append ( trace: trace)
441
441
return try mutation ( & ref, & transaction)
@@ -451,8 +451,8 @@ extension StoreDriverType {
451
451
_ file: StaticString = #file,
452
452
_ function: StaticString = #function,
453
453
_ line: UInt = #line,
454
- mutation: sending ( inout sending InoutRef< Scope > ) throws -> sending Result
455
- ) async rethrows -> sending Result {
454
+ mutation: sending ( inout InoutRef < Scope > ) throws -> Result
455
+ ) async rethrows -> Result {
456
456
457
457
let trace = MutationTrace (
458
458
name: name,
@@ -463,20 +463,21 @@ extension StoreDriverType {
463
463
464
464
let result = try await store. asStore ( ) . writer. perform { [ store = self . store, scope] in
465
465
466
- let result = try store. asStore ( ) . _receive_sending { ref, _ in
466
+ let r = try store. asStore ( ) . _receive_sending { ref, _ in
467
467
468
- let result = try ref. map_sending ( keyPath: scope) { ref in
468
+ let r = try ref. map_sending ( keyPath: scope) { ref in
469
469
ref. append ( trace: trace)
470
- return try mutation ( & ref)
470
+ let r = try mutation ( & ref)
471
+ let workaround = { r }
472
+ return workaround ( )
471
473
}
472
474
473
- let box = UnsafeSendableStruct ( result)
474
-
475
- return box. send ( )
475
+ let workaround = { r }
476
+ return workaround ( )
476
477
}
477
478
478
- let box = UnsafeSendableStruct ( result )
479
- return box . send ( )
479
+ let workaround = { r }
480
+ return workaround ( )
480
481
}
481
482
482
483
await self . waitUntilAllEventConsumed ( )
@@ -492,8 +493,8 @@ extension StoreDriverType {
492
493
_ file: StaticString = #file,
493
494
_ function: StaticString = #function,
494
495
_ line: UInt = #line,
495
- mutation: sending ( inout sending InoutRef< Scope > , inout Transaction ) throws -> sending Result
496
- ) async rethrows -> sending Result {
496
+ mutation: sending ( inout InoutRef < Scope > , inout Transaction ) throws -> Result
497
+ ) async rethrows -> Result {
497
498
498
499
let trace = MutationTrace (
499
500
name: name,
@@ -504,20 +505,21 @@ extension StoreDriverType {
504
505
505
506
let result = try await store. asStore ( ) . writer. perform { [ store = self . store, scope] in
506
507
507
- let result = try store. asStore ( ) . _receive_sending { ref, transaction in
508
+ let r = try store. asStore ( ) . _receive_sending { ref, transaction in
508
509
509
- let result = try ref. map_sending ( keyPath: scope) { ref in
510
+ let r = try ref. map_sending ( keyPath: scope) { ref in
510
511
ref. append ( trace: trace)
511
- return try mutation ( & ref, & transaction)
512
+ let r = try mutation ( & ref, & transaction)
513
+ let workaround = { r }
514
+ return workaround ( )
512
515
}
513
516
514
- let box = UnsafeSendableStruct ( result)
515
-
516
- return box. send ( )
517
+ let workaround = { r }
518
+ return workaround ( )
517
519
}
518
520
519
- let box = UnsafeSendableStruct ( result )
520
- return box . send ( )
521
+ let workaround = { r }
522
+ return workaround ( )
521
523
}
522
524
523
525
await self . waitUntilAllEventConsumed ( )
@@ -533,8 +535,8 @@ extension StoreDriverType {
533
535
_ file: StaticString = #file,
534
536
_ function: StaticString = #function,
535
537
_ line: UInt = #line,
536
- mutation: sending ( inout sending InoutRef< Scope > ) throws -> sending Result
537
- ) async rethrows -> sending Result where Scope == TargetStore . State {
538
+ mutation: sending ( inout InoutRef < Scope > ) throws -> Result
539
+ ) async rethrows -> Result where Scope == TargetStore . State {
538
540
539
541
let trace = MutationTrace (
540
542
name: name,
@@ -545,13 +547,15 @@ extension StoreDriverType {
545
547
546
548
let result = try await store. asStore ( ) . writer. perform { [ store = self . store] in
547
549
548
- let result = try store. asStore ( ) . _receive_sending { ref, _ in
550
+ let r = try store. asStore ( ) . _receive_sending { ref, _ in
549
551
ref. append ( trace: trace)
550
- return try mutation ( & ref)
552
+ let r = try mutation ( & ref)
553
+ let workaround = { r }
554
+ return workaround ( )
551
555
}
552
556
553
- let box = UnsafeSendableStruct ( result )
554
- return box . send ( )
557
+ let workaround = { r }
558
+ return workaround ( )
555
559
}
556
560
557
561
await self . waitUntilAllEventConsumed ( )
@@ -568,8 +572,8 @@ extension StoreDriverType {
568
572
_ file: StaticString = #file,
569
573
_ function: StaticString = #function,
570
574
_ line: UInt = #line,
571
- mutation: sending ( inout sending InoutRef< Scope > , inout Transaction ) throws -> sending Result
572
- ) async rethrows -> sending Result where Scope == TargetStore . State , Self : Sendable {
575
+ mutation: sending ( inout InoutRef < Scope > , inout Transaction ) throws -> Result
576
+ ) async rethrows -> Result where Scope == TargetStore . State , Self : Sendable {
573
577
574
578
let trace = MutationTrace (
575
579
name: name,
@@ -580,13 +584,15 @@ extension StoreDriverType {
580
584
581
585
let result = try await store. asStore ( ) . writer. perform { [ store = self . store] in
582
586
583
- let result = try store. asStore ( ) . _receive_sending { ref, transaction in
587
+ let r = try store. asStore ( ) . _receive_sending { ref, transaction in
584
588
ref. append ( trace: trace)
585
- return try mutation ( & ref, & transaction)
589
+ let r = try mutation ( & ref, & transaction)
590
+ let workaround = { r }
591
+ return workaround ( )
586
592
}
587
593
588
- let box = UnsafeSendableStruct ( result )
589
- return box . send ( )
594
+ let workaround = { r }
595
+ return workaround ( )
590
596
}
591
597
592
598
await self . waitUntilAllEventConsumed ( )
0 commit comments