From 5cb67471fd32544e4eff3f9e4e801162031f4229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= Date: Thu, 16 Dec 2021 17:41:23 +0100 Subject: [PATCH] clos: finalize-inheritance conformance fix According to "Reinitialization of Class Metaobjects" reinitialize-instance must call finalize-inheritance if the class was already finalized. --- src/clos/change.lsp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/clos/change.lsp b/src/clos/change.lsp index 565c4a490..bb3b58ea7 100644 --- a/src/clos/change.lsp +++ b/src/clos/change.lsp @@ -211,10 +211,12 @@ (dolist (l (setf (class-direct-superclasses class) direct-superclasses)) (add-direct-subclass l class))) - ;; if there are no forward references, we can just finalize the class here - (setf (class-finalized-p class) nil) - (finalize-unless-forward class) - + ;; Per "Reinitialization of Class Metaobjects" we must finalize the + ;; inheritance here. Note that this means that already finalized class can't + ;; be reinitialized to have a forward-referenced-class as a superclass. + (if (class-finalized-p class) + (finalize-inheritance class) + (finalize-unless-forward class)) class) (defun slot-definitions-compatible-p (old-slotds new-slotds)