Fix import type resolution in jsdoc, mark 2 (#35057)

Fake alias resolution only applies when the import type is followed by a
qualified name. Otherwise the alias is sufficiently resolved already.
This commit is contained in:
Nathan Shively-Sanders
2019-11-12 12:59:51 -08:00
parent 93b1aa3e0b
commit dfe2f07f88
7 changed files with 103 additions and 1 deletions
+2 -1
View File
@@ -10818,7 +10818,8 @@ namespace ts {
isRequireAlias = isCallExpression(expr) && isRequireCall(expr, /*requireStringLiteralLikeArgument*/ true) && !!valueType.symbol;
}
const isDelayedMergeClass = symbol !== valueType.symbol && getMergedSymbol(symbol) === valueType.symbol;
if (isRequireAlias || node.kind === SyntaxKind.ImportType || isDelayedMergeClass) {
const isImportTypeWithQualifier = node.kind === SyntaxKind.ImportType && (node as ImportTypeNode).qualifier;
if (isRequireAlias || isImportTypeWithQualifier || isDelayedMergeClass) {
typeType = getTypeReferenceType(node, valueType.symbol);
}
}