GNU bug report logs -
#42919
27.1; Strange byte compile error with `cond' involving cons
Previous Next
Reported by: Ikumi Keita <ikumi <at> ikumi.que.jp>
Date: Tue, 18 Aug 2020 19:01:01 UTC
Severity: important
Tags: confirmed
Found in version 27.1
Done: Mattias Engdegård <mattiase <at> acm.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
severity 42919 important
tags 42919 + confirmed
quit
Ikumi Keita <ikumi <at> 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
This bug report was last modified 4 years and 335 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.