Skip to content

cgen: route integer interpolation through str_intp - #27575

Merged
medvednikov merged 1 commit into
v3-arm64-selfhostfrom
fix-int-interpolation-str-intp
Jun 27, 2026
Merged

cgen: route integer interpolation through str_intp#27575
medvednikov merged 1 commit into
v3-arm64-selfhostfrom
fix-int-interpolation-str-intp

Conversation

@medvednikov

@medvednikov medvednikov commented Jun 27, 2026

Copy link
Copy Markdown
Member

Fixes #27574

Summary:

  • Route primitive integer simple interpolation through str_intp outside builtin internals, avoiding the int_str + string_plus_many lowering.
  • Keep markused in sync for direct and generic string interpolation so str_intp runtime helpers stay available when needed.
  • Preserve .str()/auto-str helper dependencies for s-formatted operands when another operand forces runtime interpolation.
  • Leave untyped integer literals on the existing stringification path, preserving large literal values such as ${2147483648}.
  • Keep aggregate smartcast interpolation with auto s formatting on the existing simple stringification path.
  • Add regressions for the os + -skip-unused helper retention case, mixed integer plus auto-str operands, the large integer literal path, and grouped aggregate smartcasts.

Tests:

  • ./v -g -keepc -o ./vnew cmd/v
  • ./vnew -silent vlib/v/compiler_errors_test.v
  • ./vnew -silent test -run-only test_skip_unused_runtime_integer_interpolation_marks_auto_str_operand vlib/v/gen/c/coutput_test.v
  • ./vnew -silent test -run-only test_skip_unused_aggregate_smartcast_integer_interpolation_uses_simple_path vlib/v/gen/c/coutput_test.v
  • ./vnew -silent test -run-only test_skip_unused_os_integer_interpolation_keeps_str_intp_runtime vlib/v/gen/c/coutput_test.v
  • ./vnew -silent test -run-only test_c_must_have_files vlib/v/gen/c/coutput_test.v
  • ./vnew -skip-unused run vlib/v/gen/c/testdata/string_interpolation_simple_optimization.vv
  • ./vnew run vlib/v/checker/tests/run/comptime_ident_is_type.vv
  • ./vnew -silent test vlib/v/tests/builtin_strings_and_interpolation/

Notes:

  • A full ./vnew -silent vlib/v/gen/c/coutput_test.v run still hit an unrelated translated_module.vv mismatch with empty output instead of result: 104.
  • A broad ./vnew -silent test vlib/v/ run was stopped after unrelated failures from an untracked cmd/v2/_tmp_map_empty_raw.v parser fixture pickup and tcc fallback warning output pollution.
  • An attempted parallel coutput validation run failed because coutput_test.v shares temp directories and process cwd state across tests; the relevant coutput checks were rerun sequentially with test -run-only and passed.

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

ℹ️ 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/markused/walker.v Outdated
@medvednikov
medvednikov force-pushed the fix-int-interpolation-str-intp branch from a6b16b7 to 59f02e4 Compare June 27, 2026 13:20

@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: 59f02e4058

ℹ️ 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/gen/c/str_intp.v Outdated
@medvednikov
medvednikov force-pushed the fix-int-interpolation-str-intp branch from 59f02e4 to 8ab73ce Compare June 27, 2026 13:30

@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: 8ab73ce4e8

ℹ️ 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/gen/c/str_intp.v Outdated
@medvednikov
medvednikov force-pushed the fix-int-interpolation-str-intp branch from 8ab73ce to 6c26e86 Compare June 27, 2026 13:46

@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: 6c26e865e1

ℹ️ 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/markused/walker.v
@medvednikov
medvednikov force-pushed the fix-int-interpolation-str-intp branch from 6c26e86 to 77f32f2 Compare June 27, 2026 14:08

@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: 77f32f24ad

ℹ️ 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/gen/c/coutput_test.v Outdated
@medvednikov
medvednikov force-pushed the fix-int-interpolation-str-intp branch from 77f32f2 to 34cbfff Compare June 27, 2026 14:19
@medvednikov
medvednikov merged commit 2d1dae3 into v3-arm64-selfhost Jun 27, 2026
71 of 93 checks passed
@JalonSolov
JalonSolov deleted the fix-int-interpolation-str-intp branch July 28, 2026 01:20
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.

1 participant