Function: eieio--perform-slot-validation-for-default

eieio--perform-slot-validation-for-default is a byte-compiled function defined in eieio-core.el.gz.

Signature

(eieio--perform-slot-validation-for-default SLOT SKIPNIL)

Documentation

For SLOT, signal if its type does not match its default value.

If SKIPNIL is non-nil, then if default value is nil return t instead.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/eieio-core.el.gz
(defun eieio--perform-slot-validation-for-default (slot skipnil)
  "For SLOT, signal if its type does not match its default value.
If SKIPNIL is non-nil, then if default value is nil return t instead."
  (let ((value (cl--slot-descriptor-initform slot))
        (spec (cl--slot-descriptor-type slot)))
    (if (not (or (not (macroexp-const-p value))
                 eieio-skip-typecheck
                 (and skipnil (null value))
                 (eieio--perform-slot-validation spec (eval value t))))
        (signal 'invalid-slot-type (list (cl--slot-descriptor-name slot) spec value)))))