0.8.21.44:
authorChristophe Rhodes <csr21@cam.ac.uk>
Fri, 15 Apr 2005 21:28:50 +0000 (21:28 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Fri, 15 Apr 2005 21:28:50 +0000 (21:28 +0000)
Fix bug reported by Cyrus Harmon sbcl-devel 2005-04-14
... remove AVER CLASS and AVER BUILT-IN-TYPE, because those
can be tickled by wrong but well-intentioned user code.

src/pcl/boot.lisp
tests/clos.impure.lisp
version.lisp-expr

index 638f6a9..b277f87 100644 (file)
@@ -616,12 +616,14 @@ bootstrapping.
           (ecase kind
             ((:primitive) `(type ,specializer ,parameter))
             ((:defined) 
-             ;; some BUILT-IN-CLASSes (e.g. REAL) are also :DEFINED
-             ;; types.  Nothing else should be.
              (let ((class (find-class specializer nil)))
-               (aver class)
-               (aver (typep class 'built-in-class)))
-             `(type ,specializer ,parameter))
+                ;; CLASS can be null here if the user has erroneously
+                ;; tried to use a defined type as a specializer; it
+                ;; can be a non-BUILT-IN-CLASS if the user defines a
+                ;; type and calls (SETF FIND-CLASS) in a consistent
+                ;; way.
+                (when (and class (typep class 'built-in-class))
+                  `(type ,specializer ,parameter))))
             ((:instance nil)
              (let ((class (find-class specializer nil)))
                (cond
index 731cfdf..b4393ca 100644 (file)
 (load "package-ctor-bug.lisp")
 (assert (= (package-ctor-bug:test) 3))
 
+(deftype defined-type () 'integer)
+(assert (raises-error?
+         (defmethod method-on-defined-type ((x defined-type)) x)))
+(deftype defined-type-and-class () 'integer)
+(setf (find-class 'defined-type-and-class) (find-class 'integer))
+(defmethod method-on-defined-type-and-class ((x defined-type-and-class))
+  (1+ x))
+(assert (= (method-on-defined-type-and-class 3) 4))
+
 ;;;; success
 (sb-ext:quit :unix-status 104)
index af26ab4..e081594 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.21.43"
+"0.8.21.44"