+ "Attila Lendvai" <attila.lendvai@...>:
> (defun foo (x)
> (declare (optimize speed)
> (type simple-string x))
> (elt x 0))
> (foo nil)
> => [apparently silly error message]
> [...] adding a (safety 3) turns it into a proper error:
I would call that a feature request, not a bug report. A type
declaration is a promise to the compiler. You lied in that
declaration, and you should not be surprised if Bad Things Happen as a
result, unless you crank up the safety.
That said, it would certainly be nice if the error message were more
informative, but I wouldn't expect developers to scramble to fix it.
(I don't speak for the SBCL developers, of course.)
Oh, I just noticed the phrase "even with (safety 2)" in the subject.
But note that the SBCL manual states that full type checks, meaning
type declarations will be checked at run time, happens whenever
(>= safety (max speed space compilation-speed)). And (optimize speed)
will clearly violate that.