Merge pull request #41331 from microsoft/fix39149

Fix double alias of complex export/import/default/namespace combination
This commit is contained in:
Ron Buckton
2020-10-30 09:25:58 -07:00
committed by GitHub
5 changed files with 133 additions and 4 deletions

View File

@@ -2497,10 +2497,7 @@ namespace ts {
function resolveExportByName(moduleSymbol: Symbol, name: __String, sourceNode: TypeOnlyCompatibleAliasDeclaration | undefined, dontResolveAlias: boolean) {
const exportValue = moduleSymbol.exports!.get(InternalSymbolName.ExportEquals);
if (exportValue) {
return getPropertyOfType(getTypeOfSymbol(exportValue), name);
}
const exportSymbol = moduleSymbol.exports!.get(name);
const exportSymbol = exportValue ? getPropertyOfType(getTypeOfSymbol(exportValue), name) : moduleSymbol.exports!.get(name);
const resolved = resolveSymbol(exportSymbol, dontResolveAlias);
markSymbolOfAliasDeclarationIfTypeOnly(sourceNode, exportSymbol, resolved, /*overwriteEmpty*/ false);
return resolved;