Skip to content

Fix #24513 - ImportC: brace elision into a union member is rejected as overlapping initialization - #24550

Merged
dkorpel merged 1 commit into
dlang:masterfrom
udaykiriti:fix-24513
Dec 3, 2026
Merged

dkorpel merged 1 commit into
dlang:masterfrom
udaykiriti:fix-24513

Conversation

@udaykiriti

Copy link
Copy Markdown
Contributor

When filling a union with elided braces, subStruct skips members that overlap one already initialized. If the last member overlapped, it was still used, so { 1, 2, 3 } put 3 into the union instead of the next field. Stop there and give the rest back to the enclosing struct.
Fixes #24513

…ted as overlapping initialization

When filling a union with elided braces, subStruct skips members that
overlap one already initialized. If the last member overlapped, it
was still used, so `{ 1, 2, 3 }` put `3` into the union instead of
the next field. Stop there and give the rest back to the enclosing
struct.
@dkorpel
dkorpel merged commit a71255d into dlang:master Dec 3, 2026
42 checks passed
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.

ImportC: brace elision into a union member is rejected as overlapping initialization

2 participants