Skip to content
This repository was archived by the owner on Sep 1, 2026. It is now read-only.

Fix declaration emit alias reuse for inferred exports - #3314

Merged
Jake Bailey (jakebailey) merged 5 commits into
microsoft:mainfrom
thromel:romel/fix-3310-declaration-alias-reuse
Apr 4, 2026
Merged

Fix declaration emit alias reuse for inferred exports#3314
Jake Bailey (jakebailey) merged 5 commits into
microsoft:mainfrom
thromel:romel/fix-3310-declaration-alias-reuse

Conversation

@thromel

@thromel Tanzim Hossain Romel (thromel) commented Apr 1, 2026

Copy link
Copy Markdown

Summary

  • fix serializeTypeName by aligning its resolveEntityName call with upstream alias-resolution behavior
  • preserve imported type aliases for inferred exports across module boundaries in the #3310 repro
  • accept the corresponding local and submodule-backed compiler baseline updates

Root Cause

Our Go port was calling resolveEntityName from serializeTypeName with dontResolveAlias: true, unlike upstream. That made declaration emit check accessibility on the imported alias symbol instead of the resolved export, so reused type nodes fell back to structural expansion and surfaced TS4023 in the Settings/ISettings repro.

The fix is just the upstream-aligned boolean flip in serializeTypeName. That changes the local packageDeduplicationDuplicateGlobals.types baseline and several submodule-backed compiler .types baselines, with some previous .diff files becoming obsolete.

Validation

  • npm ci
  • git submodule update --init --recursive
  • GOTOOLCHAIN=auto go run ./cmd/tsgo -p tmp/issue-3310/tsconfig.json
  • GOTOOLCHAIN=auto go test ./internal/execute/tsctests -run '^TestTscDeclarationEmit$'
  • GOTOOLCHAIN=auto go test ./internal/testrunner -run '^TestLocal$/^packageDeduplicationDuplicateGlobals\\.ts$'
  • GOTOOLCHAIN=auto go test ./...

@thromel
Tanzim Hossain Romel (thromel) marked this pull request as ready for review April 1, 2026 19:04
@thromel Tanzim Hossain Romel (thromel) changed the title [codex] Fix declaration emit alias reuse for inferred exports Fix declaration emit alias reuse for inferred exports Apr 1, 2026
@thromel
Tanzim Hossain Romel (thromel) marked this pull request as draft April 1, 2026 19:22
Comment thread internal/checker/nodebuilderimpl.go Outdated
@thromel
Tanzim Hossain Romel (thromel) marked this pull request as ready for review April 2, 2026 08:28
@jakebailey

Copy link
Copy Markdown
Member

Not sure if you have properly cloned the submodule or not, as you are missing other baseline updates that should have happened.

@thromel

Copy link
Copy Markdown
Author

I checked that, and you were right.

My local clone had the TypeScript submodule registered but not actually initialized, so I was missing additional baseline updates that only show up once the submodule-backed tests are running against the recorded TS checkout.

I initialized the submodule, ran npm ci so the Node-based baseline tests could execute, reran the suite, and accepted the missing baseline updates. With that in place, GOTOOLCHAIN=auto go test ./... now passes in this workspace.

@thromel

Copy link
Copy Markdown
Author

CI is still blocked only on test (race mode), which remains queued on the self-hosted 1ES pool with no runner assigned.

I tried to retrigger it from my side:

  • rerun just the queued job: job 69928875982 cannot be rerun
  • rerun/cancel the workflow: Must have admin rights to Repository

So I do not have permission to unstick it from this fork account. If someone with the right repo permissions can rerun the workflow or inspect the TypeScript-1ES-GitHub-XL runner pool, that should be the remaining step.

@jakebailey

Copy link
Copy Markdown
Member

It's a known problem and will unblock itself eventually (otherwise I'll figure it out next week)

@jakebailey
Jake Bailey (jakebailey) added this pull request to the merge queue Apr 4, 2026
Merged via the queue into microsoft:main with commit c0703e6 Apr 4, 2026
37 of 39 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants