Skip to content

cgen: fix C struct init when it has default expr - #21510

Merged
spytheman merged 8 commits into
vlang:masterfrom
felipensp:fix_struct_c_init
May 18, 2024
Merged

spytheman merged 8 commits into
vlang:masterfrom
felipensp:fix_struct_c_init

Conversation

@felipensp

Copy link
Copy Markdown
Member

Fix #21501

@felipensp
felipensp marked this pull request as ready for review May 17, 2024 12:00
Comment on lines +22 to +24
assert a.a == b.a
assert b.a == c.bar.a
assert b.b == c.bar.b

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that if you test against the actual known concrete values here, the tests will be clearer, and failures will be easier to diagnose.

@spytheman spytheman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work.

@spytheman
spytheman merged commit fd144b3 into vlang:master May 18, 2024
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.

using a C struct as a struct field does not adopted default values

2 participants