Skip to content

Commit eb702ea

Browse files
committed
Make hasTypeArguments do what it says on the tin
1 parent bf0be61 commit eb702ea

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20981,7 +20981,7 @@ namespace ts {
2098120981
if (isJsxOpeningLikeElement(callTarget) && argIndex === 0) {
2098220982
return getEffectiveFirstArgumentForJsxSignature(signature, callTarget);
2098320983
}
20984-
if (contextFlags && contextFlags & ContextFlags.BaseConstraint && signature.target && !tryCast(callTarget, hasTypeArguments)?.typeArguments) {
20984+
if (contextFlags && contextFlags & ContextFlags.BaseConstraint && signature.target && !hasTypeArguments(callTarget)) {
2098520985
const baseSignature = getBaseSignature(signature.target);
2098620986
return getTypeAtPosition(baseSignature, argIndex);
2098720987
}

src/compiler/utilities.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7297,11 +7297,7 @@ namespace ts {
72977297

72987298
/** @internal */
72997299
export function hasTypeArguments(node: Node): node is HasTypeArguments {
7300-
return node.kind === SyntaxKind.CallExpression
7301-
|| node.kind === SyntaxKind.NewExpression
7302-
|| node.kind === SyntaxKind.TaggedTemplateExpression
7303-
|| node.kind === SyntaxKind.JsxOpeningElement
7304-
|| node.kind === SyntaxKind.JsxSelfClosingElement;
7300+
return !!(node as HasTypeArguments).typeArguments;
73057301
}
73067302

73077303
/** True if has initializer node attached to it. */

0 commit comments

Comments
 (0)