Fork me on GitHub
#clojure-spec
<
2021-03-02
>
mpenet15:03:30

``````(defrecord Foo [])
(s/valid? (s/coll-of any?) (Foo.))
boom - Can't create empty: user.Foo``````

😎 1
mpenet15:03:26

seems like a bug

alexmiller15:03:32

it is, we have a ticket for it

mpenet15:03:39

you can avoid it using `:into coll?`

alexmiller15:03:47

it's one of those things that seems obvious but is way more subtle than it seems in the impl.

alexmiller15:03:54

yeah, it's a dupe of that

mpenet16:03:47

would setting a default for :into at coll-of level to coll? be bad (I mean in the impl itself)?

mpenet16:03:17

I get the fact that every-impl is shared quite a bit so that can't be baked in at this level

alexmiller17:03:13

very hard to say without a lot of thinking

alexmiller17:03:36

and I rewrote half of that stuff in spec 2