Skip to content

fix(transformer): emit Object instead of void 0 for untyped getter/setter design:type metadata#20488

Merged
graphite-app[bot] merged 1 commit intomainfrom
fix/getter-setter-design-type-metadata
Mar 18, 2026
Merged

fix(transformer): emit Object instead of void 0 for untyped getter/setter design:type metadata#20488
graphite-app[bot] merged 1 commit intomainfrom
fix/getter-setter-design-type-metadata

Conversation

@Dunqing
Copy link
Member

@Dunqing Dunqing commented Mar 18, 2026

Summary

  • Fix design:type metadata for getter/setter decorators without type annotations emitting void 0 instead of Object
  • Use serialize_type_annotation (which defaults to Object) instead of serialize_return_type_of_node (which defaults to void 0) for getter design:type
  • Verified output matches TypeScript's behavior

Closes #20368

Test plan

  • Added untyped getter/setter test cases to getter-setter-method fixture
  • Verified output matches TypeScript compiler output
  • All conformance tests pass with no regressions
  • Clippy clean

🤖 Generated with Claude Code

@Dunqing Dunqing requested a review from overlookmotel as a code owner March 18, 2026 08:09
@github-actions github-actions bot added A-transformer Area - Transformer / Transpiler C-bug Category - Bug labels Mar 18, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 18, 2026

Merging this PR will not alter performance

✅ 49 untouched benchmarks
⏩ 7 skipped benchmarks1


Comparing fix/getter-setter-design-type-metadata (68f77e1) with main (7215d9e)

Open in CodSpeed

Footnotes

  1. 7 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.

Copy link
Member Author

Dunqing commented Mar 18, 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 changes, fast-track this PR to the front of the merge queue

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.

@Dunqing Dunqing force-pushed the fix/getter-setter-design-type-metadata branch from 7576797 to 68f77e1 Compare March 18, 2026 08:22
@Dunqing Dunqing requested review from sapphi-red and removed request for overlookmotel March 18, 2026 08:28
@Dunqing Dunqing added the 0-merge Merge with Graphite Merge Queue label Mar 18, 2026
Copy link
Member Author

Dunqing commented Mar 18, 2026

Merge activity

…r/setter `design:type` metadata (#20488)

## Summary

- Fix `design:type` metadata for getter/setter decorators without type annotations emitting `void 0` instead of `Object`
- Use `serialize_type_annotation` (which defaults to `Object`) instead of `serialize_return_type_of_node` (which defaults to `void 0`) for getter `design:type`
- Verified output matches TypeScript's behavior

Closes #20368

## Test plan

- [x] Added untyped getter/setter test cases to `getter-setter-method` fixture
- [x] Verified output matches TypeScript compiler output
- [x] All conformance tests pass with no regressions
- [x] Clippy clean

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@graphite-app graphite-app bot force-pushed the fix/getter-setter-design-type-metadata branch from 68f77e1 to 3bbd0cd Compare March 18, 2026 09:52
@graphite-app graphite-app bot merged commit 3bbd0cd into main Mar 18, 2026
21 checks passed
@graphite-app graphite-app bot deleted the fix/getter-setter-design-type-metadata branch March 18, 2026 10:04
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 18, 2026
Boshen added a commit that referenced this pull request Mar 19, 2026
### 🚀 Features

- 7215d9e transformer: Support lowering `accessor` with legacy
decorators (#20348) (Dunqing)

### 🐛 Bug Fixes

- 3bbd0cd transformer: Emit `Object` instead of `void 0` for untyped
getter/setter `design:type` metadata (#20488) (Dunqing)
- 4ae3f3f ecmascript: Apply coercion-is-pure assumption to constructor
side-effect detection (#20420) (Dunqing)
- 11f9695 transformer: Legacy decorator on computed property key leaves
variable unassigned (#20430) (bab)
- efeba28 ecmascript: Add argument validation for NewExpression
side-effect detection (#20395) (Dunqing)

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

A-transformer Area - Transformer / Transpiler C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

transformer: design:type emits void 0 for getter/setter decorators

2 participants