Pacify uninitialized lexvar warnings in Emacs 28

* dash.el (--reduce, --reductions-r): Pacify false positive warnings
in Emacs 28 about redundant nil-initialized lexical variables.

Fixes #377.
master
Basil L. Contovounesios 5 years ago
parent a17b6b5409
commit b9286a8497
No known key found for this signature in database
GPG Key ID: 205AB54A5D5D8CFF
  1. 8
      dash.el

@ -257,7 +257,9 @@ This is the anaphoric counterpart to `-reduce'."
`(let ((,lv ,list))
(if ,lv
(--reduce-from ,form (car ,lv) (cdr ,lv))
(let (acc it)
;; Explicit nil binding pacifies lexical "variable left uninitialized"
;; warning. See issue #377 and upstream https://bugs.gnu.org/47080.
(let ((acc nil) (it nil))
(ignore acc it)
,form)))))
@ -419,7 +421,9 @@ This is the anaphoric counterpart to `-reductions-r'."
(--reduce-from (cons (let ((acc (car acc))) (ignore acc) ,form) acc)
(list (car ,lv))
(cdr ,lv))
(let (acc it)
;; Explicit nil binding pacifies lexical "variable left uninitialized"
;; warning. See issue #377 and upstream https://bugs.gnu.org/47080.
(let ((acc nil) (it nil))
(ignore acc it)
(list ,form))))))

Loading…
Cancel
Save