Use string/number signature to get contextual type

Fixes #26587
This commit is contained in:
Sheetal Nandi
2018-10-10 14:51:17 -07:00
parent 4d504f9b30
commit c0729a22fd
13 changed files with 76 additions and 106 deletions

View File

@@ -16708,6 +16708,8 @@ namespace ts {
return restType;
}
}
return isNumericLiteralName(name) && getIndexTypeOfContextualType(type, IndexKind.Number) ||
getIndexTypeOfContextualType(type, IndexKind.String);
}
return undefined;
}, /*noReductions*/ true);