X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fclos.impure.lisp;h=5bdccb2ba7262d607ebb451b6b31ccf67ac36ce9;hb=96eea51e453a0033d1c24f32aa81176bceea4ba2;hp=100407d0beacafc4fdb4466ac2274a15077d0e00;hpb=92d16270c6fc672683479f1f4dfe4eb1ca2711b2;p=sbcl.git diff --git a/tests/clos.impure.lisp b/tests/clos.impure.lisp index 100407d..5bdccb2 100644 --- a/tests/clos.impure.lisp +++ b/tests/clos.impure.lisp @@ -1231,4 +1231,29 @@ (let ((instance (make-instance 'slot-type-subclass))) (setf (slot-value instance 'slot) 3)) +;;; ctors where there's a non-standard SHARED-INITIALIZE method and an +;;; initarg which isn't self-evaluating (kpreid on #lisp 2006-01-29) +(defclass kpreid-enode () + ((slot :initarg not-a-keyword))) +(defmethod shared-initialize ((o kpreid-enode) slots &key &allow-other-keys) + (call-next-method)) +(defun make-kpreid-enode () + (make-instance 'kpreid-enode 'not-a-keyword 3)) +(with-test (:name (:ctor :non-keyword-initarg)) + (let ((x (make-kpreid-enode)) + (y (make-kpreid-enode))) + (= (slot-value x 'slot) (slot-value y 'slot)))) + +;;; defining a class hierarchy shouldn't lead to spurious classoid +;;; errors on TYPEP questions (reported by Tim Moore on #lisp +;;; 2006-03-10) +(defclass backwards-2 (backwards-1) (a b)) +(defclass backwards-3 (backwards-2) ()) +(defun typep-backwards-3 (x) + (typep x 'backwards-3)) +(defclass backwards-1 () (a b)) +(assert (not (typep-backwards-3 1))) +(assert (not (typep-backwards-3 (make-instance 'backwards-2)))) +(assert (typep-backwards-3 (make-instance 'backwards-3))) + ;;;; success