mop.lisp: submarine::id redefinition is now possible
Thu Sep 20 11:05:35 PDT 2007 Ryszard Szopa <ryszard.szopa@gmail.com>
* mop.lisp: submarine::id redefinition is now possible
There was an obscure bug in compute-effective-slot-definition :around db-class: TYPE wasn't inherited when a slot was redefined (like redefining submarine::id to have type string).
Appropriate test-cases added.
diff -rN -u old-submarine/mop.lisp new-submarine/mop.lisp
--- old-submarine/mop.lisp 2014-07-23 23:28:03.000000000 -0700
+++ new-submarine/mop.lisp 2014-07-23 23:28:03.000000000 -0700
@@ -69,6 +69,7 @@
(setf (foreign-type-p slotd) (foreign-type-p (car direct-slot-definitions)))
(setf (not-null-p slotd) (not-null-p (car direct-slot-definitions)))
(setf (unique slotd) (unique (car direct-slot-definitions)))
+ (setf (slot-definition-type slotd) (slot-definition-type (car direct-slot-definitions)))
slotd))
(defmethod shared-initialize :after ((class db-class) slots &rest rest)
diff -rN -u old-submarine/submarine-tests.lisp new-submarine/submarine-tests.lisp
--- old-submarine/submarine-tests.lisp 2014-07-23 23:28:03.000000000 -0700
+++ new-submarine/submarine-tests.lisp 2014-07-23 23:28:03.000000000 -0700
@@ -63,6 +63,10 @@
(defdao-example bar ()
((foo :type foo :foreign t)))))
+(db-test (dao-definition-redefine-id :depends-on dao-definition)
+ (finishes (defdao-example new-word ()
+ ((submarine::id :type string :accessor get-id :initarg :id :unique t)))))
+
(db-test (dao-definition-with-foreign-key-wrong-order :depends-on dao-definition-with-foreign-key)
(finishes
(defdao-example bar ()