We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 999da27 commit e9874baCopy full SHA for e9874ba
src/clj/cljs/analyzer.clj
@@ -478,7 +478,10 @@
478
;; lets us optimize self calls
479
(no-warn (doall (map #(analyze-fn-method menv locals % type) meths)))
480
methods)]
481
- ;;todo - validate unique arities, at most one variadic, variadic takes max required args
+ ;;todo - at most one variadic, variadic takes max required args
482
+ (let [param-counts (map (comp count :params) methods)]
483
+ (when (not= (distinct param-counts) param-counts)
484
+ (throw (error env "Can't have 2 overloads with same arity"))))
485
{:env env :op :fn :form form :name name-var :methods methods :variadic variadic
486
:recur-frames *recur-frames* :loop-lets *loop-lets*
487
:jsdoc [(when variadic "@param {...*} var_args")]
0 commit comments