fix bug #391.
The value "P" is not of type CHARACTER.
391:
- Typed slots with moderately difficult types, combined with
- subclassing, cause the computation of effective-slot-definitions to
- go awry.
- (defclass foo () ((x :type fixnum)))
- (defclass bar (foo) ((x :type (integer 1 5))))
- gives an error from SB-PCL::SPECIALIZER-APPLICABLE-USING-TYPE-P.
- This is probably because of an inappropriate use of *SUBTYPEP in
- COMPUTE-EFFECTIVE-SLOT-DEFINITION-INITARGS.
+ (fixed in sbcl-0.9.7.1)
;;;; -*- coding: utf-8; -*-
+changes in sbcl-0.9.8 relative to sbcl-0.9.7:
+ * fixed bug #391: complicated :TYPE intersections in slot
+ definitions no longer cause an error in PCL internals.
+
changes in sbcl-0.9.7 relative to sbcl-0.9.6:
* minor incompatible change: (SETF CLASS-NAME) and (SETF
GENERIC-FUNCTION-NAME) are no longer generic functions, and
allocp t))
(setq initargs (append (slot-definition-initargs slotd) initargs))
(let ((slotd-type (slot-definition-type slotd)))
- (setq type (cond ((eq type t) slotd-type)
- ((*subtypep type slotd-type) type)
- (t `(and ,type ,slotd-type)))))))
+ (setq type (cond
+ ((eq type t) slotd-type)
+ ;; This pairwise type intersection is perhaps a
+ ;; little inefficient and inelegant, but it's
+ ;; unlikely to lie on the critical path. Shout
+ ;; if I'm wrong. -- CSR, 2005-11-24
+ (t (type-specifier
+ (specifier-type `(and ,type ,slotd-type)))))))))
(list :name name
:initform initform
:initfunction initfunction
(with-test (:name (:ctor :unnamed-after/symbol))
(assert (raises-error? (ctor-unnamed-literal-class2/symbol))))
\f
+;;; classes with slot types shouldn't break if the types don't name
+;;; classes (bug #391)
+(defclass slot-type-superclass () ((slot :type fixnum)))
+(defclass slot-type-subclass (slot-type-superclass)
+ ((slot :type (integer 1 5))))
+(let ((instance (make-instance 'slot-type-subclass)))
+ (setf (slot-value instance 'slot) 3))
+\f
;;;; success
;;; 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.9.7"
+"0.9.7.1"