0.9.0.12:
[sbcl.git] / src / pcl / boot.lisp
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