Skip to content

Commit a7e2659

Browse files
committed
Fix logic for methods in isTypeParameterPossiblyReferenced
1 parent 5fde871 commit a7e2659

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/compiler/checker.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16023,8 +16023,7 @@ namespace ts {
1602316023
}
1602416024

1602516025
function maybeTypeParameterReference(node: Node) {
16026-
return !(node.kind === SyntaxKind.QualifiedName ||
16027-
node.parent.kind === SyntaxKind.TypeReference && (node.parent as TypeReferenceNode).typeArguments && node === (node.parent as TypeReferenceNode).typeName ||
16026+
return !(node.parent.kind === SyntaxKind.TypeReference && (node.parent as TypeReferenceNode).typeArguments && node === (node.parent as TypeReferenceNode).typeName ||
1602816027
node.parent.kind === SyntaxKind.ImportType && (node.parent as ImportTypeNode).typeArguments && node === (node.parent as ImportTypeNode).qualifier);
1602916028
}
1603016029

@@ -16053,7 +16052,10 @@ namespace ts {
1605316052
return true;
1605416053
case SyntaxKind.MethodDeclaration:
1605516054
case SyntaxKind.MethodSignature:
16056-
return (!(node as FunctionLikeDeclaration).type && !!(node as FunctionLikeDeclaration).body) || !!forEachChild(node, containsReference);
16055+
return !(node as FunctionLikeDeclaration).type && !!(node as FunctionLikeDeclaration).body ||
16056+
some((node as FunctionLikeDeclaration).typeParameters, containsReference) ||
16057+
some((node as FunctionLikeDeclaration).parameters, containsReference) ||
16058+
!!(node as FunctionLikeDeclaration).type && containsReference((node as FunctionLikeDeclaration).type!);
1605716059
}
1605816060
return !!forEachChild(node, containsReference);
1605916061
}

0 commit comments

Comments
 (0)