differ icon indicating copy to clipboard operation
differ copied to clipboard

Can't empty a Record

Open NoahTheDuke opened this issue 5 years ago • 0 comments

When comparing two objects where the first is a Record and the second is a sequence, remove will execute the :else of the cond, calling empty on the record, which will throw a java.lang.UnsupportedOperationException error.

user=> (defrecord t [value])
user.t
user=> (def t1 (t. 1))
#'user/t1
user=> (require '[differ.core :as differ])
nil
user=> (differ/diff t1 [:b])
UnsupportedOperationException Can't create empty: user.t  user.t (form-init4042193147418073646.clj:1)

NoahTheDuke avatar May 05 '20 23:05 NoahTheDuke