Function: eieio--validate-slot-value
eieio--validate-slot-value is a byte-compiled function defined in
eieio-core.el.gz.
Signature
(eieio--validate-slot-value CLASS SLOT-IDX VALUE SLOT)
Documentation
Make sure that for CLASS referencing SLOT-IDX, VALUE is valid.
Checks the :type specifier. SLOT is the slot that is being checked, and is only used when throwing an error.
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/eieio-core.el.gz
(defun eieio--validate-slot-value (class slot-idx value slot)
"Make sure that for CLASS referencing SLOT-IDX, VALUE is valid.
Checks the :type specifier.
SLOT is the slot that is being checked, and is only used when throwing
an error."
(if eieio-skip-typecheck
nil
;; Trim off object IDX junk added in for the object index.
(setq slot-idx (- slot-idx (eval-when-compile eieio--object-num-slots)))
(let* ((sd (aref (cl--class-slots class) ;??
slot-idx))
(st (cl--slot-descriptor-type sd)))
(cond
((not (eieio--perform-slot-validation st value))
(signal 'invalid-slot-type
(list (cl--class-name class) slot st value)))
((alist-get :read-only (cl--slot-descriptor-props sd))
(signal 'eieio-read-only (list (cl--class-name class) slot)))))))