0.7.10.10:
[sbcl.git] / src / compiler / typetran.lisp
index f41a060..a63f23a 100644 (file)
@@ -72,6 +72,8 @@
           nil)
          ((csubtypep otype type)
           t)
+          ((eq type *empty-type*)
+           nil)
          (t
           (give-up-ir1-transform)))))
 
 \f
 ;;;; coercion
 
-(deftransform coerce ((x type) (* *) *)
+(deftransform coerce ((x type) (* *) * :node node)
   (unless (constant-continuation-p type)
     (give-up-ir1-transform))
   (let ((tspec (ir1-transform-specifier-type (continuation-value type))))
             ;; FIXME: #!+long-float (t ,(error "LONG-FLOAT case needed"))
             ((csubtypep tspec (specifier-type 'float))
              '(%single-float x))
-            ;; FIXME: VECTOR types?
+            ((and (csubtypep tspec (specifier-type 'simple-vector))
+                  (policy node (< safety 3)))
+             `(if (simple-vector-p x)
+                  x
+                  (replace (make-array (length x)) x)))
+            ;; FIXME: other VECTOR types?
             (t
              (give-up-ir1-transform)))))))