File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change 58
58
(or slot-names " no slots" ))))))))))
59
59
60
60
(defun elsa--eieio-assert-struct-for-obj (instance state )
61
- (let ((type (elsa-get-type instance)))
62
- ; ; This test instead of `elsa-class-type-p' is so that mixed can
63
- ; ; be used as a struct.
64
- (unless (elsa-type-assignable-p (elsa-make-type (class nil )) type)
65
- (elsa-state-add-message state
66
- (elsa-make-error instance
67
- " Type `%s' has no properties because it is not a class."
68
- :code " eieio-not-a-class"
69
- (elsa-type-describe type))))))
61
+ (when instance
62
+ (let ((type (elsa-get-type instance)))
63
+ ; ; This test instead of `elsa-class-type-p' is so that mixed can
64
+ ; ; be used as a struct.
65
+ (unless (elsa-type-assignable-p (elsa-make-type (class nil )) type)
66
+ (elsa-state-add-message state
67
+ (elsa-make-error instance
68
+ " Type `%s' has no properties because it is not a class."
69
+ :code " eieio-not-a-class"
70
+ (elsa-type-describe type)))))))
70
71
71
72
(defun elsa--analyse:oref (form scope state )
72
73
(let* ((instance (elsa-cadr form))
You can’t perform that action at this time.
0 commit comments