clojure-spec

About: http://clojure.org/about/spec Guide: http://clojure.org/guides/spec API: https://clojure.github.io/spec.alpha/clojure.spec.alpha-api.html
wagjo 2020-05-26T19:37:47.048600Z

Hi, using latest spec2 alpha, I get an exception, is this a known issue or am I doing something wrong?

(s/def :foo/a string?)
(s/def :foo/b :foo/a)
(s/def :foo/m (s/schema [:foo/a :foo/b]))
(s/valid? :foo/m {:foo/a "s" :foo/b "d"})
Unhandled java.lang.IllegalArgumentException
   No implementation of method: :conform* of protocol:
   #'clojure.alpha.spec.protocols/Spec found for class:
   clojure.lang.Keyword

alexmiller 2020-05-26T19:44:52.048800Z

it's a known issue for aliased specs

alexmiller 2020-05-26T19:45:01.049Z

in that they don't work right

wagjo 2020-05-26T19:47:48.049700Z

thanks, I'll use (s/def :foo/b (s/and :foo/a)) as a workaround for now