Skip to content

Fix declaration emit for imported computed unique-symbol statics - #65827

Open
Muhammad Faizan (MuhammadFaizan-prog) wants to merge 1 commit into
microsoft:mainfrom
MuhammadFaizan-prog:fix/65744-computed-unique-symbol-declaration-emit
Open

Muhammad Faizan (MuhammadFaizan-prog) wants to merge 1 commit into
microsoft:mainfrom
MuhammadFaizan-prog:fix/65744-computed-unique-symbol-declaration-emit

Conversation

@MuhammadFaizan-prog

Copy link
Copy Markdown

Fixes #65744.

Declaration emit could panic when serializing an indexed access to an imported class's computed unique-symbol static. The index type reused the key expression from the declaring file, which could leave a foreign identifier in the emitted declaration.

Serialize the unique-symbol key in the destination scope so declaration emit can track the correct alias or use an import-type reference. Existing handling for other computed entity names is preserved.

Testing

  • Reproduced the declaration emit panic on unpatched main. The focused regression and full compiler test runner passed with the fix.
  • The regression baseline covers direct, renamed, and namespace-qualified keys, plus the import-type fallback. All seven emitted declarations matched expected output and passed independent strict type checking.
  • Go tests passed across 69 packages with four Unix-socket cases excluded because the local sandbox forbids Unix sockets. Full hereby validate --all was not completed locally.

Copilot AI balanced review requested due to automatic review settings December 5, 2026 21:42
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Dec 5, 2026
@typescript-automation typescript-automation Bot added For Backlog Bug PRs that fix a backlog bug labels Dec 5, 2026

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 imported computed unique-symbol key serialization change.

No open issues 🎉

What changed in this PR

Fixes #65744 by serializing imported computed unique-symbol keys in the destination scope, preventing declaration-emission crashes and unresolved key references.

Changes:

  • Resolves unique-symbol keys through accessible aliases or import-type references.
  • Adds regression coverage for direct, renamed, namespace-qualified, and indirectly accessed keys.
File Description
tsc/​internal/​checker/​nodebuilderimpl.go Serializes computed unique-symbol keys in the destination scope.
tsc/​testdata/​tests/​cases/​compiler/​declarationEmitImportedComputedUniqueSymbolStatic.ts Adds declaration-emission regression cases.
tsc/​testdata/​baselines/​reference/​compiler/​declarationEmitImportedComputedUniqueSymbolStatic.js Records expected JavaScript and declaration output.

Review effort: Balanced

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 Backlog Bug PRs that fix a backlog bug

Projects

Status: Not started

Development

Successfully merging this pull request may close these issues.

Declaration emit crashes on an imported class indexed by a computed unique-symbol static

2 participants