Skip to content

fix: preserve getter annotation in accessor decorator metadata - #65343

Merged
Daniel Rosenwasser (DanielRosenwasser) merged 4 commits into
microsoft:mainfrom
a-tarasyuk:fix/65337
Nov 6, 2026
Merged

Daniel Rosenwasser (DanielRosenwasser) merged 4 commits into
microsoft:mainfrom
a-tarasyuk:fix/65337

Conversation

@a-tarasyuk

Copy link
Copy Markdown
Contributor

Fixes #65337

Copilot AI balanced review requested due to automatic review settings November 5, 2026 19:07
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Nov 5, 2026
@typescript-automation typescript-automation Bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Nov 5, 2026
@jakebailey

Copy link
Copy Markdown
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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are identified for the accessor decorator metadata fallback change.

No open issues 🎉

Review effort: Balanced

@github-project-automation github-project-automation Bot moved this from Not started to Needs merge in PR Backlog Nov 6, 2026
@typescript-automation typescript-automation Bot added For Milestone Bug PRs that fix a bug with a specific milestone and removed For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Nov 6, 2026
Merged via the queue into microsoft:main with commit fa62f87 Nov 6, 2026
61 of 63 checks passed
@github-project-automation github-project-automation Bot moved this from Needs merge to Done in PR Backlog Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Milestone Bug PRs that fix a bug with a specific milestone

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

emitDecoratorMetadata: design:type is Object for an accessor pair whose setter parameter is unannotated (regression from 6.0)

4 participants