File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -559,51 +559,67 @@ public final class CachedValues: @unchecked Sendable {
559
559
}
560
560
#endif
561
561
562
+ print ( #fileID, #line)
562
563
guard let base = cached [ cacheKey] ? . base, let value = base as? Key . Value
563
564
else {
565
+ print ( #fileID, #line)
564
566
let value : Key . Value ?
565
567
switch context {
566
568
case . live:
569
+ print ( #fileID, #line)
567
570
value = ( key as? any DependencyKey . Type) ? . liveValue as? Key . Value
568
571
case . preview:
572
+ print ( #fileID, #line)
569
573
if Thread . isPreviewAppEntryPoint {
570
574
return Key . previewValue
571
575
}
572
576
if !CachedValues. isAccessingCachedDependencies {
577
+ print ( #fileID, #line)
573
578
value = CachedValues . $isAccessingCachedDependencies. withValue ( true ) {
574
579
#if canImport(SwiftUI) && compiler(>=6)
580
+ print ( #fileID, #line)
575
581
return previewValues [ key]
576
582
#else
583
+ print ( #fileID, #line)
577
584
return Key . previewValue
578
585
#endif
579
586
}
580
587
} else {
588
+ print ( #fileID, #line)
581
589
value = Key . previewValue
582
590
}
583
591
case . test:
584
592
#if compiler(<6.1)
593
+ print ( #fileID, #line)
585
594
if !CachedValues. isAccessingCachedDependencies,
586
595
case let . swiftTesting( . some( testing) ) = TestContext . current,
587
596
let testValues = testValuesByTestID. withValue ( { $0 [ testing. test. id. rawValue] } )
588
597
{
598
+ print ( #fileID, #line)
589
599
value = CachedValues . $isAccessingCachedDependencies. withValue ( true ) {
590
600
testValues [ key]
591
601
}
592
602
} else {
603
+ print ( #fileID, #line)
593
604
value = Key . testValue
594
605
}
595
606
#else
607
+ print ( #fileID, #line)
596
608
value = Key . testValue
597
609
#endif
598
610
}
599
611
612
+ print ( #fileID, #line)
600
613
let cacheableValue = value ?? Key . testValue
614
+ print ( #fileID, #line)
601
615
cached [ cacheKey] = CachedValue (
602
616
base: cacheableValue,
603
617
preparationID: DependencyValues . preparationID
604
618
)
619
+ print ( #fileID, #line)
605
620
return cacheableValue
606
621
}
622
+ print ( #fileID, #line)
607
623
608
624
return value
609
625
}
You can’t perform that action at this time.
0 commit comments