From 4bbb7e0862ff8095e0813d17aecd34706d6e0c41 Mon Sep 17 00:00:00 2001 From: kilianmh Date: Mon, 14 Aug 2023 01:41:36 +0200 Subject: [PATCH] Fix: json-serializable-class redefinition Add reinitialize-instance :around method for class json-serializable-class. Now a json-serializable-class can be redefined and the class supertypes of its instances still includes json-serializable-class. Thanks @phoe for bug reporting --- src/json-mop.lisp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/json-mop.lisp b/src/json-mop.lisp index 2167b65..77c716c 100644 --- a/src/json-mop.lisp +++ b/src/json-mop.lisp @@ -57,4 +57,11 @@ (append direct-superclasses (list (find-class 'json-serializable))) rest)) +(defmethod reinitialize-instance :around ((class json-serializable-class) + &rest rest &key direct-superclasses) + (apply #'call-next-method + class + :direct-superclasses + (append direct-superclasses (list (find-class 'json-serializable))) + rest))