Skip to content

Commit cf010b5

Browse files
committed
Use differing type aliases, per request
1 parent b341699 commit cf010b5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/compiler/checker.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -2802,7 +2802,7 @@ namespace ts {
28022802
}
28032803
}
28042804

2805-
function getTargetofModuleDefault(moduleSymbol: Symbol, node: TypeOnlyCompatibleAliasDeclaration, dontResolveAlias: boolean) {
2805+
function getTargetofModuleDefault(moduleSymbol: Symbol, node: ImportClause | ImportOrExportSpecifier, dontResolveAlias: boolean) {
28062806
let exportDefaultSymbol: Symbol | undefined;
28072807
if (isShorthandAmbientModuleSymbol(moduleSymbol)) {
28082808
exportDefaultSymbol = moduleSymbol;
@@ -2812,7 +2812,7 @@ namespace ts {
28122812
}
28132813

28142814
const file = moduleSymbol.declarations?.find(isSourceFile);
2815-
const specifier = getModuleSpecifierForTypeOnlyCompatibleAliasDeclaration(node);
2815+
const specifier = getModuleSpecifierForImportOrExport(node);
28162816
if (!specifier) {
28172817
return exportDefaultSymbol;
28182818
}
@@ -2850,7 +2850,7 @@ namespace ts {
28502850
return exportDefaultSymbol;
28512851
}
28522852

2853-
function getModuleSpecifierForTypeOnlyCompatibleAliasDeclaration(node: TypeOnlyCompatibleAliasDeclaration): Expression | undefined {
2853+
function getModuleSpecifierForImportOrExport(node: ImportEqualsDeclaration | ImportClause | NamespaceImport | ImportOrExportSpecifier): Expression | undefined {
28542854
switch (node.kind) {
28552855
case SyntaxKind.ImportClause: return node.parent.moduleSpecifier;
28562856
case SyntaxKind.ImportEqualsDeclaration: return isExternalModuleReference(node.moduleReference) ? node.moduleReference.expression : undefined;
@@ -3073,7 +3073,7 @@ namespace ts {
30733073

30743074
function getTargetOfImportSpecifier(node: ImportSpecifier | BindingElement, dontResolveAlias: boolean): Symbol | undefined {
30753075
if (isImportSpecifier(node) && idText(node.propertyName || node.name) === InternalSymbolName.Default) {
3076-
const specifier = getModuleSpecifierForTypeOnlyCompatibleAliasDeclaration(node);
3076+
const specifier = getModuleSpecifierForImportOrExport(node);
30773077
const moduleSymbol = specifier && resolveExternalModuleName(node, specifier);
30783078
if (moduleSymbol) {
30793079
return getTargetofModuleDefault(moduleSymbol, node, dontResolveAlias);
@@ -3104,7 +3104,7 @@ namespace ts {
31043104

31053105
function getTargetOfExportSpecifier(node: ExportSpecifier, meaning: SymbolFlags, dontResolveAlias?: boolean) {
31063106
if (idText(node.propertyName || node.name) === InternalSymbolName.Default) {
3107-
const specifier = getModuleSpecifierForTypeOnlyCompatibleAliasDeclaration(node);
3107+
const specifier = getModuleSpecifierForImportOrExport(node);
31083108
const moduleSymbol = specifier && resolveExternalModuleName(node, specifier);
31093109
if (moduleSymbol) {
31103110
return getTargetofModuleDefault(moduleSymbol, node, !!dontResolveAlias);

0 commit comments

Comments
 (0)