1.0.44.32: better error reporting for malformed RESTART-CASE clauses
authorNikodemus Siivola <nikodemus@random-state.net>
Fri, 19 Nov 2010 10:57:30 +0000 (10:57 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Fri, 19 Nov 2010 10:57:30 +0000 (10:57 +0000)
  Detect missing lambda-lists.

  ...and missing -o to canonicalize-whitespace.

src/code/defboot.lisp
tests/condition.pure.lisp
version.lisp-expr

index e04a89d..a083276 100644 (file)
@@ -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))
index 2ed2786..835818e 100644 (file)
@@ -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
                             :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)))))
index 5dc687a..1390444 100644 (file)
@@ -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"