Changeset 14308 for branches


Ignore:
Timestamp:
Sep 28, 2010, 6:49:35 PM (9 years ago)
Author:
rme
Message:

Merge r14305--r14307 from trunk. (Avoid spurious warnings about
unknown/forward-referenced types in DEFSTRUCT.)

See ITA bug 86893.

Location:
branches/qres/ccl
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/qres/ccl/compiler

  • branches/qres/ccl/compiler/nx1.lisp

    r13557 r14308  
    1818(in-package "CCL")
    1919
    20 (defun nx1-typespec-for-typep (typespec env)
     20(defun nx1-typespec-for-typep (typespec env &key (whine t))
    2121  ;; Allow VALUES types here (or user-defined types that
    2222  ;; expand to VALUES types).  We could do a better job
     
    5252    (let* ((ctype (handler-case (values-specifier-type (nx-target-type typespec) env)
    5353                    (parse-unknown-type (c)
    54                       (nx1-whine :unknown-type-in-declaration (parse-unknown-type-specifier c))
     54                      (when whine
     55                        (nx1-whine :unknown-type-in-declaration (parse-unknown-type-specifier c)))
    5556                      *wild-type*)
    5657                    (program-error (c)
    57                       (nx1-whine :invalid-type typespec c)
     58                      (when whine
     59                        (nx1-whine :invalid-type typespec c))
    5860                      *wild-type*)))
    5961           (new (ctype-spec ctype)))
  • branches/qres/ccl/lib

  • branches/qres/ccl/lib/defstruct.lisp

    r14259 r14308  
    207207                     (t `(uvref ,arg ,offset)))))
    208208    `((defun ,name (,arg)
    209         ,(if (eq type 't) form `(the ,type ,form)))
     209        ,(cond ((eq type t) form)
     210               ((nx-declarations-typecheck env)
     211                ;; TYPE may be unknown.  For example, it may be
     212                ;; forward-referenced.  Insert a run-time check in
     213                ;; this case.
     214                `(require-type ,form ',type))
     215               (t `(the ,type ,form))))
    210216      ,@(unless (ssd-r/o slot)
    211217          `((defun (setf ,name) (,value ,arg)
    212               ,(if (eq type 't)
    213                  `(setf ,form ,value)
    214                  `(the ,type (setf ,form (typecheck ,value ,type))))))))))
     218              ,(cond
     219                ((eq type t) `(setf ,form ,value))
     220                ((nx-declarations-typecheck env)
     221                 ;; Checking the type of SETF's return value seems
     222                 ;; kind of pointless here.
     223                 `(require-type (setf ,form (typecheck ,value ,type)) ',type))
     224                (t
     225                 `(the ,type (setf ,form (typecheck ,value ,type)))))))))))
    215226
    216227(defun defstruct-reftype (type)
  • branches/qres/ccl/lib/macros.lisp

    r14259 r14308  
    28242824         `(the ,typespec ,object))
    28252825        (t
    2826          `(require-type ,object ',(nx1-typespec-for-typep typespec env)))))
    2827 
     2826         `(require-type ,object ',(nx1-typespec-for-typep typespec env
     2827                                                          :whine nil)))))
    28282828
    28292829(defmacro with-hash-table-iterator ((mname hash-table) &body body)
Note: See TracChangeset for help on using the changeset viewer.