Skip to content

Commit

Permalink
Fix bounds check
Browse files Browse the repository at this point in the history
  • Loading branch information
ahejlsberg committed Sep 15, 2022
1 parent 28232ca commit 23a1dd4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36043,8 +36043,8 @@ namespace ts {
}

function getEffectiveTypeArgumentAtIndex(node: TypeReferenceNode | ExpressionWithTypeArguments, typeParameters: readonly TypeParameter[], index: number): Type {
if (index < typeParameters.length) {
return getTypeFromTypeNode(node.typeArguments![index]);
if (node.typeArguments && index < node.typeArguments.length) {
return getTypeFromTypeNode(node.typeArguments[index]);
}
return getEffectiveTypeArguments(node, typeParameters)[index];
}
Expand Down

0 comments on commit 23a1dd4

Please sign in to comment.