* fixed some bugs revealed by Paul Dietz' test suite:
** REMOVE-METHOD returns its generic function argument even when
the method is not one of the generic functions' methods.
+ ** objects declared as MEMBER types can be admissible arguments to
+ structure accessors.
changes in sbcl-0.9.11 relative to sbcl-0.9.10:
* new platform: experimental support for SBCL x86/Darwin, including
;; those types can be other types in disguise. So we'd
;; better delegate.
(invoke-complex-subtypep-arg1-method type1 type2))
+ ((and (or (eq type2 *instance-type*)
+ (eq type2 *funcallable-instance-type*))
+ (member-type-p type1))
+ ;; member types can be subtypep INSTANCE and
+ ;; FUNCALLABLE-INSTANCE in surprising ways.
+ (invoke-complex-subtypep-arg1-method type1 type2))
((and (eq type2 *instance-type*) (classoid-p type1))
(if (member type1 *non-instance-classoid-types* :key #'find-classoid)
(values nil t)
type1
nil)
*empty-type*)
- (if (type-might-contain-other-types-p type1)
+ (if (or (type-might-contain-other-types-p type1)
+ (member-type-p type1))
nil
*empty-type*)))
((eq type2 *funcallable-instance-type*)
nil))
(if (fun-type-p type1)
nil
- (if (type-might-contain-other-types-p type1)
+ (if (or (type-might-contain-other-types-p type1)
+ (member-type-p type1))
nil
*empty-type*))))
(t (hierarchical-intersection2 type1 type2))))
t)))
(assert (null (values (subtypep `(not ,t2) `(not ,t1))))))
\f
+(defstruct misc-629a)
+(defclass misc-629b () ())
+(defclass misc-629c () () (:metaclass sb-mop:funcallable-standard-class))
+
+(assert (typep (make-misc-629a) 'sb-kernel:instance))
+(assert-t-t (subtypep `(member ,(make-misc-629a)) 'sb-kernel:instance))
+(assert-nil-t (subtypep `(and (member ,(make-misc-629a)) sb-kernel:instance)
+ nil))
+(let ((misc-629a (make-misc-629a)))
+ (assert-t-t (subtypep `(member ,misc-629a)
+ `(and (member ,misc-629a) sb-kernel:instance)))
+ (assert-t-t (subtypep `(and (member ,misc-629a)
+ sb-kernel:funcallable-instance)
+ nil)))
+
+(assert (typep (make-instance 'misc-629b) 'sb-kernel:instance))
+(assert-t-t (subtypep `(member ,(make-instance 'misc-629b))
+ 'sb-kernel:instance))
+(assert-nil-t (subtypep `(and (member ,(make-instance 'misc-629b))
+ sb-kernel:instance)
+ nil))
+(let ((misc-629b (make-instance 'misc-629b)))
+ (assert-t-t (subtypep `(member ,misc-629b)
+ `(and (member ,misc-629b) sb-kernel:instance)))
+ (assert-t-t (subtypep `(and (member ,misc-629b)
+ sb-kernel:funcallable-instance)
+ nil)))
+
+(assert (typep (make-instance 'misc-629c) 'sb-kernel:funcallable-instance))
+(assert-t-t (subtypep `(member ,(make-instance 'misc-629c))
+ 'sb-kernel:funcallable-instance))
+(assert-nil-t (subtypep `(and (member ,(make-instance 'misc-629c))
+ sb-kernel:funcallable-instance)
+ nil))
+(let ((misc-629c (make-instance 'misc-629c)))
+ (assert-t-t (subtypep `(member ,misc-629c)
+ `(and (member ,misc-629c)
+ sb-kernel:funcallable-instance)))
+ (assert-t-t (subtypep `(and (member ,misc-629c)
+ sb-kernel:instance)
+ nil)))
+
;;; success