Skip to content
Snippets Groups Projects
Forked from cmucl / cmucl
Source project has a limited visibility.
  • gerd's avatar
    63c1a0fe
    (deftype string-and-number () '(cons string (cons number null))) · 63c1a0fe
    gerd authored
    	(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.
    63c1a0fe
    History
    (deftype string-and-number () '(cons string (cons number null)))
    gerd authored
    	(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.