bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#46912: 28.0.50; Byte compiled defvar with lexical binding throws (vo


From: Vitalie Spinu
Subject: bug#46912: 28.0.50; Byte compiled defvar with lexical binding throws (void-variable foo)
Date: Thu, 4 Mar 2021 01:14:50 +0100

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]