0.8.17.17:
authorChristophe Rhodes <csr21@cam.ac.uk>
Thu, 2 Dec 2004 19:43:31 +0000 (19:43 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Thu, 2 Dec 2004 19:43:31 +0000 (19:43 +0000)
Fix (UPGRADED-COMPLEX-PART-TYPE NIL) to return NIL
... fortunately we don't actually have to implement the
(COMPLEX NIL) type, unlike with arrays; one cannot create
a COMPLEX independent of its elements.

NEWS
src/compiler/generic/vm-type.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 467557e..bbe115d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,8 @@ changes in sbcl-0.8.18 relative to sbcl-0.8.17:
        consequent uses no arguments correctly.
     ** the system has a partial understanding of the (COMPLEX RATIO)
        type specifier.
        consequent uses no arguments correctly.
     ** the system has a partial understanding of the (COMPLEX RATIO)
        type specifier.
+    ** UPGRADED-COMPLEX-PART-TYPE obeys the lattice upgrading rules
+       required.
 
 changes in sbcl-0.8.17 relative to sbcl-0.8.16:
   * new feature: a build-time option (controlled by the :SB-UNICODE
 
 changes in sbcl-0.8.17 relative to sbcl-0.8.16:
   * new feature: a build-time option (controlled by the :SB-UNICODE
index 6c9658e..85c1b0b 100644 (file)
   "Return the element type of the most specialized COMPLEX number type that
    can hold parts of type SPEC."
   (declare (ignore environment))
   "Return the element type of the most specialized COMPLEX number type that
    can hold parts of type SPEC."
   (declare (ignore environment))
-  (if (unknown-type-p (specifier-type spec))
-      (error "undefined type: ~S" spec)
-      (let ((ctype (specifier-type `(complex ,spec))))
-       (cond
-         ((eq ctype *empty-type*) '(eql 0))
-         ((csubtypep ctype (specifier-type '(complex single-float)))
-          'single-float)
-         ((csubtypep ctype (specifier-type '(complex double-float)))
-          'double-float)
-         #!+long-float
-         ((csubtypep ctype (specifier-type '(complex long-float)))
-          'long-float)
-         ((csubtypep ctype (specifier-type '(complex rational)))
-          'rational)
-         (t 'real)))))
+  (let ((type (specifier-type spec)))
+    (cond
+      ((eq type *empty-type*) nil)
+      ((unknown-type-p type) (error "undefined type: ~S" spec))
+      (t
+       (let ((ctype (specifier-type `(complex ,spec))))
+         (cond
+           ((eq ctype *empty-type*) '(eql 0))
+           ((csubtypep ctype (specifier-type '(complex single-float)))
+            'single-float)
+           ((csubtypep ctype (specifier-type '(complex double-float)))
+            'double-float)
+           #!+long-float
+           ((csubtypep ctype (specifier-type '(complex long-float)))
+            'long-float)
+           ((csubtypep ctype (specifier-type '(complex rational)))
+            'rational)
+           (t 'real)))))))
 
 ;;; Return the most specific integer type that can be quickly checked that
 ;;; includes the given type.
 
 ;;; Return the most specific integer type that can be quickly checked that
 ;;; includes the given type.
index b2dc2be..5312281 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".)
 ;;; 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".)
-"0.8.17.16"
+"0.8.17.17"