Skip to content

cgen, checker: fix comptime enumdata value property access - #19768

Merged
spytheman merged 2 commits into
vlang:masterfrom
felipensp:fix_enudata_get
Nov 7, 2023
Merged

spytheman merged 2 commits into
vlang:masterfrom
felipensp:fix_enudata_get

Conversation

@felipensp

@felipensp felipensp commented Nov 4, 2023 •

Copy link
Copy Markdown
Member

Fix #19489

πŸ€– Generated by Copilot at 35934ed

Fix C backend issue with enum fields with custom types. Assign type to selector expression node in checker.v and generate simple dot notation in cgen.v.

πŸ€– Generated by Copilot at 35934ed

  • Assign the type of the selector expression node to the node itself to preserve type information for enum fields (link)
  • Generate C code for enum fields with custom types by writing the expression and the field name with a dot, avoiding sym table lookup (link)

@felipensp
felipensp marked this pull request as ready for review November 6, 2023 13:13

@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.

Nice, very elegant fix.

@spytheman
spytheman merged commit 60ba140 into vlang:master Nov 7, 2023
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.

Compile-time macro confuses function names

2 participants