1.0.23.1: declaring the type of a bound variable gives :DECLARED as LEAF-WHERE-FROM
authorNikodemus Siivola <nikodemus@random-state.net>
Mon, 1 Dec 2008 15:25:36 +0000 (15:25 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Mon, 1 Dec 2008 15:25:36 +0000 (15:25 +0000)
 * Makes SB-CLTL2 do the right thing with local declarations. Reported
   by Larry D'Anna.

NEWS
contrib/sb-cltl2/tests.lisp
src/compiler/ir1tran.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 8d28198..598227b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,7 @@
 ;;;; -*- coding: utf-8; -*-
+  * bug fix: lexical type declarations are now correctly reported by
+    SB-CLTL2. (reported by Larry D'Anna)
+
 changes in sbcl-1.0.23 relative to 1.0.22:
   * enhancement: when disassembling method functions, disassembly
     for the associated fast function is also produced.
index 137b055..0788260 100644 (file)
       (var-info x))
   (:lexical t nil))
 
+(deftest variable-info.lexical.type
+    (let ((x 42))
+      (declare (fixnum x))
+      (var-info x))
+  (:lexical t ((type . fixnum))))
+
+(deftest variable-info.lexical.type.2
+    (let ((x 42))
+      (prog1
+          (var-info x)
+        (locally (declare (fixnum x))
+          (assert (plusp x)))))
+  (:lexical t nil))
+
+(deftest variable-info.lexical.type.2
+    (let ((x 42))
+      (locally (declare (fixnum x))
+        (var-info x)))
+  (:lexical t ((type . fixnum))))
+
 (deftest variable-info.ignore
     (let ((x 8))
       (declare (ignore x))
index d09ddce..e674c9d 100644 (file)
                                  (type-specifier old-type)
                                  (type-specifier type)
                                  var-name))))
-                            (bound-var (setf (leaf-type bound-var) int))
+                            (bound-var
+                             (setf (leaf-type bound-var) int
+                                   (leaf-where-from bound-var) :declared))
                             (t
                              (restr (cons var int)))))))
                (process-var var bound-var)
index 0e4870c..08cc696 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.23"
+"1.0.23.1"