1.0.22.20: Make a stab at having DEFTYPE types replace structure types.
[sbcl.git] / src / compiler / compiler-deftype.lisp
index c4a92a5..f1453c0 100644 (file)
@@ -13,7 +13,7 @@
 
 (/show0 "compiler-deftype.lisp 14")
 
-(defun %compiler-deftype (name expander &optional doc)
+(defun %compiler-deftype (name lambda-list expander doc source-location)
   (with-single-package-locked-error
       (:symbol name "defining ~A as a type specifier"))
   (ecase (info :type :kind name)
@@ -22,7 +22,8 @@
        (error "illegal to redefine standard type: ~S" name)))
     (:instance
      (warn "The class ~S is being redefined to be a DEFTYPE." name)
-     (undefine-structure (layout-info (classoid-layout (find-classoid name))))
+     (undeclare-structure (find-classoid name) t)
+     ;; FIXME: shouldn't this happen only at eval-time?
      (setf (classoid-cell-classoid (find-classoid-cell name :create t)) nil)
      (setf (info :type :compiler-layout name) nil)
      (setf (info :type :kind name) :defined))
      )
     ((nil :forthcoming-defclass-type)
      (setf (info :type :kind name) :defined)))
-  (setf (info :type :expander name) expander)
+  (setf (info :type :expander name) expander
+        (info :type :lambda-list name) lambda-list)
+  (when source-location
+    (setf (info :type :source-location name) source-location))
   (when doc
     (setf (fdocumentation name 'type) doc))
   ;; ### Bootstrap hack -- we need to define types before %NOTE-TYPE-DEFINED