Skip to content

Fails with records with deleted keys #29

Closed
@ProjectFrank

Description

@ProjectFrank

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions