Comment 6 for bug 1395910

Revision history for this message
Douglas Katzman (dougk) wrote :

It seems to me that careful-specifier-type is really supposed to catch more than just 'simple-error'.
So while it's certainly nice to report the condition in slightly different words, perhaps the simplest change is this:

--- a/src/compiler/ir1util.lisp
+++ b/src/compiler/ir1util.lisp
@@ -2223,7 +2223,9 @@ is :ANY, the function name is not checked."
                 (values nil (list (format nil "~A" condition))))
               (simple-error (condition)
                 (values nil (list* (simple-condition-format-control condition)
- (simple-condition-format-arguments condition))))))
+ (simple-condition-format-arguments condition))))
+ (type-error (condition)
+ (values nil (list (write-to-string condition :escape nil))))))

But I don't like the return convention. It should be just (values nil condition) in either case.
And as far as I can tell, nothing uses the 2nd value. It can be returned from type derivers (some in 'knownfun' and in 'array-tran') but the only places that call a 'fun-info-derive-type' function ('srctran' and 'ir1opt') do not use the second value.
Probably we should do all these things: robustify the 'careful' function, alter its return convention, and make the message for user-visible APIs the one in your patch.