-
-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected behavior when using the default implementations of Differentiable
for Hashable
#114
Comments
After clone this project and modify the implementation to return DifferenceKit/Tests/AlgorithmTest.swift Lines 246 to 284 in f8c8d1e
I think it should be a It seems that DifferenceKit doesn't use the result of |
DifferenceKit provides a default implementation of
Differentiable
forHashable
. However, when using the default implementation, DifferenceKit always trigers adelete -> insert
change instead of aupdate
change.Unexpected
I have a simple model that uses the default
differenceIdentifier
implementation.Create a changeset between two items that have the same
id
but differentvalue
.Unfortunately, the output message shows that there is a
delete -> insert
update.Expected
If I explicitly implement the
differenceIdentifier
property by returnhashValue
, everything will be fine.The expected
update
change.Question
I'm not sure if this is a mistake of my code of a bug of DifferenceKit.
DifferenceKit provides a default implementation of
Differentiable
forHashable
, but the implementation ofdifferenceIdentifier
just return theHashable
instance itself. I think maybe thehashValue
is the right return value.The text was updated successfully, but these errors were encountered: