0.9.15.34: CONS type comparison
authorNikodemus Siivola <nikodemus@random-state.net>
Tue, 15 Aug 2006 10:24:10 +0000 (10:24 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Tue, 15 Aug 2006 10:24:10 +0000 (10:24 +0000)
 * Secondary return value from :SIMPLE-= method for CONS was missing,
   causing TYPE= failures to appear ambiguous when they were not.

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

diff --git a/NEWS b/NEWS
index e6095af..6949264 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -45,6 +45,8 @@ changes in sbcl-0.9.16 relative to sbcl-0.9.15:
   * bug fix: inline expansions of known functions were subject to
     step-instrumentation in high debug policies, leading to problems
     with type-inference.
+  * bug fix: compiler failed to differentiate between different CONS
+    types in some cases.
 
 changes in sbcl-0.9.15 relative to sbcl-0.9.14:
   * added support for the ucs-2 external format.  (contributed by Ivan
index b2717e4..8a6e01f 100644 (file)
@@ -2970,8 +2970,11 @@ used for a COMPLEX component.~:@>"
 
 (!define-type-method (cons :simple-=) (type1 type2)
   (declare (type cons-type type1 type2))
-  (and (type= (cons-type-car-type type1) (cons-type-car-type type2))
-       (type= (cons-type-cdr-type type1) (cons-type-cdr-type type2))))
+  (multiple-value-bind (match win)
+      (type= (cons-type-car-type type1) (cons-type-car-type type2))
+    (if (and match win)
+        (type= (cons-type-cdr-type type1) (cons-type-cdr-type type2))
+        (values nil win))))
 
 (!define-type-method (cons :simple-subtypep) (type1 type2)
   (declare (type cons-type type1 type2))
index 593e45e..f92c3b7 100644 (file)
@@ -331,5 +331,14 @@ ACTUAL ~D DERIVED ~D~%"
    (sb-kernel:specifier-type '(simple-array an-unkown-type (7)))
    (sb-kernel:specifier-type '(simple-array an-unkown-type (8))))))
 
+(assert
+ (sb-kernel:type/= (sb-kernel:specifier-type 'cons) 
+                   (sb-kernel:specifier-type '(cons single-float single-float))))
+
+(multiple-value-bind (match win)
+    (sb-kernel:type= (sb-kernel:specifier-type '(cons integer)) 
+                     (sb-kernel:specifier-type '(cons)))
+  (assert (and (not match) win)))
+
 (assert (typep #p"" 'sb-kernel:instance))
 (assert (subtypep '(member #p"") 'sb-kernel:instance))
index c43ad13..ff5a94d 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.15.33"
+"0.9.15.34"