Changeset 14309


Ignore:
Timestamp:
Sep 28, 2010, 9:07:50 PM (9 years ago)
Author:
rme
Message:

A somewhat inelegant change to nx1-typespec-for-typep: when called
with :whine nil, not only do we not warn, but we don't replace an
unknown or invalid type with *. Instead, we return the original
typespec so that the caller will have it available.

Right now, the only thing that calls this with :whine nil is
the the macro TYPECHECK, which is used in the expansion of
defstruct.

(We can't just check for a return value of * and assume that
the type was unknown: the * could be because of a values
type specifier.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/compiler/nx1.lisp

    r14306 r14309  
    5252    (let* ((ctype (handler-case (values-specifier-type (nx-target-type typespec) env)
    5353                    (parse-unknown-type (c)
    54                       (when whine
    55                         (nx1-whine :unknown-type-in-declaration (parse-unknown-type-specifier c)))
    56                       *wild-type*)
     54                      (if whine
     55                        (progn
     56                          (nx1-whine :unknown-type-in-declaration
     57                                     (parse-unknown-type-specifier c))
     58                          *wild-type*)
     59                        (specifier-type typespec env)))
    5760                    (program-error (c)
    58                       (when whine
    59                         (nx1-whine :invalid-type typespec c))
    60                       *wild-type*)))
     61                      (if whine
     62                        (progn
     63                          (nx1-whine :invalid-type typespec c)
     64                          *wild-type*)
     65                        (specifier-type typespec)))))
    6166           (new (ctype-spec ctype)))
    6267      (nx-target-type (type-specifier (if new (specifier-type new) ctype))))))
Note: See TracChangeset for help on using the changeset viewer.