Skip to content

compiler: fix generic sumtype aliases and duplicate imports - #27523

Merged
medvednikov merged 5 commits into
masterfrom
fix/issues-27513-27515
Jun 21, 2026
Merged

medvednikov merged 5 commits into
masterfrom
fix/issues-27513-27515

Conversation

@medvednikov

@medvednikov medvednikov commented Jun 21, 2026 •

Copy link
Copy Markdown
Member

Summary

  • canonicalize project-local import paths and avoid parsing the same resolved module directory twice
  • validate cached duplicate-path imports against the current import name before skipping
  • normalize inferred generic literal concrete types so generic sumtype aliases use consistent C specialization names
  • use recursively expanded concrete generic sumtype variants for match validation/exhaustiveness
  • match generic sumtype function variants by function signature, consistent with ordinary sumtypes
  • preserve alias identity when matching instantiated generic sumtype variants

Fixes #27513
Fixes #27514
Fixes #27515

Testing

  • ./vnew -silent test -run-only test_imports_with_same_resolved_path_are_parsed_once vlib/v/builder/builder_test.v
  • ./vnew -silent test -run-only test_duplicate_resolved_import_path_still_validates_module_name vlib/v/builder/builder_test.v
  • ./vnew -silent test vlib/v/tests/sumtypes/generic_sumtype_alias_regression_test.v
  • ./vnew -silent test vlib/v/tests/sumtypes/generic_sumtype_alias_match_regression_test.v
  • ./vnew -silent test vlib/v/tests/builtin_arrays/arraydecompose_nonvariadic_test.v
  • ./vnew -silent test vlib/v/tests/sumtypes/sumtype_with_fntype_test.v vlib/v/tests/sumtypes/sumtype_with_alias_fntype_test.v vlib/v/tests/sumtypes/sumtype_with_alias_fntype_fn_call_test.v vlib/v/tests/sumtypes/generic_sumtype_alias_regression_test.v vlib/v/tests/aliases/alias_is_match_runtime_tag_test.v
  • ./vnew -silent test vlib/v/checker/
  • ./vnew -silent vlib/v/compiler_errors_test.v
  • ./vnew -silent vlib/v/gen/c/coutput_test.v

Broad suite note: ./vnew -silent test vlib/v/ was started after the fix but stopped after reproducing existing local failures unrelated to this patch: vlib/v/builder/builder_test.v includes tcc compilation failed, falling back to cc warnings in expected-clean stdout, and vlib/v/generics/new_generics_regression_test.v fails in the local -new-generic-solver test vlib/flag/ run with C compilation errors.

@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: faeb9871ce

ℹ️ 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/match.v Outdated

@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: 9b63a6e55c

ℹ️ 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/match.v Outdated

@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: c39c986211

ℹ️ 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/builder/builder.v Outdated

@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: 619e4f30ee

ℹ️ 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/match.v Outdated
@medvednikov
medvednikov merged commit 42fc2c0 into master Jun 21, 2026
82 of 93 checks passed
@JalonSolov
JalonSolov deleted the fix/issues-27513-27515 branch July 28, 2026 01:19
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