From: Nikodemus Siivola Date: Tue, 19 Oct 2010 13:54:08 +0000 (+0000) Subject: 1.0.43.73: oops, let's not derive &REST as list quite so hard... X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=14098373376d990b92a21df123da663b40af7196;p=sbcl.git 1.0.43.73: oops, let's not derive &REST as list quite so hard... Use PROPAGATE-FROM-SETS so assignments to the variable are taken into account too. --- diff --git a/src/compiler/ir1opt.lisp b/src/compiler/ir1opt.lisp index e07fe5d..3c5d7a3 100644 --- a/src/compiler/ir1opt.lisp +++ b/src/compiler/ir1opt.lisp @@ -1752,7 +1752,7 @@ (loop for var in (lambda-vars fun) do (let ((info (lambda-var-arg-info var))) (when (and info (eq :rest (arg-info-kind info))) - (propagate-to-refs var (specifier-type 'list))))) + (propagate-from-sets var (specifier-type 'list))))) ;; The normal case. (let* ((vars (lambda-vars fun)) (union (mapcar (lambda (arg var) diff --git a/tests/compiler.pure.lisp b/tests/compiler.pure.lisp index 7dd538f..90b460e 100644 --- a/tests/compiler.pure.lisp +++ b/tests/compiler.pure.lisp @@ -2694,6 +2694,17 @@ (assert (eq 'list type)) (assert derivedp))) +(with-test (:name :rest-list-type-derivation4) + (multiple-value-bind (type derivedp) + (funcall (funcall (compile nil `(lambda () + (lambda (&optional x &rest args) + (declare (type (or null integer) x)) + (when x (setf args x)) + (ctu:compiler-derived-type args))))) + 42) + (assert (equal '(or cons null integer) type)) + (assert derivedp))) + (with-test (:name :base-char-typep-elimination) (assert (eq (funcall (lambda (ch) (declare (type base-char ch) (optimize (speed 3) (safety 0))) diff --git a/version.lisp-expr b/version.lisp-expr index b1e5b2b..e8c8a54 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"1.0.43.72" +"1.0.43.73"