File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -15531,8 +15531,19 @@ namespace ts {
15531
15531
15532
15532
function getTypeOfPropertyOfContextualType(type: Type, name: __String) {
15533
15533
return mapType(type, t => {
15534
- const prop = t.flags & TypeFlags.StructuredType ? getPropertyOfType(t, name) : undefined;
15535
- return prop ? getTypeOfSymbol(prop) : undefined;
15534
+ if (t.flags & TypeFlags.StructuredType) {
15535
+ const prop = getPropertyOfType(t, name);
15536
+ if (prop) {
15537
+ return getTypeOfSymbol(prop);
15538
+ }
15539
+ if (isTupleType(t)) {
15540
+ const restType = getRestTypeOfTupleType(t);
15541
+ if (restType && isNumericLiteralName(name) && +name >= 0) {
15542
+ return restType;
15543
+ }
15544
+ }
15545
+ }
15546
+ return undefined;
15536
15547
}, /*noReductions*/ true);
15537
15548
}
15538
15549
You can’t perform that action at this time.
0 commit comments