Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cgen: fix codegen for selector on shared var with embed #23394

Merged
merged 3 commits into from
Jan 7, 2025

Conversation

felipensp
Copy link
Member

@felipensp felipensp commented Jan 6, 2025

g.write_selector_expr_embed_name(node, node.from_embed_types)
}
} else {
has_embed = node.from_embed_types.len > 0
Copy link
Member

Choose a reason for hiding this comment

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

This can be extracted as a single line, before the if sym.info.embeds.len > 0 { line above - it seems to be set in all cases, when node.from_embed_types.len > 0 .

Copy link
Member

Choose a reason for hiding this comment

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

Or even right after if sym.info in [ast.Struct, ast.Aggregate] {.

@spytheman spytheman marked this pull request as ready for review January 7, 2025 08:00
Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

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

Good work.

@spytheman spytheman merged commit ca6e3a3 into vlang:master Jan 7, 2025
72 checks passed
@felipensp felipensp deleted the fix_shared_var_selector branch January 8, 2025 18:33
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.

C error with shared struct that embeds another struct
2 participants