Skip to content

fix: rename len to __soa_len to avoid field name conflicts - #32

Merged
aapoalas merged 1 commit into
mainfrom
26-len-field-name-breaks-soable-derive-macro
Sep 26, 2025
Merged

fix: rename len to __soa_len to avoid field name conflicts#32
aapoalas merged 1 commit into
mainfrom
26-len-field-name-breaks-soable-derive-macro

Conversation

@omfj

@omfj omfj commented Sep 23, 2025

Copy link
Copy Markdown
Collaborator

Problem

The argument len could be overwritten by a field named len.

Solution

Rename the argument len to __soa_len before unpacking the fields. We can also prohibit the use of a field named __soa_len to avoid __soa_len also being overwritten, but I don't believe this is a very common name for a field.

Closes #26

@omfj
omfj force-pushed the 26-len-field-name-breaks-soable-derive-macro branch from 16af208 to 3508add Compare September 23, 2025 10:03
@aapoalas

Copy link
Copy Markdown
Member

LGTM <3

@aapoalas
aapoalas merged commit a70c23e into main Sep 26, 2025
3 checks passed
@aapoalas
aapoalas deleted the 26-len-field-name-breaks-soable-derive-macro branch September 26, 2025 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"len" field name breaks SoAble derive macro

2 participants