(values element-type
(when (eq *wild-type* element-type)
(apply #'type-union element-supertypes)))))
+ (member-type
+ ;; Convert member-type to an union-type.
+ (array-type-upgraded-element-type
+ (apply #'type-union (mapcar #'ctype-of (member-type-members type)))))
(t
;; KLUDGE: there is no good answer here, but at least
;; *wild-type* won't cause HAIRY-DATA-VECTOR-{REF,SET} to be
(flet ((subscript-bounds (subscript)
(let* ((type1 (lvar-type subscript))
(type2 (if (csubtypep type1 (specifier-type 'integer))
- (weaken-integer-type type1)
+ (weaken-integer-type type1 :range-only t)
(give-up)))
- (low (numeric-type-low type2))
+ (low (if (integer-type-p type2)
+ (numeric-type-low type2)
+ (give-up)))
(high (numeric-type-high type2)))
(cond
((and (or (not (bound-known-p low)) (minusp low))
`(deftransform ,name ((array index ,@extra))
(let* ((type (lvar-type array))
(element-type (array-type-upgraded-element-type type))
- (declared-type (array-type-declared-element-type type)))
+ (declared-type (type-specifier
+ (array-type-declared-element-type type))))
;; If an element type has been declared, we want to
;; use that information it for type checking (even
;; if the access can't be optimized due to the array