Ensure reasonable lisp type for slot in compute-lisp-type-from-specified-type
authorKevin Rosenberg <kevin@rosenberg.net>
Sat, 6 Feb 2010 17:32:48 +0000 (10:32 -0700)
committerKevin Rosenberg <kevin@rosenberg.net>
Sat, 6 Feb 2010 17:32:48 +0000 (10:32 -0700)
ChangeLog
sql/metaclasses.lisp

index 29c63d0f3ccfbe5ef1d34f78e1de7bda0ef980f0..d227ac85fd90c775c9f6ccb67851de62ac737dcb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-02-06  Kevin Rosenberg <kevin@rosenberg.net>
+       * sql/metaclasses.lisp: If no declared slot type in
+       compute-lisp-type-from-specified-type, then use t as lisp type.
+       Issue noted when testing Clozure CL 1.4.
+
 2010-02-06  Kevin Rosenberg <kevin@rosenberg.net>
        * tests/test-init.lisp: Turn off the benign console notices for
        testing on postgres.
 2010-02-06  Kevin Rosenberg <kevin@rosenberg.net>
        * tests/test-init.lisp: Turn off the benign console notices for
        testing on postgres.
index 72cbc4fffd3c7df025f84aa311d0511a7e9628bb..530c674c55f6f7da589180bc618d731b0aa283bb 100644 (file)
@@ -425,7 +425,7 @@ implementations."
             specified-type))))
     (if (and type (not (member :not-null (listify db-constraints))))
         `(or null ,type)
             specified-type))))
     (if (and type (not (member :not-null (listify db-constraints))))
         `(or null ,type)
-      type)))
+        (or type t))))
 
 ;; Compute the slot definition for slots in a view-class.  Figures out
 ;; what kind of database value (if any) is stored there, generates and
 
 ;; Compute the slot definition for slots in a view-class.  Figures out
 ;; what kind of database value (if any) is stored there, generates and
@@ -453,8 +453,10 @@ implementations."
           (slot-definition-name obj)))
   (apply #'call-next-method obj
          'specified-type type
           (slot-definition-name obj)))
   (apply #'call-next-method obj
          'specified-type type
-         :type (compute-lisp-type-from-specified-type
-                type db-constraints)
+         :type (if (and (eql db-kind :virtual) (null type))
+                   t
+                   (compute-lisp-type-from-specified-type
+                    type db-constraints))
          initargs))
 
 (defmethod compute-effective-slot-definition ((class standard-db-class)
          initargs))
 
 (defmethod compute-effective-slot-definition ((class standard-db-class)