Skip to content

checker, cgen: fix fixed array struct initialization - #27959

Merged
medvednikov merged 3 commits into
masterfrom
fix/issues-27894-27957
Jul 27, 2026
Merged

checker, cgen: fix fixed array struct initialization#27959
medvednikov merged 3 commits into
masterfrom
fix/issues-27894-27957

Conversation

@medvednikov

@medvednikov medvednikov commented Jul 27, 2026

Copy link
Copy Markdown
Member

Summary

  • use the empty-struct initializer sentinel for direct fixed-array aliases of empty structs
  • reject references assigned to non-pointer fixed-array struct fields before C generation
  • mirror the checker fix in v3 and cover both fixed-array cases there
  • add regression coverage for both cases

Fixes #27894
Fixes #27957

Tests

  • ./vnew vlib/v/tests/aliases/alias_fixed_array_of_struct_test.v
  • ./vnew -cc tcc vlib/v/tests/aliases/alias_fixed_array_of_struct_test.v
  • ./vnew -silent vlib/v/compiler_errors_test.v
  • ./vnew -silent test vlib/v/checker/
  • ./vnew -silent vlib/v/slow_tests/inout/compiler_test.v
  • ./vnew -silent vlib/v/gen/c/coutput_test.v
  • ./vnew -silent vlib/v3/tests/fixed_array_local_zero_init_codegen_test.v

The full vlib/v/ suite was skipped as requested.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 78261f59e5

ℹ️ 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".

Comment thread vlib/v/checker/struct.v Outdated
@medvednikov
medvednikov merged commit d8abccb into master Jul 27, 2026
88 of 96 checks passed
@JalonSolov
JalonSolov deleted the fix/issues-27894-27957 branch July 28, 2026 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant