Fix make-array transforms.
[sbcl.git] / src / code / late-type.lisp
index 481a843..8190493 100644 (file)
         (funcall method type2 type1)
         (hierarchical-intersection2 type1 type2))))
 
+(defun contains-unknown-type-p (ctype)
+  (cond ((unknown-type-p ctype) t)
+        ((intersection-type-p ctype)
+         (some #'contains-unknown-type-p (intersection-type-types ctype)))
+        ((union-type-p ctype)
+         (some #'contains-unknown-type-p (union-type-types ctype)))))
+
 ;;; This is used by !DEFINE-SUPERCLASSES to define the SUBTYPE-ARG1
 ;;; method. INFO is a list of conses
 ;;;   (SUPERCLASS-CLASS . {GUARD-TYPE-SPECIFIER | NIL}).
          *empty-type*)
         ((not (values-type-p type))
          type)
-        (t (or (car (args-type-required type))
-               (car (args-type-optional type))
-               (args-type-rest type)
-               (specifier-type 'null)))))
+        ((car (args-type-required type)))
+        (t (type-union (specifier-type 'null)
+                       (or (car (args-type-optional type))
+                           (args-type-rest type)
+                           (specifier-type 'null))))))
 
 ;;; Return the minimum number of arguments that a function can be
 ;;; called with, and the maximum number or NIL. If not a function
@@ -3509,7 +3517,7 @@ used for a COMPLEX component.~:@>"
                                       (simd-pack-type-element-type type)))
            (not-simd-pack (make-negation-type :type (specifier-type 'simd-pack))))
        (if remaining
-           (type-union2 not-simd-pack (%make-simd-pack-type remaining))
+           (type-union not-simd-pack (%make-simd-pack-type remaining))
            not-simd-pack)))
 
   (!define-type-method (simd-pack :unparse) (type)