1.0.43.73: oops, let's not derive &REST as list quite so hard...
authorNikodemus Siivola <nikodemus@random-state.net>
Tue, 19 Oct 2010 13:54:08 +0000 (13:54 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Tue, 19 Oct 2010 13:54:08 +0000 (13:54 +0000)
  Use PROPAGATE-FROM-SETS so assignments to the variable
  are taken into account too.

src/compiler/ir1opt.lisp
tests/compiler.pure.lisp
version.lisp-expr

index e07fe5d..3c5d7a3 100644 (file)
         (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)
index 7dd538f..90b460e 100644 (file)
     (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)))
index b1e5b2b..e8c8a54 100644 (file)
@@ -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"