Skip to content

Commit a07f255

Browse files
authored
Fix UITest case crash for LabelsHiddenModifierUITests (#614)
1 parent ab02ac4 commit a07f255

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Sources/OpenSwiftUICore/Data/Binding/Location.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ package struct FunctionalLocation<Value>: Location {
363363
}
364364

365365
package static func == (lhs: FunctionalLocation<Value>, rhs: FunctionalLocation<Value>) -> Bool {
366-
compareValues(lhs, rhs)
366+
compareValues(lhs.functions, rhs.functions)
367367
}
368368
}
369369

Tests/OpenSwiftUICoreTests/Data/Binding/LocationTests.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,5 +136,13 @@ struct LocationTests {
136136
location.set(2, transaction: .init())
137137
#expect(location.wasRead == true)
138138
#expect(location.get() == 4)
139+
140+
let location2 = FunctionalLocation {
141+
value.count
142+
} setValue: { newCount, _ in
143+
value.count = newCount * newCount
144+
}
145+
#expect(location2 != location)
146+
#expect(location == location)
139147
}
140148
}

0 commit comments

Comments
 (0)