Merge pull request #30963 from Microsoft/fixObjectFlagsPropagation

Fix object flags propagation
This commit is contained in:
Anders Hejlsberg
2019-04-16 07:25:41 -10:00
committed by GitHub
5 changed files with 135 additions and 1 deletions

View File

@@ -14271,7 +14271,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;
}