Repository navigation
Keep computed-name reconstruction out of symbol tracking - #64208
Merged
Jake Bailey (jakebailey) merged 2 commits intoSep 17, 2026
Merged
Jake Bailey (jakebailey) merged 2 commits into
Jake Bailey (jakebailey) merged 2 commits into
Conversation
Record declaration emit retaining an otherwise unused namespace after serializing a computed property from another file. The referenced type is stripped, so the namespace should not survive in declaration output.
Computed property references are already checked in the destination scope. Reconstructing their source spelling must not track a second reference in the source scope, which could paint declarations visible for another file's emitter. Separate expression construction from reference tracking and use the untracked path when reconstructing computed names. Update the regression baseline so the otherwise unused namespace is no longer emitted.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The tracking change is narrowly scoped and the regression baselines verify the corrected declaration visibility behavior.
Pull request overview
Prevents computed-name reconstruction from incorrectly marking source-scope declarations as visible during declaration emit.
Changes:
- Separates symbol tracking from expression reconstruction.
- Adds a regression test for cross-file computed names with
stripInternal. - Adds expected diagnostic, emit, type, and symbol baselines.
File summaries
| File | Description |
|---|---|
tsc/internal/checker/nodebuilderimpl.go |
Uses untracked reconstruction for computed property names. |
tsc/testdata/tests/cases/compiler/declarationEmitComputedPropertyNameSymbolStripInternal.ts |
Adds the regression scenario. |
tsc/testdata/baselines/reference/compiler/declarationEmitComputedPropertyNameSymbolStripInternal.js |
Records declaration output. |
tsc/testdata/baselines/reference/compiler/declarationEmitComputedPropertyNameSymbolStripInternal.errors.txt |
Records the expected diagnostic. |
tsc/testdata/baselines/reference/compiler/declarationEmitComputedPropertyNameSymbolStripInternal.symbols |
Records symbol information. |
tsc/testdata/baselines/reference/compiler/declarationEmitComputedPropertyNameSymbolStripInternal.types |
Records inferred types. |
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Jake Bailey (jakebailey)
requested review from
Gabriela Araujo Britto (gabritto) and
Wesley Wigham (weswigham)
September 17, 2026 22:55
Wesley Wigham (weswigham)
approved these changes
Sep 17, 2026
Wesley Wigham (weswigham)
left a comment
Member
There was a problem hiding this comment.
You know, I think I've actually been working around downstream issues caused by that painting in other bug fixes for a very long time, and just assumed that potential cross-file visibility painting was how it be, for reasons. Excellent root cause to fix.
Jake Bailey (jakebailey)
deleted the
fix-declaration-emit-visibility
branch
September 17, 2026 23:15
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.
This should be the actual fix for the problem I tried to fix in #63986.
The first commit has a test which shows the bad behavior consistently, the second fixes it.