type= thinks all subtypes of complex are the same. this breaks down the optimizer for coerce.

This commit is contained in:
Juan Jose Garcia Ripoll 2008-10-26 20:21:34 +01:00
parent 8abfb0da7d
commit ec23122149

View file

@ -198,10 +198,6 @@
(base-char . (character x))
(character . (character x))
(function . (si::coerce-to-function x))
(complex .
(let ((y x))
(declare (:read-only y))
(complex (realpart y) (imagpart y))))
))
(defun expand-coerce (form value type env)
@ -237,6 +233,14 @@
when (eq type a-type)
do (return (subst value 'x template))))
;;
;; FIXME! COMPLEX cannot be in +coercion-table+ because
;; (type= '(complex) '(complex double-float)) == T
;;
((eq type 'COMPLEX)
`(let ((y ,value))
(declare (:read-only y))
(complex (realpart y) (imagpart y))))
;;
;; Complex types defined with DEFTYPE.
((and (atom type)
(get-sysprop type 'SI::DEFTYPE-DEFINITION)