Skip to content

Commit 79f53bd

Browse files
committed
Use hasTypeArguments in getTypeArgumentConstraint
1 parent 27890ac commit 79f53bd

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/compiler/checker.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@ import {
421421
hasSyntacticModifier,
422422
hasSyntacticModifiers,
423423
hasType,
424+
hasTypeArguments,
424425
HeritageClause,
425426
hostGetCanonicalFileName,
426427
Identifier,
@@ -42706,10 +42707,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
4270642707

4270742708
function getTypeArgumentConstraint(node: TypeNode): Type | undefined {
4270842709
let typeArgumentPosition;
42709-
if (
42710-
"typeArguments" in node.parent && // eslint-disable-line local/no-in-operator
42711-
Array.isArray(node.parent.typeArguments)
42712-
) {
42710+
if (hasTypeArguments(node.parent) && Array.isArray(node.parent.typeArguments)) {
4271342711
typeArgumentPosition = node.parent.typeArguments.indexOf(node);
4271442712
}
4271542713

0 commit comments

Comments
 (0)