Return a more robust warning when we try to define a type with a
authorRupert Swarbrick <rswarbrick@gmail.com>
Sat, 5 Jun 2010 14:36:38 +0000 (15:36 +0100)
committerRupert Swarbrick <rswarbrick@gmail.com>
Sat, 5 Jun 2010 14:36:38 +0000 (15:36 +0100)
broken supertype. (Before, it seriously broke the type system if this
happened)

glib/gobject.lisp

index bfde9d1..68ee82c 100644 (file)
   (let ((supers (cons (supertype type) (implements type)))
        (class  (type-from-number type))
        (slots (getf options :slots)))
+    (when (member nil supers)
+      (error "Got NIL as a supertype for ~A (full list: ~A).~%~
+              This shouldn't happen - is the parent type correctly registered?"
+             (find-foreign-type-name type) supers))
     `(defclass ,class ,supers
         ,(unless forward-p
            (slot-definitions class (query-object-class-properties type) slots))