* lisp/emacs-lisp/comp.el (comp-function-type-spec): Improve.

This commit is contained in:
Andrea Corallo 2023-06-04 16:25:14 +02:00
parent 3f9e0281ad
commit b5f171f98f

View file

@ -4460,9 +4460,11 @@ inferred from the code itself by the native compiler; if it is
type-spec )
(when-let ((res (gethash function comp-known-func-cstr-h)))
(setf type-spec (comp-cstr-to-type-spec res)))
(unless type-spec
(setf kind 'inferred
type-spec (subr-type (symbol-function function))))
(let ((f (symbol-function function)))
(when (and (null type-spec)
(subr-native-elisp-p f))
(setf kind 'inferred
type-spec (subr-type f))))
(when type-spec
(cons type-spec kind))))