(deftype string-and-number () '(cons string (cons number null)))
(defun bug1 (x) (declare (type string-and-number x)) (the number (car (reverse x)))) (bug1 (list "one" 1)) => Type error 1 is not of type number. Reported by Luke Gorrie on cmucl-imp. * src/compiler/knownfun.lisp (result-type-first-arg/reverse) (reversed-cons-type): New functions. * src/compiler/fndb.lisp (nreverse, reverse): Use result-type-first-arg/reverse.
Please register or sign in to comment