GNU bug report logs - #76573
30.1; native compilation fails for record inside function

Previous Next

Package: emacs;

Reported by: Lin Jian <me <at> linj.tech>

Date: Tue, 25 Feb 2025 23:29:02 UTC

Severity: normal

Found in version 30.1

Done: Andrea Corallo <acorallo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Andrea Corallo <acorallo <at> gnu.org>
To: Lin Jian <me <at> linj.tech>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 76573 <at> debbugs.gnu.org
Subject: bug#76573: 30.1; native compilation fails for record inside function
Date: Fri, 25 Apr 2025 16:47:09 -0400
Lin Jian <me <at> linj.tech> writes:

> Sorry for the late reply.
>
> Andrea Corallo <acorallo <at> gnu.org> writes:
>
>> the compiler is complaining because while the code is trying to create
>> an object of type 'foo-r', this was actually never defined.
>>
>> Typically those user defined objects are defined using higher level
>> constructs like 'cl-defstruct' which takes care of registering the
>> definition into the global state (and defining the creator
>> 'make-foo-r').
>>
>> Why is this code trying to create never defined kind of objects?  Isn't
>> the case that the code in the file being compiled is missing some
>> require to the definition?
>
> I have no idea why some elisp packages use `record' directly instead of
> some higher level functions like `cl-defstruct' since I am not the
> author of those packages.
>
> If using `record' directly is a user error, I would suggest:
> 1. mentioning it in the manual

We can always improve the manual (patches welcome), but the docstring
for 'record' already says:

"(record TYPE &rest SLOTS)

Create a new record.
TYPE is its type as returned by ‘type-of’."

How can somebody expect this machinery to work reliably for a certain
type which was never defined?




This bug report was last modified 2 days ago.

Previous Next


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