(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