(unless tail
(bytecomp--cus-warn type "`%s' without any types inside" head))
(let ((clauses tail)
- (constants nil))
+ (constants nil)
+ (tags nil))
(while clauses
(let* ((ty (car clauses))
(ty-head (car-safe ty)))
(bytecomp--cus-warn
ty "duplicated value in `%s': `%S'" head val))
(push val constants)))
+ (let ((tag (and (consp ty) (plist-get (cdr ty) :tag))))
+ (when (stringp tag)
+ (when (member tag tags)
+ (bytecomp--cus-warn
+ ty "duplicated :tag string in `%s': %S" head tag))
+ (push tag tags)))
(bytecomp--check-cus-type ty))
(setq clauses (cdr clauses)))))
((eq head 'cons)
(FIXTURE-FN \\='#\\='electric-pair-mode))" fill-column)))
(ert-deftest bytecomp-test-defcustom-type ()
- (cl-flet ((dc (type) `(defcustom mytest nil "doc" :type ',type)))
+ (cl-flet ((dc (type) `(defcustom mytest nil "doc" :type ',type :group 'test)))
(bytecomp--with-warning-test
(rx "type should not be quoted") (dc ''integer))
(bytecomp--with-warning-test
(bytecomp--with-warning-test
(rx "duplicated value in `choice': `a'")
(dc '(choice (const a) (const b) (const a))))
+ (bytecomp--with-warning-test
+ (rx "duplicated :tag string in `choice': \"X\"")
+ (dc '(choice (const :tag "X" a) (const :tag "Y" b) (other :tag "X" c))))
(bytecomp--with-warning-test
(rx "`cons' requires 2 type specs, found 1")
(dc '(cons :tag "a" integer)))