Repository navigation
Qualify merged namespace references in import-equals emit - #64976
Open
magic-akari wants to merge 1 commit into
Open
magic-akari wants to merge 1 commit into
magic-akari wants to merge 1 commit into
Conversation
Visit the expression created from an import-equals target during emit. This qualifies references across merged namespace blocks with the namespace name instead of emitting an out-of-scope identifier. Add conformance tests for local, merged, exported, and nested namespace import aliases.
magic-akari
marked this pull request as ready for review
October 27, 2026 07:16
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The localized fix reuses existing qualification logic, and the regression baselines cover the affected alias forms with no identified blocking issues.
No open issues 🎉
What changed in this PR
Fixes #64975 by applying existing namespace-qualification logic to import-equals targets during JavaScript emit, preventing out-of-scope references across merged namespace blocks.
Changes:
- Visit generated import-equals target expressions before emitting them.
- Add conformance coverage for local, merged, exported, explicitly qualified, and nested namespace aliases.
- Record expected JavaScript, type, and symbol baselines.
| File | Description |
|---|---|
tsc/testdata/tests/cases/conformance/internalModules/importDeclarations/importAliasMergedNamespace.ts |
Adds namespace import-alias regression cases. |
tsc/testdata/baselines/reference/conformance/importAliasMergedNamespace.types |
Records expected alias types. |
tsc/testdata/baselines/reference/conformance/importAliasMergedNamespace.symbols |
Records expected symbol resolution. |
tsc/testdata/baselines/reference/conformance/importAliasMergedNamespace.js |
Verifies namespace-qualified emit while preserving local references. |
tsc/internal/transformers/tstransforms/runtimesyntax.go |
Applies expression visitation to import-equals targets. |
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.
Visit the expression created from an import-equals target during emit. This qualifies references across merged namespace blocks with the namespace name instead of emitting an out-of-scope identifier.
Add conformance tests for local, merged, exported, and nested namespace import aliases.
import =emit across merged namespaces #64975