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 {
1553115531
1553215532 function getTypeOfPropertyOfContextualType(type: Type, name: __String) {
1553315533 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;
1553615547 }, /*noReductions*/ true);
1553715548 }
1553815549
You can’t perform that action at this time.
0 commit comments