0.8.4.14:
authorChristophe Rhodes <csr21@cam.ac.uk>
Thu, 9 Oct 2003 15:47:16 +0000 (15:47 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Thu, 9 Oct 2003 15:47:16 +0000 (15:47 +0000)
Fix suboptimality reported by piso on #lisp
... catch bogus types like (fixnum 10) before they get too far
in the type system
... doesn't work for logically-built-in-but-made-by-PCL types
(yet)
Comment out newly-broken assertion that constant multiplies
don't produce compiler-notes
... if that's all that broke, count your lucky stars :-)

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

diff --git a/NEWS b/NEWS
index d57ed10..eea0087 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2119,6 +2119,9 @@ changes in sbcl-0.8.5 relative to sbcl-0.8.4:
     #lisp)
   * fixed bug 141b: printing backquoted information readably and prettily
     inserts a space where necessary.
+  * bug fix: obviously wrong type specifiers such as (FIXNUM 1) or
+    (CHARACTER 10) are now reported as errors, rather than propagated
+    as unknown types.  (reported by piso on #lisp)
   * compiler enhancement: SIGNUM is now better able to derive the type
     of its result.
   * fixed some bugs revealed by Paul Dietz' test suite:
index 6679a42..56aac8c 100644 (file)
                   (fun (info :type :translator (car lspec))))
              (cond (fun
                     (funcall fun lspec))
-                   ((or (and (consp spec) (symbolp (car spec)))
-                        (symbolp spec))
+                   ((or (and (consp spec) (symbolp (car spec))
+                             (not (info :type :builtin (car spec))))
+                        (and (symbolp spec) (not (info :type :builtin spec))))
                     (when (and *type-system-initialized*
                                 (not (eq (info :type :kind spec)
                                          :forthcoming-defclass-type)))
   (let ((def (cond ((symbolp form)
                     (info :type :expander form))
                    ((and (consp form) (symbolp (car form)))
-                    (info :type :expander (car form)))
+                   (info :type :expander (car form)))
                    (t nil))))
     (if def
         (type-expand (funcall def (if (consp form) form (list form))))
index 959e2c1..624abd3 100644 (file)
   (let* ((x (random most-positive-fixnum))
         (x2 (* x 2))
         (x3 (* x 3)))
-    (let ((fn (handler-bind ((sb-ext:compiler-note #'error))
+    (let ((fn (handler-bind (;; broken by rearrangement of
+                            ;; multiplication strength reduction in
+                            ;; sbcl-0.8.4.12
+                            #+nil
+                            (sb-ext:compiler-note #'error))
                (compile nil
                         `(lambda (y)
                            (declare (optimize speed) (type (integer 0 3) y))
index 38cee27..02ee7f7 100644 (file)
 (assert (raises-error? (typep 11 'eql)))
 (assert (raises-error? (typep 11 'satisfies)))
 (assert (raises-error? (typep 11 'not)))
+;;; and while it doesn't specifically disallow illegal compound
+;;; specifiers from the CL package, we don't have any.
+(assert (raises-error? (subtypep 'fixnum '(fixnum 1))))
+(assert (raises-error? (subtypep 'class '(list))))
+(assert (raises-error? (subtypep 'foo '(ratio 1/2 3/2))))
+(assert (raises-error? (subtypep 'character '(character 10))))
+#+nil ; doesn't yet work on PCL-derived internal types
+(assert (raises-error? (subtypep 'lisp '(class))))
+#+nil
+(assert (raises-error? (subtypep 'bar '(method number number))))
 
 ;;; Of course empty lists of subtypes are still OK.
 (assert (typep 11 '(and)))
index 9f02057..9885cbd 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.8.4.13"
+"0.8.4.14"