X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fctype.lisp;h=62aa72ebee8864eed8fc7ac4926c26bbc595d471;hb=69e6aef5e6fb3bd682c7a2cbf774034d2ea58ee8;hp=dbc19f4ee2719974a3b2122eba5014bc17e18e1f;hpb=930e3879538d196aeb8c08e9d1b223f641f533d6;p=sbcl.git diff --git a/src/compiler/ctype.lisp b/src/compiler/ctype.lisp index dbc19f4..62aa72e 100644 --- a/src/compiler/ctype.lisp +++ b/src/compiler/ctype.lisp @@ -892,33 +892,64 @@ (declare (type lvar tag)) (let ((ctype (lvar-type tag))) (when (csubtypep ctype (specifier-type '(or number character))) - (compiler-style-warn "~@" - (lvar-source tag) - (type-specifier (lvar-type tag)))))) + (let ((sources (lvar-all-sources tag))) + (if (singleton-p sources) + (compiler-style-warn + "~@" + (first sources) + (type-specifier (lvar-type tag))) + (compiler-style-warn + "~@" + (rest sources) (first sources) + (type-specifier (lvar-type tag)))))))) (defun %compile-time-type-error (values atype dtype context) (declare (ignore dtype)) (destructuring-bind (form . detail) context (if (and (consp atype) (eq (car atype) 'values)) - (error 'simple-type-error - :datum (car values) - :expected-type atype - :format-control - "~@" - :format-arguments (list values - detail form - atype)) - (error 'simple-type-error - :datum (car values) - :expected-type atype - :format-control "~@" + :format-arguments (list values + (rest detail) (first detail) + form + atype))) + (if (singleton-p detail) + (error 'simple-type-error + :datum (car values) + :expected-type atype + :format-control "~@" - :format-arguments (list detail form - (car values) - atype))))) + :format-arguments (list (car detail) form + (car values) + atype)) + (error 'simple-type-error + :datum (car values) + :expected-type atype + :format-control "~@" + :format-arguments (list (rest detail) (first detail) form + (car values) + atype)))))) (defoptimizer (%compile-time-type-error ir2-convert) ((objects atype dtype context) node block) @@ -932,15 +963,24 @@ (dtype (lvar-value dtype)) (detail (cdr (lvar-value context)))) (unless (eq atype nil) - (if (constantp detail) + (if (singleton-p detail) + (let ((detail (first detail))) + (if (constantp detail) + (warn 'type-warning + :format-control + "~@" + :format-arguments (list (eval detail) atype)) + (warn 'type-warning + :format-control + "~@" + :format-arguments (list detail dtype atype)))) (warn 'type-warning - :format-control - "~@" - :format-arguments (list (eval detail) atype)) - (warn 'type-warning - :format-control - "~@" - :format-arguments (list detail dtype atype)))))) + :format-control + "~@" + :format-arguments (list (rest detail) (first detail) dtype atype)))))) (ir2-convert-full-call node block)))