* lisp/emacs-lisp/bytecomp.el: Don't warn for repeated _ args

(byte-compile-check-lambda-list): Skip warnings of repeated arg for
those that are declared as unused anyway.
This commit is contained in:
Stefan Monnier 2021-02-19 12:51:36 -05:00
parent 9b7eed33f9
commit b6eccad06c

View file

@ -2859,7 +2859,9 @@ If FORM is a lambda or a macro, byte-compile it as a function."
((eq arg '&optional)
(when (memq '&optional (cdr list))
(error "Duplicate &optional")))
((memq arg vars)
((and (memq arg vars)
;; Allow repetitions for unused args.
(not (string-match "\\`_" (symbol-name arg))))
(byte-compile-warn "repeated variable %s in lambda-list" arg))
(t
(push arg vars))))