jsdoc template tags might be unmatched (#32936)

* jsdoc template tags might be unmatched

* Update fourslash test
This commit is contained in:
Nathan Shively-Sanders 2019-08-16 13:39:57 -07:00 committed by GitHub
parent 1b46d8fd8f
commit 2b8ccf40ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -2343,7 +2343,7 @@ namespace ts {
export function getTypeParameterFromJsDoc(node: TypeParameterDeclaration & { parent: JSDocTemplateTag }): TypeParameterDeclaration | undefined {
const name = node.name.escapedText;
const { typeParameters } = (node.parent.parent.parent as SignatureDeclaration | InterfaceDeclaration | ClassDeclaration);
return find(typeParameters!, p => p.name.escapedText === name);
return typeParameters && find(typeParameters, p => p.name.escapedText === name);
}
export function hasRestParameter(s: SignatureDeclaration | JSDocSignature): boolean {

View File

@ -0,0 +1,10 @@
///<reference path="fourslash.ts" />
//// /**
//// * @template {string} K/**/ a golden opportunity
//// */
//// function Multimap(iv) {
//// };
goTo.marker('');
verify.quickInfoIs("any");