summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/comp.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp/comp.el')
-rw-r--r--lisp/emacs-lisp/comp.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 696ed8d21f9..b65da148787 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -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))))