Merge from origin/emacs-26

134edc1 Warn about wrong number of args for subrs (Bug#35767)
5f01af6 Use plain symbols for eieio type descriptors (Bug#29220)
4b24b01 Pacify GCC 9 -Wredundant-decls
This commit is contained in:
Glenn Morris 2019-06-01 12:04:42 -07:00
commit 7e911d007d
6 changed files with 48 additions and 19 deletions

View file

@ -1401,7 +1401,7 @@ when printing the error message."
(defun byte-compile-callargs-warn (form)
(let* ((def (or (byte-compile-fdefinition (car form) nil)
(byte-compile-fdefinition (car form) t)))
(sig (byte-compile--function-signature def))
(sig (byte-compile--function-signature (or def (car form))))
(ncall (length (cdr form))))
;; Check many or unevalled from subr-arity.
(if (and (cdr-safe sig)

View file

@ -117,9 +117,6 @@ Currently under control of this var:
(defsubst eieio--object-class-tag (obj)
(aref obj 0))
(defsubst eieio--object-class (obj)
(eieio--object-class-tag obj))
;;; Important macros used internally in eieio.
@ -132,6 +129,12 @@ Currently under control of this var:
(or (cl--find-class class) class)
class))
(defsubst eieio--object-class (obj)
(let ((tag (eieio--object-class-tag obj)))
(if eieio-backward-compatibility
(eieio--class-object tag)
tag)))
(defun class-p (x)
"Return non-nil if X is a valid class vector.
X can also be is a symbol."
@ -163,7 +166,7 @@ Return nil if that option doesn't exist."
(defun eieio-object-p (obj)
"Return non-nil if OBJ is an EIEIO object."
(and (recordp obj)
(eieio--class-p (eieio--object-class-tag obj))))
(eieio--class-p (eieio--object-class obj))))
(define-obsolete-function-alias 'object-p 'eieio-object-p "25.1")

View file

@ -710,6 +710,9 @@ calls `initialize-instance' on that object."
;; Call the initialize method on the new object with the slots
;; that were passed down to us.
(initialize-instance new-object slots)
(when eieio-backward-compatibility
;; Use symbol as type descriptor, for backwards compatibility.
(aset new-object 0 class))
;; Return the created object.
new-object))