@@ -1180,11 +1180,7 @@ namespace ts {
11801180 }
11811181
11821182 // This function is only for imports with entity names
1183- function getSymbolOfPartOfRightHandSideOfImportEquals(entityName: EntityName, importDeclaration?: ImportEqualsDeclaration): Symbol {
1184- if (!importDeclaration) {
1185- importDeclaration = <ImportEqualsDeclaration>getAncestor(entityName, SyntaxKind.ImportEqualsDeclaration);
1186- Debug.assert(importDeclaration !== undefined);
1187- }
1183+ function getSymbolOfPartOfRightHandSideOfImportEquals(entityName: EntityName, importDeclaration: ImportEqualsDeclaration, dontResolveAlias?: boolean): Symbol {
11881184 // There are three things we might try to look for. In the following examples,
11891185 // the search term is enclosed in |...|:
11901186 //
@@ -1196,13 +1192,13 @@ namespace ts {
11961192 }
11971193 // Check for case 1 and 3 in the above example
11981194 if (entityName.kind === SyntaxKind.Identifier || entityName.parent.kind === SyntaxKind.QualifiedName) {
1199- return resolveEntityName(entityName, SymbolFlags.Namespace);
1195+ return resolveEntityName(entityName, SymbolFlags.Namespace, /*ignoreErrors*/ false, dontResolveAlias );
12001196 }
12011197 else {
12021198 // Case 2 in above example
12031199 // entityName.kind could be a QualifiedName or a Missing identifier
12041200 Debug.assert(entityName.parent.kind === SyntaxKind.ImportEqualsDeclaration);
1205- return resolveEntityName(entityName, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace);
1201+ return resolveEntityName(entityName, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace, /*ignoreErrors*/ false, dontResolveAlias );
12061202 }
12071203 }
12081204
@@ -1211,7 +1207,7 @@ namespace ts {
12111207 }
12121208
12131209 // Resolves a qualified name and any involved aliases
1214- function resolveEntityName(name: EntityName | Expression, meaning: SymbolFlags, ignoreErrors?: boolean): Symbol {
1210+ function resolveEntityName(name: EntityName | Expression, meaning: SymbolFlags, ignoreErrors?: boolean, dontResolveAlias?: boolean ): Symbol {
12151211 if (nodeIsMissing(name)) {
12161212 return undefined;
12171213 }
@@ -1245,7 +1241,7 @@ namespace ts {
12451241 Debug.fail("Unknown entity name kind.");
12461242 }
12471243 Debug.assert((symbol.flags & SymbolFlags.Instantiated) === 0, "Should never get an instantiated symbol here.");
1248- return symbol.flags & meaning ? symbol : resolveAlias(symbol);
1244+ return ( symbol.flags & meaning) || dontResolveAlias ? symbol : resolveAlias(symbol);
12491245 }
12501246
12511247 function resolveExternalModuleName(location: Node, moduleReferenceExpression: Expression): Symbol {
@@ -16803,7 +16799,9 @@ namespace ts {
1680316799 if (entityName.kind !== SyntaxKind.PropertyAccessExpression) {
1680416800 if (isInRightSideOfImportOrExportAssignment(<EntityName>entityName)) {
1680516801 // Since we already checked for ExportAssignment, this really could only be an Import
16806- return getSymbolOfPartOfRightHandSideOfImportEquals(<EntityName>entityName);
16802+ const importEqualsDeclaration = <ImportEqualsDeclaration>getAncestor(entityName, SyntaxKind.ImportEqualsDeclaration);
16803+ Debug.assert(importEqualsDeclaration !== undefined);
16804+ return getSymbolOfPartOfRightHandSideOfImportEquals(<EntityName>entityName, importEqualsDeclaration, /*dontResolveAlias*/ true);
1680716805 }
1680816806 }
1680916807
@@ -16899,9 +16897,7 @@ namespace ts {
1689916897
1690016898 if (node.kind === SyntaxKind.Identifier) {
1690116899 if (isInRightSideOfImportOrExportAssignment(<Identifier>node)) {
16902- return node.parent.kind === SyntaxKind.ExportAssignment
16903- ? getSymbolOfEntityNameOrPropertyAccessExpression(<Identifier>node)
16904- : getSymbolOfPartOfRightHandSideOfImportEquals(<Identifier>node);
16900+ return getSymbolOfEntityNameOrPropertyAccessExpression(<Identifier>node);
1690516901 }
1690616902 else if (node.parent.kind === SyntaxKind.BindingElement &&
1690716903 node.parent.parent.kind === SyntaxKind.ObjectBindingPattern &&
0 commit comments