]> git.eshelyaron.com Git - emacs.git/commitdiff
(cl-deftype): Silence spurious warnings in `xcb-types.el`
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 4 Jun 2025 23:27:08 +0000 (19:27 -0400)
committerEshel Yaron <me@eshelyaron.com>
Sat, 7 Jun 2025 20:00:49 +0000 (22:00 +0200)
* lisp/emacs-lisp/cl-macs.el (cl-deftype): Don't warn if the predicate
doesn't use its argument, e.g. when the type is equivalent to `t`.

(cherry picked from commit 1903b0062b1688241d1485b3e460264e124ba757)

lisp/emacs-lisp/cl-macs.el

index 51ab55c508cae4bd14b99b7687a62fdb078e131f..0794337922cb243eb975b59fa7fd90bcbd9b0f6f 100644 (file)
@@ -3757,7 +3757,7 @@ If PARENTS is non-nil, ARGLIST must be nil."
             (pcase specifier
               (`(satisfies ,f) `#',f)
               ('nil nil)
-              (type `(lambda (x) (cl-typep x ',type))))))
+              (type `(lambda (x) (ignore x) (cl-typep x ',type))))))
       `(eval-and-compile
          (cl--define-derived-type
           ',name ,expander ,predicate ',parents)))))