branch: externals/dash
commit b9286a84975874b10493f1cb4ea051c501f51273
Author: Basil L. Contovounesios <conto...@tcd.ie>
Commit: Basil L. Contovounesios <conto...@tcd.ie>

    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.
---
 dash.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/dash.el b/dash.el
index 499a883..af22ef9 100644
--- a/dash.el
+++ b/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))))))
 

Reply via email to