Subject: bug#76573: 30.1; native compilation fails for record inside function

From: Lin Jian <[email-masked]>
Date: Sat, 26 Apr 2025 05:13:14 +0800

Andrea Corallo <[email-masked]> writes:

> > 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)

It may not be a good idea for me to write such as patch since I do not
know the inner workings of this topic.

> 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?

Since "M-x eval-expression (type-of (record 'foo-r)) RET" works and how
to define a type is not mentioned, users may not realize that they need
to define a type first or they may think `record' will define the type
for them when necessary.