(in-package "SB!IMPL")
-(file-comment "$Header$")
+(/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)
(:primitive
(when *type-system-initialized*
(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 (class-layout (sb!xc:find-class name))))
- (setf (class-cell-class (find-class-cell name)) nil)
+ (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))
(:defined
;; since mistakenly redefining a type isn't a common error
;; anyway, we just don't worry about trying to warn about it.
)
- ((nil)
+ ((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)
+ (sb!c:with-source-location (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
- ;; is defined. (FIXME: Do we still need to do this? -- WHN 19990310)
- (if (fboundp 'sb!c::%note-type-defined)
- (sb!c::%note-type-defined name)
- (warn "defining type before %NOTE-TYPE-DEFINED is defined"))
+ (sb!c::%note-type-defined name)
name)
+
+(/show0 "compiler-deftype.lisp end of file")