Fork me on GitHub
#clojure-spec
<
2023-05-24
>
OknoLombarda12:05:57

how is this possible? valid? returns false, meaning v doesn't conform to spec, but explain prints "Success!" as though it does

Alex Miller (Clojure team)12:05:08

in general, cases of this are bugs

Alex Miller (Clojure team)14:05:42

Can you add the spec? (preferably not tied to metosin stuff). Maybe you can (s/form ::sp) to see it?

OknoLombarda15:05:34

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

OknoLombarda15:05:26

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