Recreate symptom of Bug#42701.

The fix to Bug#48489 (commit 9676d41b83)
has masked the symptom of Bug#42701 for 'if-let'.  Create a helper
macro that still exemplifies the bug.

* test/lisp/emacs-lisp/edebug-tests.el
(edebug-tests--duplicate-symbol-backtrack): New helper macro.
(edebug-tests-duplicate-symbol-backtrack): Use it instead of 'if-let'.
This commit is contained in:
Philipp Stephani 2021-05-18 18:43:11 +02:00
parent 68f5718c0a
commit 63e4ed1c8f

View file

@ -1029,14 +1029,21 @@ clashes (Bug#41853)."
inner@cl-flet@10002
edebug-tests-cl-flet-2)))))))
(defmacro edebug-tests--duplicate-symbol-backtrack (arg)
"Helper macro that exemplifies Bug#42701.
ARG is either (FORM) or (FORM IGNORED)."
(declare (debug ([&or (form) (form sexp)])))
(car arg))
(ert-deftest edebug-tests-duplicate-symbol-backtrack ()
"Check that Edebug doesn't create duplicate symbols when
backtracking (Bug#42701)."
(with-temp-buffer
(dolist (form '((require 'subr-x)
(defun edebug-tests-duplicate-symbol-backtrack ()
(if-let (x (funcall (lambda (y) 1) 2)) 3 4))))
(print form (current-buffer)))
(print '(defun edebug-tests-duplicate-symbol-backtrack ()
(edebug-tests--duplicate-symbol-backtrack
;; Passing (FORM IGNORED) forces backtracking.
((lambda () 123) ignored)))
(current-buffer))
(let* ((edebug-all-defs t)
(edebug-initial-mode 'Go-nonstop)
(instrumented-names ())