Skip to content
Snippets Groups Projects
Commit ec3d0fde authored by ram's avatar ram
Browse files

Changed DO-TYPE-WARNING to ignore uses whose type is NIL, and also

tweaked output format a bit.
parent 9fdaa7ca
No related branches found
No related tags found
No related merge requests found
...@@ -400,8 +400,8 @@ ...@@ -400,8 +400,8 @@
;;; ;;;
;;; Emit a type warning for Node. If the value of node is being used for a ;;; Emit a type warning for Node. If the value of node is being used for a
;;; variable binding, we figure out which one for source context. If the value ;;; variable binding, we figure out which one for source context. If the value
;;; is a constant, we print it specially. We also print forms known to be of ;;; is a constant, we print it specially. We ignore nodes whose type is NIL,
;;; type NIL specially. ;;; since they are supposed to never return.
;;; ;;;
(defun do-type-warning (node) (defun do-type-warning (node)
(declare (type node node)) (declare (type node node))
...@@ -418,19 +418,14 @@ ...@@ -418,19 +418,14 @@
(and (continuation-use cont) (and (continuation-use cont)
(eq (functional-kind lambda) :let)) (eq (functional-kind lambda) :let))
(leaf-name (elt (lambda-vars lambda) pos))))))) (leaf-name (elt (lambda-vars lambda) pos)))))))
(cond ((and (ref-p node) (constant-p (ref-leaf node))) (cond ((eq dtype *empty-type*))
(compiler-warning "~:[This~;~:*~A~] is not a ~S:~% ~S" ((and (ref-p node) (constant-p (ref-leaf node)))
(compiler-warning "~:[This~;~:*~A~] is not a ~<~%~9T~:;~S:~>~% ~S"
what atype-spec (constant-value (ref-leaf node)))) what atype-spec (constant-value (ref-leaf node))))
((eq dtype *empty-type*) (t
(if what (compiler-warning
(compiler-warning "~A is an expression that does not return." "~:[Result~;~:*~A~] is a ~S, ~<~%~9T~:;not a ~S.~>"
what) what (type-specifier dtype) atype-spec))))
(compiler-warning "Expression that does not return when ~
expecting a value of type:~% ~S."
atype-spec)))
(t
(compiler-warning "~:[Result~;~:*~A~] is a ~S, ~<~%~:;not a ~S.~>"
what (type-specifier dtype) atype-spec))))
(undefined-value)) (undefined-value))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment