From: Konstantin Kharlamov <Hi-Angel@yandex.ru>
To: 69108@debbugs.gnu.org
Subject: bug#69108: false-positive warning "variable ‘_’ not left unused" in if-let* and if-let
Date: Wed, 14 Feb 2024 00:21:01 +0300 [thread overview]
Message-ID: <e25b8ef47525ad702e7860e18ee16fc598430813.camel@yandex.ru> (raw)
I've been writing an answer for a question on emacs.stackexchange¹ and to avoid
nested `if` and `let` clauses I used a `if-let*`, and result of one of the checks I
assigned to a `_` variable, because the variable would be left unused, it's only the
check being non-nil that mattered.
But when byte-compiled that triggered a:
test.el:6:9: Warning: variable ‘_’ not left unused
…which is untrue, because it is unused.
The problem is present in both `if-let` and `if-let*`
# Steps to reproduce
1. Create test.el with the following code:
;;; -*- lexical-binding: t -*-
(if-let*
((_ nil))
(print "then clause")
(print "else clause"))
2. M-x byte-compile test.el
## Expected
It byte-compiles with no warnings
## Actual
It compiles with a warning:
test.el:3:7: Warning: variable ‘_’ not left unused
# Additional information
Emacs version: commit d4d5830f8a0 built two weeks ago from master.
1: https://emacs.stackexchange.com/questions/80351/delete-prettify-symbol
next reply other threads:[~2024-02-13 21:21 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-13 21:21 Konstantin Kharlamov [this message]
2024-02-14 1:01 ` bug#69108: false-positive warning "variable ‘_’ not left unused" in if-let* and if-let Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-17 0:28 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-17 8:04 ` Eli Zaretskii
2024-02-17 9:20 ` Konstantin Kharlamov
2024-02-17 11:45 ` Ihor Radchenko
2024-02-17 10:09 ` Konstantin Kharlamov
2024-02-19 12:37 ` Ihor Radchenko
2024-02-19 13:44 ` Konstantin Kharlamov
2024-02-17 21:46 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-17 22:02 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-18 6:53 ` Eli Zaretskii
2024-02-25 1:54 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-25 7:42 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e25b8ef47525ad702e7860e18ee16fc598430813.camel@yandex.ru \
--to=hi-angel@yandex.ru \
--cc=69108@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.