@@ -1154,11 +1154,7 @@ namespace ts {
11541154 }
11551155
11561156 // This function is only for imports with entity names
1157- function getSymbolOfPartOfRightHandSideOfImportEquals(entityName: EntityName, importDeclaration?: ImportEqualsDeclaration): Symbol {
1158- if (!importDeclaration) {
1159- importDeclaration = <ImportEqualsDeclaration>getAncestor(entityName, SyntaxKind.ImportEqualsDeclaration);
1160- Debug.assert(importDeclaration !== undefined);
1161- }
1157+ function getSymbolOfPartOfRightHandSideOfImportEquals(entityName: EntityName, importDeclaration: ImportEqualsDeclaration, dontResolveAlias?: boolean): Symbol {
11621158 // There are three things we might try to look for. In the following examples,
11631159 // the search term is enclosed in |...|:
11641160 //
@@ -1170,13 +1166,13 @@ namespace ts {
11701166 }
11711167 // Check for case 1 and 3 in the above example
11721168 if (entityName.kind === SyntaxKind.Identifier || entityName.parent.kind === SyntaxKind.QualifiedName) {
1173- return resolveEntityName(entityName, SymbolFlags.Namespace);
1169+ return resolveEntityName(entityName, SymbolFlags.Namespace, /*ignoreErrors*/ false, dontResolveAlias );
11741170 }
11751171 else {
11761172 // Case 2 in above example
11771173 // entityName.kind could be a QualifiedName or a Missing identifier
11781174 Debug.assert(entityName.parent.kind === SyntaxKind.ImportEqualsDeclaration);
1179- return resolveEntityName(entityName, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace);
1175+ return resolveEntityName(entityName, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace, /*ignoreErrors*/ false, dontResolveAlias );
11801176 }
11811177 }
11821178
@@ -1185,7 +1181,7 @@ namespace ts {
11851181 }
11861182
11871183 // Resolves a qualified name and any involved aliases
1188- function resolveEntityName(name: EntityName | Expression, meaning: SymbolFlags, ignoreErrors?: boolean): Symbol {
1184+ function resolveEntityName(name: EntityName | Expression, meaning: SymbolFlags, ignoreErrors?: boolean, dontResolveAlias?: boolean ): Symbol {
11891185 if (nodeIsMissing(name)) {
11901186 return undefined;
11911187 }
@@ -1219,7 +1215,7 @@ namespace ts {
12191215 Debug.fail("Unknown entity name kind.");
12201216 }
12211217 Debug.assert((symbol.flags & SymbolFlags.Instantiated) === 0, "Should never get an instantiated symbol here.");
1222- return symbol.flags & meaning ? symbol : resolveAlias(symbol);
1218+ return ( symbol.flags & meaning) || dontResolveAlias ? symbol : resolveAlias(symbol);
12231219 }
12241220
12251221 function resolveExternalModuleName(location: Node, moduleReferenceExpression: Expression): Symbol {
@@ -16441,7 +16437,9 @@ namespace ts {
1644116437 if (entityName.kind !== SyntaxKind.PropertyAccessExpression) {
1644216438 if (isInRightSideOfImportOrExportAssignment(<EntityName>entityName)) {
1644316439 // Since we already checked for ExportAssignment, this really could only be an Import
16444- return getSymbolOfPartOfRightHandSideOfImportEquals(<EntityName>entityName);
16440+ const importEqualsDeclaration = <ImportEqualsDeclaration>getAncestor(entityName, SyntaxKind.ImportEqualsDeclaration);
16441+ Debug.assert(importEqualsDeclaration !== undefined);
16442+ return getSymbolOfPartOfRightHandSideOfImportEquals(<EntityName>entityName, importEqualsDeclaration, /*dontResolveAlias*/ true);
1644516443 }
1644616444 }
1644716445
@@ -16531,9 +16529,7 @@ namespace ts {
1653116529
1653216530 if (node.kind === SyntaxKind.Identifier) {
1653316531 if (isInRightSideOfImportOrExportAssignment(<Identifier>node)) {
16534- return node.parent.kind === SyntaxKind.ExportAssignment
16535- ? getSymbolOfEntityNameOrPropertyAccessExpression(<Identifier>node)
16536- : getSymbolOfPartOfRightHandSideOfImportEquals(<Identifier>node);
16532+ return getSymbolOfEntityNameOrPropertyAccessExpression(<Identifier>node);
1653716533 }
1653816534 else if (node.parent.kind === SyntaxKind.BindingElement &&
1653916535 node.parent.parent.kind === SyntaxKind.ObjectBindingPattern &&
0 commit comments