mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 10:40:34 -05:00
Fix getSignatureOfTypeTag (#37473)
Prevents infinite looping as in #37265. Fixes #37265
This commit is contained in:
@@ -10701,7 +10701,9 @@ namespace ts {
|
||||
}
|
||||
|
||||
function getSignatureOfTypeTag(node: SignatureDeclaration | JSDocSignature) {
|
||||
const typeTag = isInJSFile(node) ? getJSDocTypeTag(node) : undefined;
|
||||
// should be attached to a function declaration or expression
|
||||
if (!(isInJSFile(node) && isFunctionLikeDeclaration(node))) return undefined;
|
||||
const typeTag = getJSDocTypeTag(node);
|
||||
const signature = typeTag && typeTag.typeExpression && getSingleCallSignature(getTypeFromTypeNode(typeTag.typeExpression));
|
||||
return signature && getErasedSignature(signature);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user