Skip to content

Fails with records with deleted keys #29

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

Closed
ProjectFrank opened this issue Aug 30, 2022 · 0 comments · Fixed by #31
Closed

Fails with records with deleted keys #29

ProjectFrank opened this issue Aug 30, 2022 · 0 comments · Fixed by #31

Comments

@ProjectFrank
Copy link
Contributor

ProjectFrank commented Aug 30, 2022

Similar to #3, but applies to records with deletions. I believe this applies to both deep-diff and deep-diff2.

This arises from invoking the record as a function in diff-map which works for maps, but not records since they don't automatically implement IFn.

I can put together a minimal repro and a PR in the next couple days.

lambdaisland.deep-diff.diff> (defrecord MyRecord [])
lambdaisland.deep_diff.diff.MyRecord
lambdaisland.deep-diff.diff> (diff (map->MyRecord {:foo "bar"}) (map->MyRecord {}))
Execution error (ClassCastException) at lambdaisland.deep-diff.diff/diff-map$fn (diff.clj:116).
class lambdaisland.deep_diff.diff.MyRecord cannot be cast to class clojure.lang.IFn (lambdaisland.deep_diff.diff.MyRecord is in unnamed module of loader clojure.lang.DynamicClassLoader @11f4ce76; clojure.lang.IFn is in unnamed module of loader 'app')
@ProjectFrank ProjectFrank changed the title Records with insertions break Records with deletions break Aug 30, 2022
@ProjectFrank ProjectFrank changed the title Records with deletions break Fails with records with deleted keys Aug 30, 2022
ProjectFrank added a commit to ProjectFrank/deep-diff2 that referenced this issue Aug 30, 2022
ProjectFrank added a commit to ProjectFrank/deep-diff2 that referenced this issue Aug 30, 2022
ProjectFrank added a commit to ProjectFrank/deep-diff2 that referenced this issue Aug 30, 2022
@plexus plexus closed this as completed in 3632023 Sep 1, 2022
plexus added a commit that referenced this issue Sep 1, 2022
## Fixed

- Fix issue (Fails with records with deleted keys)[#29]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant