clojure-spec

OknoLombarda 2023-05-24T12:32:57.839189Z

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) 2023-05-24T12:51:08.718509Z

in general, cases of this are bugs

Alex Miller (Clojure team) 2023-05-24T12:51:28.784439Z

if you have one, please put it on https://ask.clojure.org

OknoLombarda 2023-05-24T14:43:03.591929Z

posted minimal example there https://ask.clojure.org/index.php/12957/inconsistent-results-from-valid-explain-when-trying-values

Alex Miller (Clojure team) 2023-05-24T14:50:42.332159Z

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

OknoLombarda 2023-05-24T15:04:34.504379Z

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

OknoLombarda 2023-05-24T15:24:26.845409Z

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