Repository navigation
Fix declaration emit for imported computed unique-symbol statics - #65827
Open
Muhammad Faizan (MuhammadFaizan-prog) wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟢 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
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 #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
hereby validate --allwas not completed locally.