I'm experiencing a problem with multi-arity macros in self-hosted CLJS in 1.5.520 (planck and lumo):
cljs.user=> (defmacro foo [] '[1 2 3])
#'cljs.user/foo
cljs.user=> (foo)
[1 2 3]
cljs.user=> (defmacro foo ([x] '[1 2 3]) ([x y] '[1 2 3 4]))
#'cljs.user/foo
cljs.user=> (foo 1)
Invalid arity: -1
Could be that this is fixed in CLJS 1.5.597, but I haven't got a planck or lumo running that version.can test later with the newest self-hosted
repro:
$ clj -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version "1.10.597"}}}' -m cljs.main -re node
ClojureScript 1.10.597
cljs.user=> (require '[cljs.js :refer [eval-str]])
cljs.user=> (eval-str (cljs.js/empty-state) "(ns foo.bar) (defmacro foo ([x] 1) ([x y] 2)) (foo 1)" nil {:eval cljs.js/js-eval } prn)
{:error #error {:message "ERROR", :data {:tag :cljs/analysis-error}, :cause #object[Error Error: Invalid arity: -1]}}
nil
if you want me to post an issue, let me know