- (let (;; the Common Lisp type specifier corresponding to CTYPE
- (type (type-specifier ctype)))
- (check-type type (or symbol cons))
- (cross-typep obj type)))
+ ;; There is at least one possible endless recursion in the
+ ;; cross-compiler type system: (SUBTYPEP NULL (OR UNKOWN0 UNKNOWN1)
+ ;; runs out of stack. The right way would probably be to not
+ ;; implement CTYPEP in terms of TYPE-SPECIFIER (:UNPARSE, that may
+ ;; call TYPE=, that in turn may call CTYPEP). Until then, pick a few
+ ;; cherries off.
+ (cond ((member-type-p ctype)
+ (if (member-type-member-p obj ctype)
+ (values t t)
+ (values nil t)))
+ ((union-type-p ctype)
+ (any/type #'ctypep obj (union-type-types ctype)))
+ (t
+ (let ( ;; the Common Lisp type specifier corresponding to CTYPE
+ (type (type-specifier ctype)))
+ (check-type type (or symbol cons))
+ (cross-typep obj type)))))