summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/cconv.el
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2021-07-29 17:20:41 +0200
committerMattias EngdegÄrd <mattiase@acm.org>2021-07-30 09:54:30 +0200
commitab9c06449df4c4c58d586573003de419199cc1be (patch)
treed06b4f3d6a700e7fc6e346ca8898b05a5c646c30 /lisp/emacs-lisp/cconv.el
parentdc9e2a1749c892cdf52a01414bee97e9a2245ca5 (diff)
downloademacs-ab9c06449df4c4c58d586573003de419199cc1be.tar.gz
emacs-ab9c06449df4c4c58d586573003de419199cc1be.tar.bz2
emacs-ab9c06449df4c4c58d586573003de419199cc1be.zip
Move warnings about bad let-bindings from source optimiser to cconv
* lisp/emacs-lisp/byte-opt.el (byte-optimize-let-form): Move warnings... * lisp/emacs-lisp/cconv.el (cconv-convert): ...here, which is an overall better place (closer to the front-end).
Diffstat (limited to 'lisp/emacs-lisp/cconv.el')
-rw-r--r--lisp/emacs-lisp/cconv.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/cconv.el b/lisp/emacs-lisp/cconv.el
index ea0b09805ea..e0795975c9b 100644
--- a/lisp/emacs-lisp/cconv.el
+++ b/lisp/emacs-lisp/cconv.el
@@ -358,6 +358,13 @@ places where they originally did not directly appear."
letsym binder))
(setq value (cadr binder))
(car binder)))
+ (_ (cond
+ ((not (symbolp var))
+ (byte-compile-warn "attempt to let-bind nonvariable `%S'"
+ var))
+ ((or (booleanp var) (keywordp var))
+ (byte-compile-warn "attempt to let-bind constant `%S'"
+ var))))
(new-val
(pcase (cconv--var-classification binder form)
;; Check if var is a candidate for lambda lifting.