Handle resolving and unknown symbols in getLiteralTypeFromPropertyName (#22406)

This commit is contained in:
Wesley Wigham
2018-03-08 13:35:55 -08:00
committed by GitHub
parent 17b10dc2a9
commit 87d88e2ba3
6 changed files with 96 additions and 1 deletions

View File

@@ -8026,7 +8026,7 @@ namespace ts {
function getLiteralTypeFromPropertyName(prop: Symbol) {
const links = getSymbolLinks(getLateBoundSymbol(prop));
if (!links.nameType) {
if (links.target) {
if (links.target && links.target !== unknownSymbol && links.target !== resolvingSymbol) {
Debug.assert(links.target.escapedName === prop.escapedName || links.target.escapedName === InternalSymbolName.Computed, "Target symbol and symbol do not have the same name");
links.nameType = getLiteralTypeFromPropertyName(links.target);
}