(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
(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)
;;; 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"