(if (not c)
;; It might be missing because it is a :class allocated slot.
;; Let's check that info out.
- (if (setq c (eieio--class-slot-name-index class slot))
+ (if (and (eieio--class-p class)
+ (setq c (eieio--class-slot-name-index class slot)))
;; Oref that slot.
(aref (eieio--class-class-allocation-values class) c)
;; The slot-missing method is a cool way of allowing an object author
(if (not c)
;; It might be missing because it is a :class allocated slot.
;; Let's check that info out.
- (if (setq c
- (eieio--class-slot-name-index cl slot))
+ (if (and (eieio--class-p cl)
+ (setq c
+ (eieio--class-slot-name-index cl slot)))
;; Oref that slot.
(aref (eieio--class-class-allocation-values cl)
c)
(if (not c)
;; It might be missing because it is a :class allocated slot.
;; Let's check that info out.
- (if (setq c
- (eieio--class-slot-name-index class slot))
+ (if (and (eieio--class-p class)
+ (setq c
+ (eieio--class-slot-name-index class slot)))
;; Oset that slot.
(progn
(eieio--validate-class-slot-value class c value slot)
(if (not c)
;; It might be missing because it is a :class allocated slot.
;; Let's check that info out.
- (if (setq c (eieio--class-slot-name-index class slot))
+ (if (and (eieio--class-p class)
+ (setq c (eieio--class-slot-name-index class slot)))
(progn
;; Oref that slot.
(eieio--validate-class-slot-value class c value slot)
(slot-value x 'c)))
(setf (slot-value x 'a) 1)
(should (eq (eieio-test--struct-a x) 1))
- (should-error (setf (slot-value x 'c) 3) :type 'eieio-read-only)))
+ (should-error (setf (slot-value x 'c) 3) :type 'eieio-read-only)
+ (with-no-warnings
+ (should-error (eieio-oref x 'd)) :type 'invalid-slot-name)))
(defclass foo-bug-66938 (eieio-instance-inheritor)
((x :initarg :x