Skip to content

Commit 2b8ccf4

Browse files
authored
jsdoc template tags might be unmatched (microsoft#32936)
* jsdoc template tags might be unmatched * Update fourslash test
1 parent 1b46d8f commit 2b8ccf4

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/compiler/utilities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2343,7 +2343,7 @@ namespace ts {
23432343
export function getTypeParameterFromJsDoc(node: TypeParameterDeclaration & { parent: JSDocTemplateTag }): TypeParameterDeclaration | undefined {
23442344
const name = node.name.escapedText;
23452345
const { typeParameters } = (node.parent.parent.parent as SignatureDeclaration | InterfaceDeclaration | ClassDeclaration);
2346-
return find(typeParameters!, p => p.name.escapedText === name);
2346+
return typeParameters && find(typeParameters, p => p.name.escapedText === name);
23472347
}
23482348

23492349
export function hasRestParameter(s: SignatureDeclaration | JSDocSignature): boolean {
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
///<reference path="fourslash.ts" />
2+
//// /**
3+
//// * @template {string} K/**/ a golden opportunity
4+
//// */
5+
//// function Multimap(iv) {
6+
//// };
7+
8+
9+
goTo.marker('');
10+
verify.quickInfoIs("any");

0 commit comments

Comments
 (0)