diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 966990bac9..418070fabe 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -3357,6 +3357,7 @@ byte-compile-check-variable (and od (not (memq var byte-compile-not-obsolete-vars)) (not (memq var byte-compile-global-not-obsolete-vars)) + (not (memq var byte-compile-lexical-variables)) (or (pcase (nth 1 od) ('set (not (eq access-type 'reference))) ('get (eq access-type 'reference))