From e4964de952a8246307faaf9875d2c278f42c53fc Mon Sep 17 00:00:00 2001 From: Mattias EngdegÄrd Date: Thu, 22 Sep 2022 14:15:56 +0200 Subject: Don't rewrite `set` to `setq` of lexical variables Only perform the rewrite (set 'VAR X) -> (setq VAR X) for dynamic variables, as `set` isn't supposed to affect lexical vars (and never does so when interpreted). * lisp/emacs-lisp/byte-opt.el (byte-optimize-set): * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--xx): New. (bytecomp-tests--test-cases): Add test cases. * test/lisp/emacs-lisp/bytecomp-resources/warn-variable-set-nonvariable.el: Remove obsolete test. --- .../emacs-lisp/bytecomp-resources/warn-variable-set-nonvariable.el | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 test/lisp/emacs-lisp/bytecomp-resources/warn-variable-set-nonvariable.el (limited to 'test/lisp/emacs-lisp/bytecomp-resources/warn-variable-set-nonvariable.el') diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-variable-set-nonvariable.el b/test/lisp/emacs-lisp/bytecomp-resources/warn-variable-set-nonvariable.el deleted file mode 100644 index 0c76c4d388b..00000000000 --- a/test/lisp/emacs-lisp/bytecomp-resources/warn-variable-set-nonvariable.el +++ /dev/null @@ -1,3 +0,0 @@ -;;; -*- lexical-binding: t -*- -(defun foo () - (set '(a) nil)) -- cgit v1.2.3