@@ -18354,7 +18354,6 @@ namespace ts {
18354
18354
let propertiesTable: SymbolTable;
18355
18355
let propertiesArray: Symbol[] = [];
18356
18356
let spread: Type = emptyObjectType;
18357
- let propagatedFlags: ObjectFlags = 0;
18358
18357
18359
18358
const contextualType = getApparentTypeOfContextualType(node);
18360
18359
const contextualTypeHasPattern = contextualType && contextualType.pattern &&
@@ -18364,7 +18363,7 @@ namespace ts {
18364
18363
const isInJavascript = isInJSFile(node) && !isInJsonFile(node);
18365
18364
const enumTag = getJSDocEnumTag(node);
18366
18365
const isJSObjectLiteral = !contextualType && isInJavascript && !enumTag;
18367
- let objectFlags: ObjectFlags = 0 ;
18366
+ let objectFlags: ObjectFlags = freshObjectLiteralFlag ;
18368
18367
let patternWithComputedProperties = false;
18369
18368
let hasComputedStringProperty = false;
18370
18369
let hasComputedNumberProperty = false;
@@ -18392,7 +18391,7 @@ namespace ts {
18392
18391
checkTypeAssignableTo(type, getTypeFromTypeNode(enumTag.typeExpression), memberDecl);
18393
18392
}
18394
18393
}
18395
- objectFlags |= getObjectFlags(type);
18394
+ objectFlags |= getObjectFlags(type) & ObjectFlags.PropagatingFlags ;
18396
18395
const nameType = computedNameType && isTypeUsableAsPropertyName(computedNameType) ? computedNameType : undefined;
18397
18396
const prop = nameType ?
18398
18397
createSymbol(SymbolFlags.Property | member.flags, getPropertyNameFromType(nameType), checkFlags | CheckFlags.Late) :
@@ -18440,19 +18439,18 @@ namespace ts {
18440
18439
checkExternalEmitHelpers(memberDecl, ExternalEmitHelpers.Assign);
18441
18440
}
18442
18441
if (propertiesArray.length > 0) {
18443
- spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags | ObjectFlags.FreshLiteral , inConstContext);
18442
+ spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, objectFlags , inConstContext);
18444
18443
propertiesArray = [];
18445
18444
propertiesTable = createSymbolTable();
18446
18445
hasComputedStringProperty = false;
18447
18446
hasComputedNumberProperty = false;
18448
- objectFlags = 0;
18449
18447
}
18450
18448
const type = checkExpression(memberDecl.expression);
18451
18449
if (!isValidSpreadType(type)) {
18452
18450
error(memberDecl, Diagnostics.Spread_types_may_only_be_created_from_object_types);
18453
18451
return errorType;
18454
18452
}
18455
- spread = getSpreadType(spread, type, node.symbol, propagatedFlags | ObjectFlags.FreshLiteral , inConstContext);
18453
+ spread = getSpreadType(spread, type, node.symbol, objectFlags , inConstContext);
18456
18454
offset = i + 1;
18457
18455
continue;
18458
18456
}
@@ -18502,7 +18500,7 @@ namespace ts {
18502
18500
18503
18501
if (spread !== emptyObjectType) {
18504
18502
if (propertiesArray.length > 0) {
18505
- spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags | ObjectFlags.FreshLiteral , inConstContext);
18503
+ spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, objectFlags , inConstContext);
18506
18504
}
18507
18505
return spread;
18508
18506
}
@@ -18513,7 +18511,7 @@ namespace ts {
18513
18511
const stringIndexInfo = hasComputedStringProperty ? getObjectLiteralIndexInfo(node, offset, propertiesArray, IndexKind.String) : undefined;
18514
18512
const numberIndexInfo = hasComputedNumberProperty ? getObjectLiteralIndexInfo(node, offset, propertiesArray, IndexKind.Number) : undefined;
18515
18513
const result = createAnonymousType(node.symbol, propertiesTable, emptyArray, emptyArray, stringIndexInfo, numberIndexInfo);
18516
- result.objectFlags |= ObjectFlags.ObjectLiteral | ObjectFlags.ContainsObjectLiteral | freshObjectLiteralFlag | objectFlags & ObjectFlags.PropagatingFlags ;
18514
+ result.objectFlags |= objectFlags | ObjectFlags.ObjectLiteral | ObjectFlags.ContainsObjectLiteral ;
18517
18515
if (isJSObjectLiteral) {
18518
18516
result.objectFlags |= ObjectFlags.JSLiteral;
18519
18517
}
@@ -18523,7 +18521,6 @@ namespace ts {
18523
18521
if (inDestructuringPattern) {
18524
18522
result.pattern = node;
18525
18523
}
18526
- propagatedFlags |= result.objectFlags & ObjectFlags.PropagatingFlags;
18527
18524
return result;
18528
18525
}
18529
18526
}
@@ -18710,7 +18707,7 @@ namespace ts {
18710
18707
function createJsxAttributesType() {
18711
18708
objectFlags |= freshObjectLiteralFlag;
18712
18709
const result = createAnonymousType(attributes.symbol, attributesTable, emptyArray, emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined);
18713
- result.objectFlags |= ObjectFlags.ObjectLiteral | ObjectFlags.ContainsObjectLiteral | objectFlags ;
18710
+ result.objectFlags |= objectFlags | ObjectFlags.ObjectLiteral | ObjectFlags.ContainsObjectLiteral;
18714
18711
return result;
18715
18712
}
18716
18713
}
0 commit comments