[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#42919: 27.1; Strange byte compile error with `cond' involving cons
From: |
Basil L. Contovounesios |
Subject: |
bug#42919: 27.1; Strange byte compile error with `cond' involving cons |
Date: |
Tue, 18 Aug 2020 23:45:47 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
severity 42919 important
tags 42919 + confirmed
quit
Ikumi Keita <ikumi@ikumi.que.jp> writes:
> I encountered a strange byte compile error with simple elisp code.
>
> [How to reproduce]
> 1. Save the following file as /tmp/foo.el:
> --- /tmp/foo.el ----------------------------
> (defun xyz (arg)
> (cond
> ; ((member '("image") arg) ; OK
> ; ((member '(rel "image") arg) ; OK
> ; ((remove '(rel . "image") arg) ; OK
> ; ((memq '(rel . "image") arg) ; NG
> ((member '(rel . "image") arg) ; NG
> 1)))
> --------------------------------------------
> 2. emacs-27.1 -Q
> 3. M-x byte-compile-file /tmp/foo.el RET
> 4. Then byte compile fails with the following error:
> Compiling file /tmp/foo.el at Wed Aug 19 03:38:06 2020
> Entering directory ‘/tmp/’
> foo.el:1:13:Error: Wrong type argument: listp, "image"
> in *Compile-Log* buffer. I don't see foo.elc in /tmp after that.
> Expected result is that byte compile finishes without error and foo.elc
> is generated.
>
> [Additional info]
> a. As written in the above code, only cons (rel . "image") causes this
> error. Both lists (rel "image") and ("image") are OK.
> b. As written in the above code, both `member' and `memq' fail while
> `remove' succeeds.
> c. Emacs 26.3 works as expected.
Thanks, bisected to the following commit:
Compile list member functions in cond to switch (bug#36139)
36ab408207 2019-06-19 11:20:58 +0200
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=36ab408207d7adf94fd1396922e0df38d746a948
--
Basil