Changeset 12163 for trunk/source/level-1


Ignore:
Timestamp:
May 30, 2009, 1:43:51 PM (10 years ago)
Author:
gz
Message:

Tweaks for type warnings from r12158/r12159/r12160: don't warn about unknown types from proclaim; minimize usually-gratuitous warnings from defstruct readers; consistently report unknown declaration idenitifers as bad declarations when they're not known types; check for invalid types in defstruct;

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/l1-utils.lisp

    r12131 r12163  
    540540    (function (apply #'proclaim-type spec))
    541541    (t (unless (memq (%car spec) *nx-known-declarations*)
    542          ;; Any type name is now (ANSI CL) a valid declaration.  Any symbol could become a type.
     542         ;; Any type name is now (ANSI CL) a valid declaration.
    543543         (if (specifier-type-if-known (%car spec))
    544544           (apply #'proclaim-type spec)
    545            (warn "Unknown declaration specifier(s) in ~S" spec))))))
     545           (signal-program-error "Unknown declaration specifier ~s in ~S" (%car spec) spec))))))
    546546
    547547(defun bad-proclaim-spec (spec)
     
    554554  (when *type-system-initialized*
    555555    ;; Check the type.  This will signal program-error's in case of invalid types, let it.
    556     (handler-case (specifier-type type)
    557       (parse-unknown-type (c)
    558         (warn "Undefined type ~s in declaration specifier ~s"
    559               (parse-unknown-type-specifier c) `(,type ,@vars)))))
     556    ;; Do not signal anything about unknown types though -- it should be ok to have forward
     557    ;; references here, before anybody needs the info.
     558    (specifier-type type))
    560559  (dolist (var vars)
    561560    (let ((spec (assq var *nx-proclaimed-types*)))
     
    571570    (setq *nx-proclaimed-ftypes* (make-hash-table :test #'eq)))
    572571  ;; Check the type.  This will signal program-error's in case of invalid types, let it.
    573   ;; TODO: should also check it for being a function type.
    574   (handler-case (specifier-type ftype)
    575     (parse-unknown-type (c)
    576       (warn "Undefined type ~s in declaration specifier ~s"
    577             (parse-unknown-type-specifier c) `(ftype ,ftype ,@names))))
     572  ;; Do not signal anything about unknown types though -- it should be ok to have forward
     573  ;; references here, before anybody needs the info.
     574  (specifier-type ftype)
    578575  (dolist (name names)
    579576    (setf (gethash (maybe-setf-function-name name) *nx-proclaimed-ftypes*) ftype)))
Note: See TracChangeset for help on using the changeset viewer.