X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fclos.impure.lisp;h=46749be367411614c4ea8e087896411f4042b33f;hb=992e6a70a0cae3f6d43bdbba18f77306fdf10662;hp=d04a4c0376e935726e4183d0fd8b13f74eeca197;hpb=f06adcc6e3ce995dd9612de86355eebcc63bd0c6;p=sbcl.git diff --git a/tests/clos.impure.lisp b/tests/clos.impure.lisp index d04a4c0..46749be 100644 --- a/tests/clos.impure.lisp +++ b/tests/clos.impure.lisp @@ -1280,5 +1280,16 @@ (slot-value test 'x)))) (assert (= 13 (slot-value test 'x)))) +;;; Using class instances as specializers, reported by Pascal Costanza, ref CLHS 7.6.2 +(defclass class-as-specializer-test () + ()) +(eval `(defmethod class-as-specializer-test1 ((x ,(find-class 'class-as-specializer-test))) + 'foo)) +(assert (eq 'foo (class-as-specializer-test1 (make-instance 'class-as-specializer-test)))) +(funcall (compile nil `(lambda () + (defmethod class-as-specializer-test2 ((x ,(find-class 'class-as-specializer-test))) + 'bar)))) +(assert (eq 'bar (class-as-specializer-test2 (make-instance 'class-as-specializer-test)))) + ;;;; success