From 96eea51e453a0033d1c24f32aa81176bceea4ba2 Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Fri, 10 Mar 2006 17:40:27 +0000 Subject: [PATCH] 0.9.10.27: Fix a typep / classoid / finalize-inheritance bug that was exposed by removing the class-predicate (which meant that classes were finalized in a different order). ... always update subclasses when we update a parent class. No, I don't know why (either Gerd's code or this modification) ... test case --- src/pcl/std-class.lisp | 5 ++--- tests/clos.impure.lisp | 12 ++++++++++++ version.lisp-expr | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/pcl/std-class.lisp b/src/pcl/std-class.lisp index 83e16de..0af7d48 100644 --- a/src/pcl/std-class.lisp +++ b/src/pcl/std-class.lisp @@ -812,9 +812,8 @@ (update-gfs-of-class class) (update-initargs class (compute-default-initargs class)) (update-ctors 'finalize-inheritance :class class)) - (unless finalizep - (dolist (sub (class-direct-subclasses class)) - (update-class sub nil))))) + (dolist (sub (class-direct-subclasses class)) + (update-class sub nil)))) (define-condition cpl-protocol-violation (reference-condition error) ((class :initarg :class :reader cpl-protocol-violation-class) diff --git a/tests/clos.impure.lisp b/tests/clos.impure.lisp index 19c9102..5bdccb2 100644 --- a/tests/clos.impure.lisp +++ b/tests/clos.impure.lisp @@ -1244,4 +1244,16 @@ (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 diff --git a/version.lisp-expr b/version.lisp-expr index acc015b..513fb86 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".) -"0.9.10.26" +"0.9.10.27" -- 1.7.10.4