Repository navigation
fix: preserve getter annotation in accessor decorator metadata - #65343
Merged
Daniel Rosenwasser (DanielRosenwasser) merged 4 commits intoNov 6, 2026
Merged
Conversation
Member
|
If you're willing, this would be much easier to review if it were two commits, one that adds the test and baselines showing bad behavior, then one commit with the fix and baseline update showing it works. |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the accessor metadata fallback change.
No open issues 🎉
What changed in this PR
Fixes #65337 by restoring TypeScript 6.0 behavior in the native compiler: accessor design:type metadata uses the getter’s annotation when the setter parameter is unannotated.
Changes:
- Fall back to the getter annotation while preserving explicit setter annotation precedence.
- Add coverage for accessor order, decorator placement, getter-only accessors, explicit
any, and static accessors. - Update JavaScript, type, and symbol baselines.
| File | Description |
|---|---|
tsc/testdata/tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor8.ts |
Adds accessor metadata regression cases. |
tsc/testdata/baselines/reference/conformance/decoratorOnClassAccessor8(target=es2015).types |
Records types for the added cases. |
tsc/testdata/baselines/reference/conformance/decoratorOnClassAccessor8(target=es2015).symbols |
Records symbols for the added cases. |
tsc/testdata/baselines/reference/conformance/decoratorOnClassAccessor8(target=es2015).js |
Captures corrected metadata while preserving parameter metadata. |
tsc/internal/transformers/tstransforms/typeserializer.go |
Falls back to the getter when the setter has no annotation. |
Review effort: Balanced
Oleksandr Tarasiuk (a-tarasyuk)
force-pushed
the
fix/65337
branch
from
November 5, 2026 19:23
d78e8d5 to
475a620
Compare
Daniel Rosenwasser (DanielRosenwasser)
approved these changes
Nov 6, 2026
Daniel Rosenwasser (DanielRosenwasser)
enabled auto-merge
November 6, 2026 19:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #65337