unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#46912: 28.0.50; Byte compiled defvar with lexical binding throws (void-variable foo)
@ 2021-03-04  0:14 Vitalie Spinu
  2021-03-04 18:03 ` Joseph Mingrone
  0 siblings, 1 reply; 13+ messages in thread
From: Vitalie Spinu @ 2021-03-04  0:14 UTC (permalink / raw)
  To: 46912

Hello,

Compiling the following file:

    ;;; -*- lexical-binding: t -*-

    (let ((foo t))
      (defvar tmp-bar (if foo 0 1 -1)))

gives:

    tmp.el:4:23: Warning: reference to free variable ‘foo’


When loading the .elc file the error

    Debugger entered--Lisp error: (void-variable foo)
      byte-code("\301\10\203\11\0\302\202\n\0\303!\207" [foo (lambda
(def-tmp-var) (defvar tmp-bar def-tmp-var)) 0 -1] 2)
      load(".../tmp.elc" nil nil t)


No problems with emacs-27 branch.


  Vitalie



In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.22.30, cairo version 1.15.10)
 of 2021-03-03 built on NB277
Repository revision: a350ae058caedcb7be7d332564817954e3624e60
Repository branch: HEAD
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description: Ubuntu 18.04.5 LTS





^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-03-05  9:56 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-04  0:14 bug#46912: 28.0.50; Byte compiled defvar with lexical binding throws (void-variable foo) Vitalie Spinu
2021-03-04 18:03 ` Joseph Mingrone
2021-03-04 20:09   ` Lars Ingebrigtsen
2021-03-04 20:17     ` Joseph Mingrone
2021-03-04 20:48       ` Lars Ingebrigtsen
2021-03-04 21:08         ` Pip Cet
2021-03-04 23:15           ` Joseph Mingrone
2021-03-05  2:52             ` Pip Cet
2021-03-05  3:22               ` Joseph Mingrone
2021-03-05  8:27                 ` Vitalie Spinu
2021-03-05  9:10           ` Mattias Engdegård
2021-03-05  9:56             ` Pip Cet
2021-03-04 20:21     ` Pip Cet

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).