Fork me on GitHub
#clojure-spec
<
2018-09-23
>
dottedmag08:09:32

I'd like to instrument a function taking an argument spec'ed in another namespace. When I do (s/fdef my-func :args (s/cat :arg1 :alias/myspec)) it fails to resolve spec via alias. (s/fdef my-func :args (s/cat :arg1 :)) works. Is it intended?

taylor11:09:00

for ::alias/myspec to work I think you need to require/alias that namespace e.g. (require '[some.ns :as alias])

dottedmag13:09:11

@U3DAE8HMG Yep, thanks. I was using wrong syntax (with a single :).

dottedmag08:09:38

Oh, :alias/myspec vs ::alias/myspec.