From: Nikodemus Siivola Date: Tue, 31 Aug 2010 14:29:15 +0000 (+0000) Subject: 1.0.42.9: fix defmethod declarations for aliases of builtin classes as specializers X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=71b57577217f8efce2077b8840cca6612c2777f8;p=sbcl.git 1.0.42.9: fix defmethod declarations for aliases of builtin classes as specializers * Fixes lp#618387. * When we have a :defined class that we want a type declaration for, don't use the name we used to look up the class, but the CLASS-NAME of the class. --- diff --git a/NEWS b/NEWS index ed85faa..e8dd9e7 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,8 @@ changes relative to sbcl-1.0.42 Josh Elsasser) * bug fix: build fixes for OpenBSD -current and 4.8 (lp#615489, thanks to Josh Elsasser) + * bug fix: using aliases for builtin classes as defmethod specializers + without adding DEFTYPEs for them works. (lp#618387) changes in sbcl-1.0.42 relative to sbcl-1.0.41 * build changes diff --git a/src/pcl/boot.lisp b/src/pcl/boot.lisp index b102a87..47020a2 100644 --- a/src/pcl/boot.lisp +++ b/src/pcl/boot.lisp @@ -914,7 +914,7 @@ bootstrapping. ;; the user defines a type and calls (SETF ;; FIND-CLASS) in a consistent way. (when (and class (typep class 'built-in-class)) - `(type ,specializer-nameoid ,parameter)))) + `(type ,(class-name class) ,parameter)))) ((:instance nil) (let ((class (specializer-nameoid-class))) (cond diff --git a/tests/clos.impure.lisp b/tests/clos.impure.lisp index 412948e..ec9dffc 100644 --- a/tests/clos.impure.lisp +++ b/tests/clos.impure.lisp @@ -1864,4 +1864,12 @@ (cacheing-initargs-redefinitions-check-fun :slot2) (let ((thing (cacheing-initargs-redefinitions-check-fun :slot))) (assert (not (slot-boundp thing 'slot))))) + +(with-test (:name :defmethod-specializer-builtin-class-alias) + (let ((alias (gensym))) + (setf (find-class alias) (find-class 'symbol)) + (eval `(defmethod lp-618387 ((s ,alias)) + (symbol-name s))) + (assert (equal "FOO" (funcall 'lp-618387 :foo))))) + ;;;; success diff --git a/version.lisp-expr b/version.lisp-expr index b9a66dd..f49a576 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.42.8" +"1.0.42.9"