Opened 16 years ago
Closed 16 years ago
#26 closed defect (fixed)
slot-value type check
Reported by: | Raymond Toy | Owned by: | Raymond Toy |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | PCL | Version: | 2008-11 |
Keywords: | pcl | Cc: |
Description
From cmucl-help, 2008-11-26
(defclass foo () ((a :type fixnum))) (defvar *object* (make-instance 'foo))
This works, even though the assigned value is not a fixnum:
(setf (slot-value *object* 'a) 3.5) ;; this works like a charm
but with
(defmethod setslot ((foo foo) val) (setf (slot-value foo 'a) val))
We have
(setslot *object* 3.5) ;; triggers a type error
Change History (2)
comment:1 Changed 16 years ago by
Component: | Core → PCL |
---|---|
Owner: | changed from somebody to Raymond Toy |
Summary: | slto-value type check → slot-value type check |
comment:2 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
This is now fixed in the 2008-12 snapshot. (setf slot-value) should now signal an error if the new value is not of the correct type. Note that not all cases are handled now, but the common case from the repl works.
pcl::*use-slot-types-p*
is also honored in that if it isNIL
, the checking is disabled.