slot-definitions-compatible-p: check for the slot class too
The spec says:
The generic function make-instances-obsolete is invoked
automatically by the system when defclass has been used to
redefine an existing standard class and the set of local slots
accessible in an instance is changed or the order of slots in
storage is changed. It can also be explicitly invoked by the user.
If the local slot's class is changed then indeed the set has
changed. We also check whether the slot class is S-D-S-D or S-E-S-D
and in both cases we also decide that layouts are not compatible.
Fixes #586.
This commit is contained in:
parent
ecb71b194a
commit
4da8ca54b6
1 changed files with 9 additions and 2 deletions
|
|
@ -226,13 +226,20 @@
|
|||
for n = (pop new-slotds)
|
||||
while (and o n)
|
||||
do (let ((old-alloc (slot-definition-allocation o))
|
||||
(new-alloc (slot-definition-allocation n)))
|
||||
(new-alloc (slot-definition-allocation n))
|
||||
(old-class (class-of o))
|
||||
(new-class (class-of n)))
|
||||
(unless (and (eq old-alloc new-alloc)
|
||||
(eq (slot-definition-name o)
|
||||
(slot-definition-name n))
|
||||
(or (not (eq old-alloc :instance))
|
||||
(= (slot-definition-location o)
|
||||
(slot-definition-location n))))
|
||||
(slot-definition-location n)))
|
||||
(eq old-class new-class)
|
||||
(or (eq new-class
|
||||
(find-class 'standard-direct-slot-definition))
|
||||
(eq new-class
|
||||
(find-class 'standard-effective-slot-definition))))
|
||||
(return-from slot-definitions-compatible-p nil)))
|
||||
finally
|
||||
(return (and (null o)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue