From a4c3562138e342465826de31fb8c324ae8a4b594 Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Thu, 2 Dec 2004 19:43:31 +0000 Subject: [PATCH] 0.8.17.17: 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 | 2 ++ src/compiler/generic/vm-type.lisp | 33 ++++++++++++++++++--------------- version.lisp-expr | 2 +- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/NEWS b/NEWS index 467557e..bbe115d 100644 --- 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. + ** 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 diff --git a/src/compiler/generic/vm-type.lisp b/src/compiler/generic/vm-type.lisp index 6c9658e..85c1b0b 100644 --- a/src/compiler/generic/vm-type.lisp +++ b/src/compiler/generic/vm-type.lisp @@ -145,21 +145,24 @@ "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. diff --git a/version.lisp-expr b/version.lisp-expr index b2dc2be..5312281 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".) -"0.8.17.16" +"0.8.17.17" -- 1.7.10.4