Merge pull request #27849 from Microsoft/unionWithIndexedLiteral

Use string/number signature to get contextual type
This commit is contained in:
Sheetal Nandi
2018-10-11 17:50:16 -07:00
committed by GitHub
13 changed files with 76 additions and 106 deletions

View File

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