Subject: 25.1; Bytecode returns nil instead of expected closure
From: Michael Heerdegen <[email-masked]>
To: [email-masked]
Cc: Alex Vong <[email-masked]>
Date: Sun, 07 Aug 2016 01:16:50 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello,

eval this defun:

(defun test ()
  (let ((my-cool-fun 'dummy))
    (let ((my-cool-fun
           (let ((calculate (lambda () 1)))
             (lambda () (setq my-cool-fun calculate))))
          (return-my-cool-fun (lambda () my-cool-fun)))
      (funcall my-cool-fun)
      (funcall return-my-cool-fun))))

(test) evals to a closure as expected.

Compile the defun and load it.  Then,

  (test) -> nil

which is wrong.

Found in

   https://lists.gnu.org/archive/html/help-gnu-emacs/2016-08/msg00038.html

Thanks,

Michael.

In GNU Emacs 25.1.1 (x86_64-pc-linux-gnu, GTK+ Version 3.20.6)
 of 2016-08-04 built on drachen
Repository revision: 72221f51439d666d54f5d147f00ecdbb3778ab1b
Windowing system distributor 'The X.Org Foundation', version 11.0.11804000
System Description:	Debian GNU/Linux testing (stretch)

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GSETTINGS NOTIFY
LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11