0.9.11.2:
authorChristophe Rhodes <csr21@cam.ac.uk>
Mon, 27 Mar 2006 08:19:36 +0000 (08:19 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Mon, 27 Mar 2006 08:19:36 +0000 (08:19 +0000)
Fix for MISC.629 (PFD ansi-tests)
... all paths lead to the type system.

NEWS
src/code/late-type.lisp
tests/type.impure.lisp
tests/type.pure.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index d421f3f..467a261 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ changes in sbcl-0.9.12 relative to sbcl-0.9.11:
   * 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
index 102c8b5..b2717e4 100644 (file)
          ;; 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))))
index be9e55b..d5edc2e 100644 (file)
                  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
index 55e2575..593e45e 100644 (file)
@@ -330,3 +330,6 @@ ACTUAL ~D DERIVED ~D~%"
   (sb-kernel:type=
    (sb-kernel:specifier-type '(simple-array an-unkown-type (7)))
    (sb-kernel:specifier-type '(simple-array an-unkown-type (8))))))
+
+(assert (typep #p"" 'sb-kernel:instance))
+(assert (subtypep '(member #p"") 'sb-kernel:instance))
index 92d7606..49019a0 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.9.11.1"
+"0.9.11.2"