diff --git a/src/code/loop.lisp b/src/code/loop.lisp index eea95f8..d42be8f 100644 --- a/src/code/loop.lisp +++ b/src/code/loop.lisp @@ -1037,9 +1037,8 @@ code to be loaded. (cond ((null name) (setq name (gensym "LOOP-IGNORE-")) (push (list name initialization) *loop-vars*) - (if (null initialization) - (push `(ignore ,name) *loop-declarations*) - (loop-declare-var name dtype))) + (push `(ignore ,name) *loop-declarations*) + (loop-declare-var name dtype)) ((atom name) (when (or (assoc name *loop-vars*) (loop-var-p name)) diff --git a/tests/loop.pure.lisp b/tests/loop.pure.lisp index 84a833a..9e351ef 100644 --- a/tests/loop.pure.lisp +++ b/tests/loop.pure.lisp @@ -256,3 +256,12 @@ (assert (equal '("foo" "bar") (funcall fun (vector "foo" "bar")))))) + + +(with-test (:name :bug-lp613871) + (multiple-value-bind (function warnings-p failure-p) + (compile nil '(lambda () (loop with nil = 1 repeat 1))) + (assert (null warnings-p)) + (assert (null failure-p)) + (assert (not (null function))))) +