how is this possible? valid? returns false, meaning v doesn't conform to spec, but explain prints "Success!" as though it does
in general, cases of this are bugs
if you have one, please put it on https://ask.clojure.org
posted minimal example there https://ask.clojure.org/index.php/12957/inconsistent-results-from-valid-explain-when-trying-values
Can you add the spec? (preferably not tied to metosin stuff). Maybe you can (s/form ::sp) to see it?
will this do?
case> (s/form (ds/spec ::sp cards))
(spec-tools.core/spec
{:spec (clojure.spec.alpha/keys :req-un [:case$sp/cards]),
:type :map,
:leaf? false,
:name :case/sp})
case> (s/form :case$sp/cards)
(spec-tools.core/spec
{:spec
(clojure.spec.alpha/coll-of
(spec-tools.core/spec
{:spec clojure.core/int?,
:type :long,
:leaf? true,
:name :case$sp/cards})
:into
[]),
:type :vector,
:leaf? false,
:spec-tools.core/synthetic? true})I was told it might be issue of spec-tools itself, so I posted it on their github repo as well https://github.com/metosin/spec-tools/issues/275