Fix export= class visibility alongside top-level export type - #64573
Merged
Wesley Wigham (weswigham) merged 3 commits intoOct 1, 2026
Merged
Wesley Wigham (weswigham) merged 3 commits into
Wesley Wigham (weswigham) merged 3 commits into
Conversation
Wesley Wigham (weswigham)
requested review from
Gabriela Araujo Britto (gabritto) and
Jake Bailey (jakebailey)
October 1, 2026 17:25
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The implementation unwraps only one additional merged alias, leaving longer valid alias chains inaccessible.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
This PR updates symbol accessibility to support export = classes merged with top-level type exports, addressing TS4094.
Changes:
- Resolves an additional alias during accessibility checks.
- Adds declaration-emit regression tests across three module modes.
- Updates affected symbol and type baselines.
| File | Description |
|---|---|
tsc/internal/checker/symbolaccessibility.go |
Extends alias comparison. |
tsc/testdata/tests/cases/compiler/declarationEmitDefaultImportPrivateClass.ts |
Tests default-import visibility. |
tsc/testdata/tests/cases/compiler/declarationEmitExportAssignmentWithTypeExports.ts |
Tests export-assignment import forms. |
tsc/testdata/tests/cases/compiler/declarationEmitMergedExportAlias.ts |
Tests merged re-export aliases. |
tsc/testdata/baselines/reference/compiler/cjsExportGenericTypes.types |
Updates inferred alias names. |
tsc/testdata/baselines/reference/compiler/exportAssignmentMerging2.symbols |
Updates symbol names. |
tsc/testdata/baselines/reference/compiler/exportAssignmentMerging2.types |
Updates type names. |
tsc/testdata/baselines/reference/compiler/exportAssignmentMerging3.symbols |
Updates symbol names. |
tsc/testdata/baselines/reference/compiler/exportAssignmentMerging3.types |
Updates type names. |
tsc/testdata/baselines/reference/compiler/noCrashOnImportShadowing.types |
Updates inferred aliases. |
tsc/testdata/baselines/reference/conformance/exportTypeMergedWithExportStarAsNamespace.symbols |
Updates merged symbols. |
tsc/testdata/baselines/reference/conformance/exportTypeMergedWithExportStarAsNamespace.types |
Updates merged types. |
tsc/testdata/baselines/reference/conformance/importElisionConstEnumMerge1.types |
Updates enum alias types. |
tsc/testdata/baselines/reference/conformance/typeAndNamespaceExportMerge.symbols |
Updates merged symbols. |
tsc/testdata/baselines/reference/conformance/typeAndNamespaceExportMerge.types |
Updates merged types. |
tsc/testdata/baselines/reference/compiler/declarationEmitDefaultImportPrivateClass(module=commonjs).js |
Adds CommonJS emit baseline. |
…(module=commonjs).symbols |
Adds CommonJS symbol baseline. |
…(module=commonjs).types |
Adds CommonJS type baseline. |
…(module=nodenext).js |
Adds NodeNext emit baseline. |
…(module=nodenext).symbols |
Adds NodeNext symbol baseline. |
…(module=nodenext).types |
Adds NodeNext type baseline. |
…(module=preserve).js |
Adds preserve emit baseline. |
…(module=preserve).symbols |
Adds preserve symbol baseline. |
…(module=preserve).types |
Adds preserve type baseline. |
tsc/testdata/baselines/reference/compiler/declarationEmitExportAssignmentWithTypeExports(module=commonjs).js |
Adds CommonJS emit baseline. |
…(module=commonjs).symbols |
Adds CommonJS symbol baseline. |
…(module=commonjs).types |
Adds CommonJS type baseline. |
…(module=nodenext).js |
Adds NodeNext emit baseline. |
…(module=nodenext).symbols |
Adds NodeNext symbol baseline. |
…(module=nodenext).types |
Adds NodeNext type baseline. |
…(module=preserve).js |
Adds preserve emit baseline. |
…(module=preserve).symbols |
Adds preserve symbol baseline. |
…(module=preserve).types |
Adds preserve type baseline. |
tsc/testdata/baselines/reference/compiler/declarationEmitMergedExportAlias(module=commonjs).js |
Adds CommonJS emit baseline. |
…(module=commonjs).symbols |
Adds CommonJS symbol baseline. |
…(module=commonjs).types |
Adds CommonJS type baseline. |
…(module=nodenext).js |
Adds NodeNext emit baseline. |
…(module=nodenext).symbols |
Adds NodeNext symbol baseline. |
…(module=nodenext).types |
Adds NodeNext type baseline. |
…(module=preserve).js |
Adds preserve emit baseline. |
…(module=preserve).symbols |
Adds preserve symbol baseline. |
…(module=preserve).types |
Adds preserve type baseline. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Jake Bailey (jakebailey)
approved these changes
Oct 1, 2026
Wesley Wigham (weswigham)
enabled auto-merge
October 1, 2026 19:38
Jake Bailey (jakebailey)
approved these changes
Oct 1, 2026
Jake Bailey (jakebailey)
left a comment
Member
There was a problem hiding this comment.
There's actually an AddIfPresent func for these that would work but it's equivalent enough
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.

By doing some recursive alias resolution comparison, to handle our now non-terminal aliases.
Fixes #64249
I don't think this is actually a regression, since the declaration file in question was actually an error prior to TS7 and it was just being suppressed by
skipLibCheckso it sorta-kinda worked. But! It's supported first-class now (export=merging with top levelexport type, anyway), so it does actually need fixing.