File tree Expand file tree Collapse file tree 2 files changed +30
-4
lines changed Expand file tree Collapse file tree 2 files changed +30
-4
lines changed Original file line number Diff line number Diff line change 1
1
2
- public struct PropertyPath : Equatable {
2
+ @DebugDescription
3
+ public struct PropertyPath : Equatable , CustomDebugStringConvertible {
3
4
4
5
public struct Component : Equatable {
5
6
@@ -11,7 +12,13 @@ public struct PropertyPath: Equatable {
11
12
12
13
}
13
14
14
- public var components : [ Component ] = [ ]
15
+ public var components : [ Component ] = [ ] {
16
+ didSet {
17
+ #if DEBUG
18
+ _joined = components. map { $0. value } . joined ( separator: " . " )
19
+ #endif
20
+ }
21
+ }
15
22
16
23
public init ( ) {
17
24
@@ -26,5 +33,19 @@ public struct PropertyPath: Equatable {
26
33
self . components. append ( component)
27
34
return self
28
35
}
36
+
37
+ #if DEBUG
38
+ private var _joined : String = " "
39
+ #endif
40
+
41
+ #if DEBUG
42
+ public var debugDescription : String {
43
+ " \( _joined) \( components. count) "
44
+ }
45
+ #else
46
+ public var debugDescription : String {
47
+ " Components : \( components. count) "
48
+ }
49
+ #endif
29
50
30
51
}
Original file line number Diff line number Diff line change @@ -11,8 +11,13 @@ public enum TrackingRuntime {
11
11
trackingContext: borrowing _TrackingContext
12
12
) -> Value {
13
13
14
- trackingContext. trackingResultRef? . accessorRead ( path: trackingContext. path? . pushed ( component) )
15
-
14
+ if
15
+ let ref = trackingContext. trackingResultRef,
16
+ let path = trackingContext. path
17
+ {
18
+ ref. accessorRead ( path: path. pushed ( component) )
19
+ }
20
+
16
21
if var value = value as? TrackingObject , let ref = trackingContext. trackingResultRef {
17
22
18
23
if value. _tracking_context. trackingResultRef !== ref {
You can’t perform that action at this time.
0 commit comments