Fix recursive types in @typedef (#40861)

* Fix reference types in @typedef

Previously this code path was broken and untested. Fortunately the fix
is simple.

* add test case from #40234

* update baselines
This commit is contained in:
Nathan Shively-Sanders
2020-10-02 08:46:42 -07:00
committed by GitHub
parent 0ba250dc3b
commit b8ebad48d7
32 changed files with 358 additions and 150 deletions

View File

@@ -14398,7 +14398,7 @@ namespace ts {
function getAliasSymbolForTypeNode(node: Node) {
let host = node.parent;
while (isParenthesizedTypeNode(host) || isTypeOperatorNode(host) && host.operator === SyntaxKind.ReadonlyKeyword) {
while (isParenthesizedTypeNode(host) || isJSDocTypeExpression(host) || isTypeOperatorNode(host) && host.operator === SyntaxKind.ReadonlyKeyword) {
host = host.parent;
}
return isTypeAlias(host) ? getSymbolOfNode(host) : undefined;