Print type of value when reporting a TYPE-ERROR.
authorOlof-Joachim Frahm <olof@macrolet.net>
Thu, 25 Apr 2013 23:36:50 +0000 (01:36 +0200)
committerOlof-Joachim Frahm <olof@macrolet.net>
Wed, 23 Oct 2013 21:29:52 +0000 (23:29 +0200)
src/code/condition.lisp

index a1d40d5..29797bc 100644 (file)
    (expected-type :reader type-error-expected-type :initarg :expected-type))
   (:report
    (lambda (condition stream)
-     (format stream
-             "~@<The value ~2I~:_~S ~I~_is not of type ~2I~_~S.~:>"
-             (type-error-datum condition)
-             (type-error-expected-type condition)))))
+     (let ((datum (type-error-datum condition)))
+       (format stream
+               "~@<The value ~2I~:_~S ~I~_is not of type ~2I~_~S ~I~_but ~2I~_~S.~:>"
+               datum
+               (type-error-expected-type condition)
+               (type-of datum))))))
 
 (def!method print-object ((condition type-error) stream)
   (if (and *print-escape*