Changeset 14369


Ignore:
Timestamp:
Oct 18, 2010, 10:47:31 PM (9 years ago)
Author:
gz
Message:

Make :unknown-type-in-declaration only be used for unknown types, no longer use it
for invalid types. Change the wording of the warning accordingly. Make it be a style-warning.

Location:
trunk/source/compiler
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/compiler/nx-basic.lisp

    r14351 r14369  
    641641    (:undefined-function . "Undefined function ~S") ;; (deferred)
    642642    (:undefined-type . "Undefined type ~S")         ;; (deferred)
    643     (:unknown-type-in-declaration . "Unknown or invalid type ~S, declaration ignored")
     643    (:unknown-type-in-declaration . "Unknown type ~S, declaration ignored")
    644644    (:bad-declaration . "Unknown or invalid declaration ~S")
    645645    (:invalid-type . report-invalid-type-compiler-warning)
  • trunk/source/compiler/nx.lisp

    r14348 r14369  
    221221    (:environment-mismatch . invalid-arguments)
    222222    (:ftype-mismatch . invalid-arguments)
     223    (:unknown-type-in-declaration . style-warning)
    223224    (:ignore . style-warning)
    224225    (:result-ignored . style-warning)
  • trunk/source/compiler/nx0.lisp

    r14348 r14369  
    717717    (parse-unknown-type (c)
    718718      (when (and whine *compiler-warn-on-undefined-type-references*)
    719         (nx1-whine :undefined-type typespec))
     719        (nx1-whine (if (keywordp whine) whine :undefined-type) typespec))
    720720      (values nil (parse-unknown-type-specifier c)))
    721721    ;; catch any errors due to destructuring in type-expand
     
    864864(defnxdecl ftype (pending decl env &aux whined)
    865865  (destructuring-bind (type &rest fnames) (%cdr decl)
    866     (let ((ctype (specifier-type-if-known type env)))
    867       (if (null ctype)
    868         (nx1-whine :unknown-type-in-declaration type)
    869         (if (types-disjoint-p ctype (specifier-type 'function))
    870           (nx-bad-decls decl)
    871           (dolist (s fnames)
    872             (if (or (symbolp s) (setf-function-name-p s))
    873               (nx-new-fdecl pending s 'ftype type)
    874               (unless (shiftf whined t) (nx-bad-decls decl)))))))))
     866    (let ((ctype (specifier-type-if-known type env :whine :unknown-type-in-declaration)))
     867      (when ctype
     868        (if (types-disjoint-p ctype (specifier-type 'function))
     869          (nx-bad-decls decl)
     870          (dolist (s fnames)
     871            (if (or (symbolp s) (setf-function-name-p s))
     872              (nx-new-fdecl pending s 'ftype type)
     873              (unless (shiftf whined t) (nx-bad-decls decl)))))))))
    875874
    876875(defnxdecl settable (pending decl env)
     
    894893
    895894(defun nx-process-type-decl (pending decl type vars env &aux whined)
    896   (if (specifier-type-if-known type env)
     895  (when (specifier-type-if-known type env :whine :unknown-type-in-declaration)
    897896    (dolist (sym vars)
    898897      (if (symbolp sym)
    899898        (nx-new-vdecl pending sym 'type type)
    900         (unless (shiftf whined t) (nx-bad-decls decl))))
    901     (nx1-whine :unknown-type-in-declaration type)))
     899        (unless (shiftf whined t) (nx-bad-decls decl))))))
    902900
    903901(defnxdecl global-function-name (pending decl env)
Note: See TracChangeset for help on using the changeset viewer.