0.7.9.19:
authorWilliam Harold Newman <william.newman@airmail.net>
Wed, 30 Oct 2002 16:30:31 +0000 (16:30 +0000)
committerWilliam Harold Newman <william.newman@airmail.net>
Wed, 30 Oct 2002 16:30:31 +0000 (16:30 +0000)
fixed new type inference bug as per CSR's hint on IRC

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

diff --git a/BUGS b/BUGS
index 1a3138c..937549c 100644 (file)
--- a/BUGS
+++ b/BUGS
@@ -1305,17 +1305,6 @@ WORKAROUND:
   arguments, but it could be tricky to check result types of PROG1, IF
   etc.
 
-221: 
-  Sometime between sbcl-0.7.8.51 and sbcl-0.7.9.5 the system lost the
-  ability to compile
-    (declaim (ftype (function (fixnum) (values package boolean)) f1))
-    (declaim (ftype (function (t) (values package boolean)) f2))
-    (defun ow (b x)
-      (funcall (if b #'f1 #'f2) x))
-  Now the compiler dies with
-    SUBTYPEP is illegal on this type: (VALUES PACKAGE (MEMBER T NIL))
-  apparently when attempting to infer the type of the IF expression.
-
 
 DEFUNCT CATEGORIES OF BUGS
   IR1-#:
index 70ccba2..f3f7f0d 100644 (file)
            (type-specifier
             (fun-type-returns type)))))
 
-;;; Since all function types are equivalent to FUNCTION, they are all
-;;; subtypes of each other.
 (!define-type-method (function :simple-subtypep) (type1 type2)
    (flet ((fun-type-simple-p (type)
             (not (or (fun-type-rest type)
                            (if (and val1 val2)
                                (values t t)
                                (values nil (or win1 win2))))))))
-       (3and (csubtypep (fun-type-returns type1)
-                        (fun-type-returns type2))
+       (3and (values-subtypep (fun-type-returns type1)
+                             (fun-type-returns type2))
              (cond ((fun-type-wild-args type2)
                     (values t t))
                    ((fun-type-wild-args type1)
index f128f15..c583b22 100644 (file)
@@ -564,9 +564,15 @@ BUG 48c, not yet fixed:
     (etypecase x
       (character (write-char x s))
       (integer (write-byte x s)))))
-
 (bug217-1 #\1 *standard-output*)
 
+
+;;; bug 221: tried and died on CSUBTYPEP (not VALUES-SUBTYPEP) of the
+;;; function return types when inferring the type of the IF expression
+(declaim (ftype (function (fixnum) (values package boolean)) bug221f1))
+(declaim (ftype (function (t) (values package boolean)) bug221f2))
+(defun bug221 (b x)
+  (funcall (if b #'bug221f1 #'bug221f2) x))
 \f
 ;;;; tests not in the problem domain, but of the consistency of the
 ;;;; compiler machinery itself
index 920a910..fcda6d6 100644 (file)
     (format t "~&~S~%" type)
     (assert (not (sb-kernel:unknown-type-p (sb-kernel:specifier-type type))))
     (assert (atom (sb-kernel:type-specifier (sb-kernel:specifier-type type))))))
+
+;;; a bug underlying the reported bug #221: The SB-KERNEL type code
+;;; signalled an error on this expression.
+(subtypep '(function (fixnum) (values package boolean))
+         '(function (t) (values package boolean)))
index 4c8916b..5d32582 100644 (file)
@@ -18,4 +18,4 @@
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
 
-"0.7.9.18"
+"0.7.9.19"