From 386781eeedff86ae01bb53fae7e253a03e2cb19c Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Sat, 12 Sep 2009 06:40:03 +0000 Subject: [PATCH] 1.0.31.6: better error reporting for bogus parameter specializer names https://bugs.launchpad.net/sbcl/+bug/414788 --- NEWS | 2 ++ src/pcl/boot.lisp | 12 +++++++++--- tests/clos.impure.lisp | 10 ++++++++++ version.lisp-expr | 2 +- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index b7294c6..b8a9c2b 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,8 @@ changes relative to sbcl-1.0.31 * bug fix: (SETF SLOT-VALUE) signalled a warning which should have been an optimization note instead. (reported by Martin Cracauer) * bug fix: WITH-SLOTS did not work with THE forms. (thanks to David Tolpin) + * improvement: better error signalling for bogus parameter specializer names + in DEFMETHOD forms (reported by Pluijzer) changes in sbcl-1.0.31 relative to sbcl-1.0.30: * improvement: stack allocation is should now be possible in all nested diff --git a/src/pcl/boot.lisp b/src/pcl/boot.lisp index 8deb6c8..11dfa03 100644 --- a/src/pcl/boot.lisp +++ b/src/pcl/boot.lisp @@ -760,9 +760,15 @@ bootstrapping. ((symbolp name) `(find-class ',name)) ((consp name) (ecase (car name) ((eql) `(intern-eql-specializer ,(cadr name))) - ((class-eq) `(class-eq-specializer (find-class ',(cadr name)))) - ((prototype) `(fixme)))) - (t (bug "Foo"))))) + ((class-eq) `(class-eq-specializer (find-class ',(cadr name)))))) + (t + ;; FIXME: Document CLASS-EQ specializers. + (error 'simple-reference-error + :format-control + "~@<~S is not a valid parameter specializer name.~@:>" + :format-arguments (list name) + :references (list '(:ansi-cl :macro defmethod) + '(:ansi-cl :glossary "parameter specializer name"))))))) `(list ,@(mapcar #'parse specializer-names)))) (unless (fboundp 'make-method-specializers-form) diff --git a/tests/clos.impure.lisp b/tests/clos.impure.lisp index 4b0f1db..2c1f50e 100644 --- a/tests/clos.impure.lisp +++ b/tests/clos.impure.lisp @@ -1743,5 +1743,15 @@ (assert (eq :defined-method (sb-int:info :function :where-from 'i-dont-want-to-be-clobbered-2)))) + +(with-test (:name :bogus-parameter-specializer-name-error) + (assert (eq :ok + (handler-case + (eval `(defmethod #:fii ((x "a string")) 'string)) + (sb-int:reference-condition (c) + (when (member '(:ansi-cl :macro defmethod) + (sb-int:reference-condition-references c) + :test #'equal) + :ok)))))) ;;;; success diff --git a/version.lisp-expr b/version.lisp-expr index 34e433e..901f8dc 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,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.31.5" +"1.0.31.6" -- 1.7.10.4