Propagate ObjectFlags.NonInferrableType through widening

This commit is contained in:
Anders Hejlsberg 2019-04-16 09:46:45 -07:00
parent 3902ef78ae
commit 6ac0dbcaef

View File

@ -14231,7 +14231,7 @@ namespace ts {
const result = createAnonymousType(type.symbol, members, emptyArray, emptyArray,
stringIndexInfo && createIndexInfo(getWidenedType(stringIndexInfo.type), stringIndexInfo.isReadonly),
numberIndexInfo && createIndexInfo(getWidenedType(numberIndexInfo.type), numberIndexInfo.isReadonly));
result.objectFlags |= (getObjectFlags(type) & ObjectFlags.JSLiteral); // Retain js literal flag through widening
result.objectFlags |= (getObjectFlags(type) & (ObjectFlags.JSLiteral | ObjectFlags.NonInferrableType)); // Retain js literal flag through widening
return result;
}