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/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • 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.