lambdaisland/deep-diff2

Fails with records with deleted keys

ProjectFrank opened this issue · 0 comments

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')