]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/comp.el (comp--get-function-cstr): Fix it.
authorAndrea Corallo <acorallo@gnu.org>
Mon, 13 May 2024 14:41:25 +0000 (16:41 +0200)
committerEshel Yaron <me@eshelyaron.com>
Thu, 16 May 2024 08:18:46 +0000 (10:18 +0200)
(cherry picked from commit 595799edd3188a8992bbd08d0b29feaf184a092e)

lisp/emacs-lisp/comp.el

index fa866b802ccc672e3c5ea60773338562e7f19f5d..0536b45d118ed02dc766f32c1652899707e8f45f 100644 (file)
@@ -197,12 +197,11 @@ Useful to hook into pass checkers.")
 (defun comp--get-function-cstr (function)
   "Given FUNCTION return the corresponding `comp-constraint'."
   (when (symbolp function)
-    (let ((f (symbol-function function)))
-      (or (gethash f comp-primitive-func-cstr-h)
-          (when-let ((type (or (when-let ((f (comp--symbol-func-to-fun function)))
-                                 (comp-func-declared-type f))
-                               (function-get function 'function-type))))
-            (comp-type-spec-to-cstr type))))))
+    (or (gethash function comp-primitive-func-cstr-h)
+        (when-let ((type (or (when-let ((f (comp--symbol-func-to-fun function)))
+                               (comp-func-declared-type f))
+                             (function-get function 'function-type))))
+          (comp-type-spec-to-cstr type)))))
 
 ;; Keep it in sync with the `cl-deftype-satisfies' property set in
 ;; cl-macs.el. We can't use `cl-deftype-satisfies' directly as the