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 2973
2973
:method-params sigs
2974
2974
:arglists arglists
2975
2975
: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}))
2977
2980
`(do
2978
2981
(def ~(with-meta name meta)
2979
2982
(fn [~'var_args]
Original file line number Diff line number Diff line change 482
482
(println x)))))
483
483
(is (.startsWith (first @ws) " js/foo is shadowed by a local" ))))
484
484
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
+
485
496
(deftest test-canonicalize-specs
486
497
(is (= (a/canonicalize-specs '((quote [clojure.set :as set])))
487
498
'([clojure.set :as set])))
You can’t perform that action at this time.
0 commit comments