mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
* Fix logic for methods in isTypeParameterPossiblyReferenced * Add regression tests Co-authored-by: Anders Hejlsberg <andersh@microsoft.com>
This commit is contained in:
co-authored by
Anders Hejlsberg
parent
28e3e6ff2f
commit
e425f573aa
@@ -15941,8 +15941,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
function maybeTypeParameterReference(node: Node) {
|
||||
return !(node.kind === SyntaxKind.QualifiedName ||
|
||||
node.parent.kind === SyntaxKind.TypeReference && (<TypeReferenceNode>node.parent).typeArguments && node === (<TypeReferenceNode>node.parent).typeName ||
|
||||
return !(node.parent.kind === SyntaxKind.TypeReference && (node.parent as TypeReferenceNode).typeArguments && node === (node.parent as TypeReferenceNode).typeName ||
|
||||
node.parent.kind === SyntaxKind.ImportType && (node.parent as ImportTypeNode).typeArguments && node === (node.parent as ImportTypeNode).qualifier);
|
||||
}
|
||||
|
||||
@@ -15971,7 +15970,10 @@ namespace ts {
|
||||
return true;
|
||||
case SyntaxKind.MethodDeclaration:
|
||||
case SyntaxKind.MethodSignature:
|
||||
return (!(node as FunctionLikeDeclaration).type && !!(node as FunctionLikeDeclaration).body) || !!forEachChild(node, containsReference);
|
||||
return !(node as FunctionLikeDeclaration).type && !!(node as FunctionLikeDeclaration).body ||
|
||||
some((node as FunctionLikeDeclaration).typeParameters, containsReference) ||
|
||||
some((node as FunctionLikeDeclaration).parameters, containsReference) ||
|
||||
!!(node as FunctionLikeDeclaration).type && containsReference((node as FunctionLikeDeclaration).type!);
|
||||
}
|
||||
return !!forEachChild(node, containsReference);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user