File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 29732973 :method-params sigs
29742974 :arglists arglists
29752975 :arglists-meta (doall (map meta arglists))})
2976- args-sym (gensym " args" )]
2976+ args-sym (gensym " args" )
2977+ param-counts (map count arglists)]
2978+ (core/when (not= (distinct param-counts) param-counts)
2979+ (ana/warning :overload-arity {} {:name name}))
29772980 `(do
29782981 (def ~(with-meta name meta)
29792982 (fn [~'var_args]
Original file line number Diff line number Diff line change 482482 (println x)))))
483483 (is (.startsWith (first @ws) " js/foo is shadowed by a local" ))))
484484
485+ (deftest test-cljs-2005
486+ (let [ws (atom [])]
487+ (try
488+ (a/with-warning-handlers [(collecting-warning-handler ws)]
489+ (a/analyze (a/empty-env )
490+ '(defn myfun
491+ ([x] x)
492+ ([x] x))))
493+ (catch Exception _))
494+ (is (.startsWith (first @ws) " myfun: Can't have 2 overloads with same arity" ))))
495+
485496(deftest test-canonicalize-specs
486497 (is (= (a/canonicalize-specs '((quote [clojure.set :as set])))
487498 '([clojure.set :as set])))
You can’t perform that action at this time.
0 commit comments