- ;; FIXME: Since currently *TYPE-SYSTEM-INITIALIZED* is not set
- ;; until many toplevel forms have run, this condition on
- ;; PROCLAIM (FTYPE ..) (and on PROCLAIM (TYPE ..), above) means
- ;; that valid PROCLAIMs in cold code could get lost. Probably
- ;; the cleanest way to deal with this would be to initialize
- ;; the type system completely in special cold init forms,
- ;; before any ordinary toplevel forms run. Failing that, we
- ;; could queue up PROCLAIMs to be done after the type system is
- ;; initialized. Failing that, we could at least issue a warning
- ;; when we have to ignore a PROCLAIM because the type system is
- ;; uninitialized.
- (when *type-system-initialized*
- (let ((type (specifier-type (first args))))
- (unless (csubtypep type (specifier-type 'function))
- (error "not a function type: ~S" (first args)))
- (dolist (name (rest args))
- (cond ((info :function :accessor-for name)
- ;; FIXME: This used to be a WARNING, which was
- ;; clearly wrong, since it would cause warnings to
- ;; be issued for conforming code, which is really
- ;; annoying for people who use Lisp code to build
- ;; Lisp systems (and check the return values from
- ;; COMPILE and COMPILE-FILE). Changing it to a
- ;; compiler note is somewhat better, since it's
- ;; after all news about a limitation of the
- ;; compiler, not a problem in the code. But even
- ;; better would be to handle FTYPE proclamations
- ;; for slot accessors, and since in the long run
- ;; slot accessors should become more like other
- ;; functions, this should eventually become
- ;; straightforward.
- (maybe-compiler-note
- "~@<ignoring FTYPE proclamation for ~
- slot accessor (currently unsupported): ~2I~_~S~:>"
- name))
- (t
+ (if *type-system-initialized*
+ (let ((ctype (specifier-type (first args))))
+ (unless (csubtypep ctype (specifier-type 'function))
+ (error "not a function type: ~S" (first args)))
+ (dolist (name (rest args))
+ (when (eq (info :function :where-from name) :declared)
+ (let ((old-type (info :function :type name)))
+ (when (type/= ctype old-type)
+ (style-warn
+ "new FTYPE proclamation~@
+ ~S~@
+ for ~S does not match old FTYPE proclamation~@
+ ~S"
+ ctype name old-type))))