Skip to content

fix(codegen): print static keyword for TSIndexSignature#19755

Merged
graphite-app[bot] merged 1 commit intomainfrom
fix/codegen-static-index-signature
Mar 4, 2026
Merged

fix(codegen): print static keyword for TSIndexSignature#19755
graphite-app[bot] merged 1 commit intomainfrom
fix/codegen-static-index-signature

Conversation

@Dunqing
Copy link
Member

@Dunqing Dunqing commented Feb 26, 2026

The codegen was missing the static keyword when printing TSIndexSignature
nodes, causing static [key: string]: string index signatures to lose the
static modifier during code generation.

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

@github-actions github-actions bot added A-codegen Area - Code Generation C-bug Category - Bug labels Feb 26, 2026
Copy link
Member Author

Dunqing commented Feb 26, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 26, 2026

Merging this PR will not alter performance

✅ 53 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing fix/codegen-static-index-signature (44b7ddd) with main (9b747ce)

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@graphite-app graphite-app bot changed the base branch from fix/codegen-override-keyword to graphite-base/19755 February 26, 2026 13:43
@graphite-app graphite-app bot force-pushed the graphite-base/19755 branch from bf4a1ae to ed17bbf Compare February 26, 2026 13:51
@graphite-app graphite-app bot force-pushed the fix/codegen-static-index-signature branch from 1bb492f to b7233d9 Compare February 26, 2026 13:51
@graphite-app graphite-app bot changed the base branch from graphite-base/19755 to main February 26, 2026 13:52
@graphite-app graphite-app bot force-pushed the fix/codegen-static-index-signature branch from b7233d9 to 8cad8f5 Compare February 26, 2026 13:52
@Dunqing Dunqing force-pushed the fix/codegen-static-index-signature branch 2 times, most recently from 7086d36 to 44b7ddd Compare March 4, 2026 14:14
@Dunqing Dunqing requested a review from camc314 March 4, 2026 14:14
@Dunqing Dunqing marked this pull request as ready for review March 4, 2026 14:23
Copilot AI review requested due to automatic review settings March 4, 2026 14:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug in the code generator (oxc_codegen) where the static modifier was not being emitted when printing TSIndexSignature nodes (e.g., static [key: string]: string in a class body). The missing keyword caused the static modifier to be silently dropped during code generation.

Changes:

  • Add emission of the static keyword in TSIndexSignature::gen before the existing readonly keyword check.
  • Add a test_same round-trip test verifying that static [key: string]: string is preserved during codegen.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
crates/oxc_codegen/src/gen.rs Adds if self.r#static { p.print_str("static "); } before the readonly check in TSIndexSignature code generation, fixing the dropped modifier.
crates/oxc_codegen/tests/integration/ts.rs Adds a test_same round-trip test for a class with a static index signature.

@camc314 camc314 self-assigned this Mar 4, 2026
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Mar 4, 2026
Copy link
Contributor

camc314 commented Mar 4, 2026

Merge activity

The codegen was missing the `static` keyword when printing `TSIndexSignature`
nodes, causing `static [key: string]: string` index signatures to lose the
`static` modifier during code generation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@graphite-app graphite-app bot force-pushed the fix/codegen-static-index-signature branch from 44b7ddd to 588009e Compare March 4, 2026 16:26
@graphite-app graphite-app bot merged commit 588009e into main Mar 4, 2026
21 checks passed
@graphite-app graphite-app bot deleted the fix/codegen-static-index-signature branch March 4, 2026 16:32
camc314 pushed a commit that referenced this pull request Mar 9, 2026
### 🚀 Features

- e8547cc parser: Report error for using declarations in ambient
contexts (#19934) (camc314)
- 8345318 allocator: Add methods for boxed slices `ArenaBox<[T]>`
(#19968) (overlookmotel)
- f83be30 allocator: Add `Vec::push_fast` method (#19959)
(overlookmotel)

### 🐛 Bug Fixes

- 291d867 transformer_plugins: Unwrap ChainExpression after define
replacement removes optional markers (#20058) (IWANABETHATGUY)
- 36b2e56 codegen: Print type for TSImportEqualsDeclaration (#20128)
(camc314)
- 5a246ec codegen: Print type arguments for JSXOpeningElement (#20127)
(camc314)
- a40870e codegen: Preserve parens for TSNonNullExpression (#20125)
(camc314)
- ae830b2 codegen: Print `declare` for `TSInterfaceDeclaration` (#20124)
(camc314)
- 92cfb14 linter/plugins: Fix types for `walkProgram` and
`walkProgramWithCfg` (#20081) (overlookmotel)
- ee0491e apps,napi: Explicitly specify libs in tsconfigs (#20071)
(camc314)
- 588009e codegen: Print `static` keyword for TSIndexSignature (#19755)
(Dunqing)
- 5a8799c codegen: Print `with_clause` for `ExportNamedDeclaration`
(#20002) (Dunqing)
- 7502afe parser: Correct capacity for tokens `Vec` (#19967)
(overlookmotel)

### ⚡ Performance

- 4ea8f9a napi: Remove `napi_build::setup()` from `oxc_napi` to avoid
redundant rebuilds (#20094) (Boshen)
- 2baa5fb napi: Unify build-test profile to coverage for cache sharing
(#20090) (Boshen)
- 8ba61dd parser: Make pushing tokens faster (#19960) (overlookmotel)

Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0-merge Merge with Graphite Merge Queue A-codegen Area - Code Generation C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants