Closed lukeredpath closed 1 year ago
It looks like the issue is that the ==
implementation is passing the AnySendable
into the valueIsEqualTo
function but it is expecting the underlying base value.
public static func == (lhs: Self, rhs: Self) -> Bool {
- lhs.keyPath == rhs.keyPath && lhs.valueIsEqualTo(rhs.value)
+ lhs.keyPath == rhs.keyPath && lhs.valueIsEqualTo(rhs.value.base)
}
Ah, turns out this is fixed on main.
Fixed by https://github.com/pointfreeco/swift-composable-architecture/pull/2248
Is there any chance of a 0.55.1 release with this fix please?
Description
I'm trying to upgrade to 0.55 and there seems to have been a change in the implementation of
BindingAction<T>
equality, because I have some tests that.receive
a binding action which fail due to them not being equal.Checklist
main
branch of this package.Expected behavior
When using
store.receive(.set(\.$foo, "bar"))
in a test, if that action is received the test should pass.Actual behavior
The test fails, complaining that the actions were not equal although they have no differences.
On further inspection in the debugger, I set a breakpoint inside
BindingAction.==
and observed this in one of my tests:Steps to reproduce
There's a demo of this problem here: https://gist.github.com/lukeredpath/96ac8bfea295f0b729408ecce694ca26
The Composable Architecture version information
0.55.0
Destination operating system
iOS 16
Xcode version information
Xcode 14.3
Swift Compiler version information