From 140751b3289f9eb5837b6ff153b0cb7372c83f64 Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Tue, 15 Aug 2006 10:24:10 +0000 Subject: [PATCH] 0.9.15.34: CONS type comparison * Secondary return value from :SIMPLE-= method for CONS was missing, causing TYPE= failures to appear ambiguous when they were not. --- NEWS | 2 ++ src/code/late-type.lisp | 7 +++++-- tests/type.pure.lisp | 9 +++++++++ version.lisp-expr | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index e6095af..6949264 100644 --- 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 diff --git a/src/code/late-type.lisp b/src/code/late-type.lisp index b2717e4..8a6e01f 100644 --- a/src/code/late-type.lisp +++ b/src/code/late-type.lisp @@ -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)) diff --git a/tests/type.pure.lisp b/tests/type.pure.lisp index 593e45e..f92c3b7 100644 --- a/tests/type.pure.lisp +++ b/tests/type.pure.lisp @@ -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)) diff --git a/version.lisp-expr b/version.lisp-expr index c43ad13..ff5a94d 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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" -- 1.7.10.4