metosin / malli

High-performance data-driven data specification library for Clojure/Script.
Eclipse Public License 2.0
1.46k stars 208 forks source link

`mi/collect!` without args doesn't work properly #834

Closed bartkl closed 1 year ago

bartkl commented 1 year ago

As discussed on Slack, this code provided by @ikitommi works fine:

(ns demo)

(defn plus
  "adds two numbers together"
  {:malli/schema [:=> [:cat :int :int] :int]}
  [z y]
  (+ z y))

(require '[malli.instrument])
(malli.instrument/collect! {:ns 'demo})
;#{{:clj {demo {plus {:schema [:=> [:cat :int :int] :int]
;                     :ns demo, :name plus}}}}}

But (malli.instrument/collect!) without arguments does not. It gives something like:

Syntax error (ClassNotFoundException) compiling at ...
demo

Per request I created this issue.

ikitommi: Ugh, that doesn't look right. Not using the 0-arity, it's clearly broken. ikitommi: Issue welcome, should be easy to fix