* lisp/emacs-lisp/comp.el (comp--get-function-cstr): Fix it.

This commit is contained in:
Andrea Corallo 2024-05-13 16:41:25 +02:00
parent e86c4d8bdc
commit 595799edd3

View 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