File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -3470,8 +3470,8 @@ namespace ts {
3470
3470
const arity = getTypeReferenceArity(type);
3471
3471
const tupleConstituentNodes = mapToTypeNodes(typeArguments.slice(0, arity), context);
3472
3472
const hasRestElement = (<TupleType>type.target).hasRestElement;
3473
- if (tupleConstituentNodes && tupleConstituentNodes.length > 0 ) {
3474
- for (let i = (<TupleType>type.target).minLength; i < arity; i++) {
3473
+ if (tupleConstituentNodes) {
3474
+ for (let i = (<TupleType>type.target).minLength; i < Math.min( arity, tupleConstituentNodes.length) ; i++) {
3475
3475
tupleConstituentNodes[i] = hasRestElement && i === arity - 1 ?
3476
3476
createRestTypeNode(createArrayTypeNode(tupleConstituentNodes[i])) :
3477
3477
createOptionalTypeNode(tupleConstituentNodes[i]);
You can’t perform that action at this time.
0 commit comments