summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2023-06-04 16:25:14 +0200
committerAndrea Corallo <akrl@sdf.org>2023-06-04 16:25:14 +0200
commitb5f171f98f46ac309e1678b7d1b5ea93f8b4a34d (patch)
tree02028b648430dbab62e8688bd31949ed506cea1b /lisp/emacs-lisp
parent3f9e0281ad2776e3973a3cceda4b16c9925f6673 (diff)
downloademacs-b5f171f98f46ac309e1678b7d1b5ea93f8b4a34d.tar.gz
emacs-b5f171f98f46ac309e1678b7d1b5ea93f8b4a34d.tar.bz2
emacs-b5f171f98f46ac309e1678b7d1b5ea93f8b4a34d.zip
* lisp/emacs-lisp/comp.el (comp-function-type-spec): Improve.
Diffstat (limited to 'lisp/emacs-lisp')
-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))))