Commit f7cd2b87 authored by Marius Gerbershagen's avatar Marius Gerbershagen

defstruct: be less strict about struct redefinitions

Only disallow struct redefinition if we are certain about subtype
relationships in slots. Otherwise, we can wrongly disallow struct
redefinitions which don't change slot types.
parent 177ad215
Pipeline #52849551 passed with stage
......@@ -313,14 +313,18 @@
(or (equal old-def new-def)
(destructuring-bind (old-slot-name old-init old-type old-read-only old-offset old-ac)
(declare (ignore old-init read-only old-ac))
(declare (ignore old-init old-read-only old-ac))
(destructuring-bind (new-slot-name new-init new-type new-read-only new-offset new-ac)
(declare (ignore new-init new-read-only new-ac))
(and (eql old-slot-name new-slot-name)
(= old-offset new-offset)
(and (subtypep old-type new-type)
(subtypep new-type old-type)))))
(and (multiple-value-bind (subtypep certain)
(subtypep old-type new-type)
(or (not certain) subtypep))
(multiple-value-bind (subtypep certain)
(subtypep new-type old-type)
(or (not certain) subtypep))))))
(return-from %struct-layout-compatible-p nil)))))
(defun define-structure (name conc-name type named slots slot-descriptions
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment