From c4776b3b3121be1c3bad293a4fa7efffb592f7f7 Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Fri, 19 Nov 2010 10:57:30 +0000 Subject: [PATCH] 1.0.44.32: better error reporting for malformed RESTART-CASE clauses Detect missing lambda-lists. ...and missing -o to canonicalize-whitespace. --- src/code/defboot.lisp | 3 +++ tests/condition.pure.lisp | 12 ++++++++++++ version.lisp-expr | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/code/defboot.lisp b/src/code/defboot.lisp index e04a89d..a083276 100644 --- a/src/code/defboot.lisp +++ b/src/code/defboot.lisp @@ -526,6 +526,9 @@ evaluated as a PROGN." key-vars keywords) ,@forms)))))) (mapcar (lambda (clause) + (unless (listp (second clause)) + (error "Malformed ~S clause, no lambda-list:~% ~S" + 'restart-case clause)) (with-keyword-pairs ((report interactive test &rest forms) (cddr clause)) diff --git a/tests/condition.pure.lisp b/tests/condition.pure.lisp index 2ed2786..835818e 100644 --- a/tests/condition.pure.lisp +++ b/tests/condition.pure.lisp @@ -13,6 +13,8 @@ (cl:in-package :cl-user) +(load "test-util.lisp") + ;;; Until 0.7.7.21, (MAKE-CONDITION 'FILE-ERROR :PATHNAME "FOO") ;;; wasn't printable, because the REPORT function for FILE-ERROR ;;; referred to unbound slots. This was reported and fixed by Antonio @@ -151,3 +153,13 @@ :format-arguments nil) 'cerror (get-universal-time)) (assert (= x 1)))) + +(with-test (:name :malformed-restart-case-clause) + (assert (eq :ok + (handler-case + (macroexpand `(restart-case (error "foo") + (foo :report "quux" (quux)))) + (simple-error (e) + (assert (equal '(restart-case (foo :report "quux" (quux))) + (simple-condition-format-arguments e))) + :ok))))) diff --git a/version.lisp-expr b/version.lisp-expr index 5dc687a..1390444 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -20,4 +20,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"1.0.44.31" +"1.0.44.32" -- 1.7.10.4