GNU bug report logs - #27545
25.1; Unused lexical variable when byte-compiling pcase with guards

Previous Next

Package: emacs;

Reported by: Yuri Khan <yuri.v.khan <at> gmail.com>

Date: Sat, 1 Jul 2017 10:02:01 UTC

Severity: minor

Tags: confirmed

Merged with 16771, 25558

Found in versions 24.3.50, 25.1

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #12 received at 27545 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Yuri Khan <yuri.v.khan <at> gmail.com>
Cc: 27545 <at> debbugs.gnu.org, 25558 <at> debbugs.gnu.org
Subject: Re: bug#25558: Spurious warnings with variables mentioned only
 pcase guard patterns
Date: Fri, 03 Sep 2021 10:49:09 +0200
Yuri Khan <yuri.v.khan <at> gmail.com> writes:

> C-x C-f test.el RET
>
> ;; -*- lexical-binding: t -*-
>
> (defun foo (x)
>   (pcase x
>     ((and `(,bar ,baz)
>           (guard (eq bar 'quux)))
>      baz)))
>
> C-x C-s
> M-x byte-compile RET test.el RET
>
> Observed output:
>
> Compiling file /home/yuri/test.el at Sat Jul  1 16:27:36 2017
> test.el:3:1:Warning: Unused lexical variable ‘bar’

I can reproduce this in Emacs 26.1, but not in Emacs 28, so I'm guessing
that this is fixed, and I'm closing this bug report.  If there's still
problems here, please respond to the debbugs address and we'll reopen.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 3 years and 264 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.