Out of bounds tuple elements have type 'undefined'

This commit is contained in:
Anders Hejlsberg 2019-06-21 18:00:26 -10:00
parent 2c458c0d1c
commit 7cdc65b2a5

View file

@ -14440,7 +14440,7 @@ namespace ts {
if (propType) { if (propType) {
return propType; return propType;
} }
if (everyType(type, isTupleType) && !everyType(type, t => !(<TupleTypeReference>t).target.hasRestElement)) { if (everyType(type, isTupleType)) {
return mapType(type, t => getRestTypeOfTupleType(<TupleTypeReference>t) || undefinedType); return mapType(type, t => getRestTypeOfTupleType(<TupleTypeReference>t) || undefinedType);
} }
return undefined; return undefined;