Don't call UPGRADED-ARRAY-ELEMENT-TYPE on types without checking that
they don't contain unknown types (i.e., intersections or unions
containing unknown-type), since U-A-E-T now signals errors for these.
Reported by Bart Botta.
"%COMPARE-AND-SWAP-SYMBOL-VALUE"
"%CONCATENATE-TO-BASE-STRING"
"%CONCATENATE-TO-STRING"
"%COMPARE-AND-SWAP-SYMBOL-VALUE"
"%CONCATENATE-TO-BASE-STRING"
"%CONCATENATE-TO-STRING"
+ "CONTAINS-UNKNOWN-TYPE-P"
"%COS" "%COS-QUICK"
"%COSH" "%DATA-VECTOR-AND-INDEX" "%DEPOSIT-FIELD"
"%DOUBLE-FLOAT" "%DPB" "%EQL"
"%COS" "%COS-QUICK"
"%COSH" "%DATA-VECTOR-AND-INDEX" "%DEPOSIT-FIELD"
"%DOUBLE-FLOAT" "%DPB" "%EQL"
(funcall method type2 type1)
(hierarchical-intersection2 type1 type2))))
(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}).
;;; This is used by !DEFINE-SUPERCLASSES to define the SUBTYPE-ARG1
;;; method. INFO is a list of conses
;;; (SUPERCLASS-CLASS . {GUARD-TYPE-SPECIFIER | NIL}).
(let ((ctype (careful-specifier-type
(lvar-value element-type))))
(cond
(let ((ctype (careful-specifier-type
(lvar-value element-type))))
(cond
- ((or (null ctype) (unknown-type-p ctype)) '*)
+ ((or (null ctype) (contains-unknown-type-p ctype)) '*)
(t (sb!xc:upgraded-array-element-type
(lvar-value element-type))))))
(t
(t (sb!xc:upgraded-array-element-type
(lvar-value element-type))))))
(t
(element-type-ctype (and (constant-lvar-p element-type)
(ir1-transform-specifier-type
(lvar-value element-type)))))
(element-type-ctype (and (constant-lvar-p element-type)
(ir1-transform-specifier-type
(lvar-value element-type)))))
- (when (unknown-type-p element-type-ctype)
+ (when (contains-unknown-type-p element-type-ctype)
(give-up-ir1-transform))
(unless (every #'integerp dims)
(give-up-ir1-transform
(give-up-ir1-transform))
(unless (every #'integerp dims)
(give-up-ir1-transform
(double-float 'double-float)
#!+long-float (long-float 'long-float)))
(double-float 'double-float)
#!+long-float (long-float 'long-float)))
-(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 function is called when the type code wants to find out how
;;; an array will actually be implemented. We set the
;;; SPECIALIZED-ELEMENT-TYPE to correspond to the actual
;;; This function is called when the type code wants to find out how
;;; an array will actually be implemented. We set the
;;; SPECIALIZED-ELEMENT-TYPE to correspond to the actual
(with-test (:name :upgraded-array-element-type-undefined-type)
(raises-error? (upgraded-array-element-type 'an-undefined-type))
(with-test (:name :upgraded-array-element-type-undefined-type)
(raises-error? (upgraded-array-element-type 'an-undefined-type))
- (raises-error? (upgraded-array-element-type '(and fixnum an-undefined-type))))
+ (raises-error? (upgraded-array-element-type '(and fixnum an-undefined-type)))
+ (compile nil '(lambda ()
+ (make-array 10
+ :element-type '(or null an-undefined-type))))
+ (compile nil '(lambda ()
+ (make-array '(10 10)
+ :element-type '(or null an-undefined-type)))))