@@ -81,20 +81,20 @@ extension Case {
81
81
// )
82
82
// }
83
83
// #else
84
- public subscript< AppendedValue> (
85
- dynamicMember keyPath: KeyPath < Value . AllCasePaths , AnyCasePath < Value , AppendedValue > >
86
- ) -> Case < AppendedValue >
87
- where Value: CasePathable {
88
- @UncheckedSendable var keyPath = keyPath
89
- return Case < AppendedValue > (
90
- embed: { [ $keyPath] in
91
- embed ( Value . allCasePaths [ keyPath: $keyPath. wrappedValue] . embed ( $0) )
92
- } ,
93
- extract: { [ $keyPath] in
94
- extract ( from: $0) . flatMap ( Value . allCasePaths [ keyPath: $keyPath. wrappedValue] . extract)
95
- }
96
- )
97
- }
84
+ public subscript< AppendedValue> (
85
+ dynamicMember keyPath: KeyPath < Value . AllCasePaths , AnyCasePath < Value , AppendedValue > >
86
+ ) -> Case < AppendedValue >
87
+ where Value: CasePathable {
88
+ @UncheckedSendable var keyPath = keyPath
89
+ return Case < AppendedValue > (
90
+ embed: { [ $keyPath] in
91
+ embed ( Value . allCasePaths [ keyPath: $keyPath. wrappedValue] . embed ( $0) )
92
+ } ,
93
+ extract: { [ $keyPath] in
94
+ extract ( from: $0) . flatMap ( Value . allCasePaths [ keyPath: $keyPath. wrappedValue] . extract)
95
+ }
96
+ )
97
+ }
98
98
// #endif
99
99
100
100
public func embed( _ value: Value ) -> Any {
@@ -532,26 +532,26 @@ extension AnyCasePath where Value: CasePathable {
532
532
// )
533
533
// }
534
534
// #else
535
- /// Returns a new case path created by appending the case path at the given key path to this one.
536
- ///
537
- /// This subscript is automatically invoked by case key path expressions via dynamic member
538
- /// lookup, and should not be invoked directly.
539
- ///
540
- /// - Parameter keyPath: A key path to a case-pathable case path.
541
- public subscript< AppendedValue> (
542
- dynamicMember keyPath: KeyPath < Value . AllCasePaths , AnyCasePath < Value , AppendedValue > >
543
- ) -> AnyCasePath < Root , AppendedValue > {
544
- @UncheckedSendable var keyPath = keyPath
545
- return AnyCasePath < Root , AppendedValue > (
546
- embed: { [ $keyPath] in
547
- embed ( Value . allCasePaths [ keyPath: $keyPath. wrappedValue] . embed ( $0) )
548
- } ,
549
- extract: { [ $keyPath] in
550
- extract ( from: $0) . flatMap (
551
- Value . allCasePaths [ keyPath: $keyPath. wrappedValue] . extract ( from: )
552
- )
553
- }
554
- )
555
- }
535
+ /// Returns a new case path created by appending the case path at the given key path to this one.
536
+ ///
537
+ /// This subscript is automatically invoked by case key path expressions via dynamic member
538
+ /// lookup, and should not be invoked directly.
539
+ ///
540
+ /// - Parameter keyPath: A key path to a case-pathable case path.
541
+ public subscript< AppendedValue> (
542
+ dynamicMember keyPath: KeyPath < Value . AllCasePaths , AnyCasePath < Value , AppendedValue > >
543
+ ) -> AnyCasePath < Root , AppendedValue > {
544
+ @UncheckedSendable var keyPath = keyPath
545
+ return AnyCasePath < Root , AppendedValue > (
546
+ embed: { [ $keyPath] in
547
+ embed ( Value . allCasePaths [ keyPath: $keyPath. wrappedValue] . embed ( $0) )
548
+ } ,
549
+ extract: { [ $keyPath] in
550
+ extract ( from: $0) . flatMap (
551
+ Value . allCasePaths [ keyPath: $keyPath. wrappedValue] . extract ( from: )
552
+ )
553
+ }
554
+ )
555
+ }
556
556
// #endif
557
557
}
0 commit comments