Skip to content

Qualify merged namespace references in import-equals emit - #64976

Open
magic-akari wants to merge 1 commit into
microsoft:mainfrom
magic-akari:fix/namespace-import-equals-qualification
Open

magic-akari wants to merge 1 commit into
microsoft:mainfrom
magic-akari:fix/namespace-import-equals-qualification

Conversation

@magic-akari

Copy link
Copy Markdown
Contributor

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.

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.
@typescript-automation typescript-automation Bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Oct 27, 2026
@magic-akari
magic-akari marked this pull request as ready for review October 27, 2026 07:16
Copilot AI balanced review requested due to automatic review settings October 27, 2026 07:16

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

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

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

None yet

Development

Successfully merging this pull request may close these issues.

Missing namespace qualifier in import = emit across merged namespaces

2 participants