Subject: 29.0.91; byte-compile-file + load-file => Invalid read syntax: "#"

From: Bruno Barbier <[email-masked]>
Date: Mon, 22 May 2023 08:35:37 +0200

Hi,

The code below works fine when evaluated, but emacs fails to load its
compiled version.

      (defmacro my-identity-macro ()
        (let ((fct (indirect-function 'identity)))
          `(lambda (x) (funcall ,fct x))))

      (defun my-identity-builder ()
        (my-identity-macro))

I can run it like this:

      (funcall (my-identity-builder) 2)
      => 2

But, if I compile it (byte-compile-file), emacs cannot load the
compiled version (load-file). It raises the error:

      Invalid read syntax: "#"

Emacs should fail to compile, or, it should load the compiled version.

I've attached the compiled version.

Bruno.