]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/comp.el (comp-function-type-spec): Improve.
authorAndrea Corallo <akrl@sdf.org>
Sun, 4 Jun 2023 14:25:14 +0000 (16:25 +0200)
committerAndrea Corallo <akrl@sdf.org>
Sun, 4 Jun 2023 14:25:14 +0000 (16:25 +0200)
lisp/emacs-lisp/comp.el

index 696ed8d21f95e72be67063ea3b190adbea1876e1..b65da1487873ccfb3576ccac8734cdbd708780b3 100644 (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))))