]>
git.eshelyaron.com Git - emacs.git/commit
Warn about lambda expressions in comparisons
Lambda expressions are not comparable; warn about calls such as
(eq x (lambda ...)) etc.
* lisp/emacs-lisp/bytecomp.el (bytecomp--dodgy-eq-arg): Rename to...
(bytecomp--dodgy-eq-arg-p): ...this. Use pcase. Add lambda checks.
(bytecomp--value-type-description, bytecomp--arg-type-description)
(bytecomp--check-eq-args, bytecomp--check-memq-args): Add function
checks. Update calls. Make compiler-macro arguments optional to
avoid crashes in malformed code.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp--with-warning-test): Simplify argument. Run each
compilation with a fresh (empty) warning cache. Add ert-info for
easier debugging.
(bytecomp-warn-dodgy-args-eq, bytecomp-warn-dodgy-args-memq):
Add lambda tests.