Skip to content

fix(64494): fix decorated class names with private member self-references - #64505

Open
Oleksandr Tarasiuk (a-tarasyuk) wants to merge 5 commits into
microsoft:mainfrom
a-tarasyuk:fix/64494
Open

Oleksandr Tarasiuk (a-tarasyuk) wants to merge 5 commits into
microsoft:mainfrom
a-tarasyuk:fix/64494

Conversation

@a-tarasyuk

Copy link
Copy Markdown
Contributor

Fixes #64494

Copilot AI balanced review requested due to automatic review settings September 28, 2026 17:01
@typescript-automation typescript-automation Bot added For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Sep 28, 2026
@typescript-automation

Copy link
Copy Markdown
Contributor

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

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.

Copilot review overview

🟡 Changes recommended

The incorrect temporary-derived class name remains possible when pending expressions exist without transformable statics.

Review effort: Balanced
Findings: 1 High severity

Open (1)
What changed in this PR

Fixes decorated class naming when private members reference their enclosing class.

Changes:

  • Avoids unnecessary temporary assignment for affected decorated classes.
  • Adds coverage for private fields, methods, getters, and setters.
File Description
tsc/​internal/​transformers/​estransforms/​classfields.go Adjusts decorated class-expression emission.
tsc/​testdata/​tests/​cases/​conformance/​esDecorators/​classDeclaration/​esDecorators-classDeclaration-setFunctionName.ts Adds regression cases.
tsc/​testdata/​baselines/​reference/​conformance/​esDecorators-classDeclaration-setFunctionName(target=esnext).js Updates ESNext baseline.
tsc/​testdata/​baselines/​reference/​conformance/​esDecorators-classDeclaration-setFunctionName(target=es2022).js Updates ES2022 baseline.
tsc/​testdata/​baselines/​reference/​conformance/​esDecorators-classDeclaration-setFunctionName(target=es2015).js Updates ES2015 baseline.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread tsc/internal/transformers/estransforms/classfields.go
@a-tarasyuk
Oleksandr Tarasiuk (a-tarasyuk) marked this pull request as draft September 28, 2026 17:07
@a-tarasyuk
Oleksandr Tarasiuk (a-tarasyuk) marked this pull request as ready for review September 28, 2026 17:17

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.

Copilot review overview

🟢 Approval recommended

The focused transformer change fixes the reported regression and is covered by representative emit baselines.

Review effort: Balanced
Findings: None

Resolved since last review (1)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Not started

Development

Successfully merging this pull request may close these issues.

Decorated class gets name === "_a" when a #private field initializer references the class (regression in 7.0)

3 participants