Skip to content

xdr_codegen: make struct members always named - #8

Merged
bertschinger merged 1 commit into
mainfrom
named_struct_members
May 28, 2026
Merged

xdr_codegen: make struct members always named#8
bertschinger merged 1 commit into
mainfrom
named_struct_members

Conversation

@bertschinger

Copy link
Copy Markdown
Collaborator

The members of XdrStruct were defined to be of type Definition. Definition has two variants, named and void.

There is no use case for void struct members. Every place in the code that iterated over struct members was just "unwrapping" and either skipping void members or panicking.

Since the panicking meant that void struct members were effectively illegal, and since there is no use case for them, it is simpler to just make them not representable by making struct members always a NamedDeclaration.

The members of XdrStruct were defined to be of type Definition.
Definition has two variants, named and void.

There is no use case for void struct members. Every place in the code
that iterated over struct members was just "unwrapping" and either
skipping void members or panicking.

Since the panicking meant that void struct members were effectively
illegal, and since there is no use case for them, it is simpler to just
make them not representable by making struct members always a
NamedDeclaration.
@bertschinger
bertschinger force-pushed the named_struct_members branch from f0bf59e to f4cd9d0 Compare May 28, 2026 17:28
@bertschinger
bertschinger merged commit 91977ea into main May 28, 2026
2 checks passed
@bertschinger
bertschinger deleted the named_struct_members branch June 9, 2026 20:07
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.

1 participant