]> git.eshelyaron.com Git - emacs.git/commitdiff
* Allow for optional function name parameter in 'ftype' declaration
authorAndrea Corallo <acorallo@gnu.org>
Tue, 14 May 2024 07:58:42 +0000 (09:58 +0200)
committerEshel Yaron <me@eshelyaron.com>
Thu, 16 May 2024 08:21:17 +0000 (10:21 +0200)
* lisp/emacs-lisp/byte-run.el (defun-declarations-alist): Allow for
optional function name parameter in 'ftype' declaration.

(cherry picked from commit b87670b56460185bec902806daa52b05faa5d26d)

lisp/emacs-lisp/byte-run.el

index 04cb183699f78c254abb986103bc449b9e6da5eb..4b5ba474bc20a62373025d45666769858531584b 100644 (file)
@@ -223,7 +223,11 @@ So far, FUNCTION can only be a symbol, not a lambda expression."
               val)))))
 
 (defalias 'byte-run--set-function-type
-  #'(lambda (f _args val)
+  #'(lambda (f _args val &optional f2)
+      (when (and f2 (not (eq f2 f)))
+        (error
+         "`%s' does not match top level function `%s' inside function type \
+declaration" f2 f))
       (list 'function-put (list 'quote f)
             ''function-type (list 'quote val))))