restart-case with :test incorrectly says restart is not active
It seems that a restart-case
with a :test
will let find-restart
find the restart, but when invoke-restart
is called on the restart, ECL errors with something like:
Restart #<RESTART.139699839459520> is not active.
[Condition of type SI::SIMPLE-CONTROL-ERROR]
Code that reproduces:
(define-condition a (error)
())
(defun restart-a (&optional condition)
(let ((restart (find-restart 'restart-a condition)))
(unless (null restart)
(invoke-restart restart))))
(defun fail ()
(handler-bind
((a (lambda (c) (restart-a c))))
(restart-case
(error 'a)
(restart-a ()
:test (lambda (c) (typep c 'a))
t))))
Then evaluate (fail)
. I expect t
, but instead end up with a SI::SIMPLE-CONTROL-ERROR
Provide details regarding ECL version (or preferably commit), operating system and if revelant the build options and versions of the build tools.
VERSION "21.2.1"
VCS-ID "c646799145538997d84ed6d8755be7e7837eb7ef"
OS "Linux"
OS-VERSION "5.10.58-gentoo"
MACHINE-TYPE "x86_64"
FEATURES (:NAMED-READTABLES :SPLIT-SEQUENCE :64-BIT :X86-64 :SWANK
:SERVE-EVENT :CLPM-CLIENT :ASDF-PACKAGE-SYSTEM :ASDF3.1 :ASDF3
:ASDF2 :ASDF :OS-UNIX :NON-BASE-CHARS-EXIST-P :ASDF-UNICODE
:WALKER :CDR-1 :CDR-5 :LINUX :FORMATTER :CDR-7 :ECL-WEAK-HASH
:LITTLE-ENDIAN :ECL-READ-WRITE-LOCK :LONG-LONG :UINT64-T
:UINT32-T :UINT16-T :COMPLEX-FLOAT :LONG-FLOAT :UNICODE :DFFI
:CLOS-STREAMS :CMU-FORMAT :UNIX :ECL-PDE :DLOPEN :CLOS :THREADS
:BOEHM-GC :ANSI-CL :COMMON-LISP :FLOATING-POINT-EXCEPTIONS
:IEEE-FLOATING-POINT :PACKAGE-LOCAL-NICKNAMES :CDR-14
:PREFIXED-API :FFI :X86_64 :COMMON :ECL)