Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7a1c370c58
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if fn_name.starts_with('${module_name}__') { | ||
| return fn_name | ||
| } |
There was a problem hiding this comment.
Preserve module prefix in generated fn scope keys
Do not strip the module prefix from generated function scope keys here. register_needed_option_clone can emit names like builtin__Option_string__clone, but transformer/fn.v and Environment.get_fn_scope still look up scopes as ${module}__${fn_name}. With this branch, those helpers are stored under a different key, so generated clone helpers in non-main/builtin modules miss parameter type scope; the synthetic if value := s in option clone generation is then treated as a plain condition and can lower to if (s) (invalid for option structs in C). A simple trigger is cloning a struct that contains ?string.
Useful? React with 👍 / 👎.
Summary
clone()auto-generation for structs with heap-allocated fields-cstrictbuild: cast_dyld_get_image_header()return tovoidptrin backtracescmd/v2/andvlib/v2/directoriesTest plan
transformer_test.v)checker_test.v)v -cg -cstrict -o vstrict1 cmd/vbuilds without errors🤖 Generated with Claude Code