1.0.42.9: fix defmethod declarations for aliases of builtin classes as specializers
authorNikodemus Siivola <nikodemus@random-state.net>
Tue, 31 Aug 2010 14:29:15 +0000 (14:29 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Tue, 31 Aug 2010 14:29:15 +0000 (14:29 +0000)
 * 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.

NEWS
src/pcl/boot.lisp
tests/clos.impure.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index ed85faa..e8dd9e7 100644 (file)
--- 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
index b102a87..47020a2 100644 (file)
@@ -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
index 412948e..ec9dffc 100644 (file)
   (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
index b9a66dd..f49a576 100644 (file)
@@ -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"