We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cea4838 commit 9b526a0Copy full SHA for 9b526a0
1 file changed
src/compiler/checker.ts
@@ -3397,7 +3397,7 @@ namespace ts {
3397
const arity = getTypeReferenceArity(type);
3398
const tupleConstituentNodes = mapToTypeNodes(typeArguments.slice(0, arity), context);
3399
const hasRestElement = (<TupleType>type.target).hasRestElement;
3400
- if (tupleConstituentNodes && tupleConstituentNodes.length > 0) {
+ if (tupleConstituentNodes && tupleConstituentNodes.length >= arity) {
3401
for (let i = (<TupleType>type.target).minLength; i < arity; i++) {
3402
tupleConstituentNodes[i] = hasRestElement && i === arity - 1 ?
3403
createRestTypeNode(createArrayTypeNode(tupleConstituentNodes[i])) :
0 commit comments