`
user> (require '[clojure.spec :as s])
nil
user> (defrecord Box [a])
user.Box
user>
user> (s/conform
(s/cat :boxes (s/* #(instance? Box %))
:name (s/coll-of integer?))
[(Box. 0) [5]])
UnsupportedOperationException Can't create empty: user.Box user.Box (form-init8049111656025227309.clj:1)
user> (clojure.repl/pst *e)
UnsupportedOperationException Can't create empty: user.Box
user.Box (NO_SOURCE_FILE:2)
clojure.core/empty (core.clj:5151)
clojure.spec/every-impl/cfns--14008/fn--14014 (spec.clj:1215)
clojure.spec/every-impl/reify--14027 (spec.clj:1229)
clojure.spec/conform (spec.clj:150)
clojure.spec/dt (spec.clj:731)
clojure.spec/dt (spec.clj:727)
clojure.spec/deriv (spec.clj:1456)
clojure.spec/deriv (spec.clj:1463)
clojure.spec/deriv (spec.clj:1467)
clojure.spec/re-conform (spec.clj:1589)
clojure.spec/regex-spec-impl/reify--14267 (spec.clj:1633)
`
这是从-alpha7回归的一个问题;类似的spec(除coll-of的默认值参数外)在那里按预期工作。