@@ -3222,7 +3222,7 @@ namespace ts {
3222
3222
result.pattern = pattern;
3223
3223
}
3224
3224
if (hasComputedProperties) {
3225
- result.isObjectLiteralPatternWithComputedProperties = true ;
3225
+ result.objectFlags |= ObjectFlags.ObjectLiteralPatternWithComputedProperties ;
3226
3226
}
3227
3227
return result;
3228
3228
}
@@ -6734,8 +6734,7 @@ namespace ts {
6734
6734
}
6735
6735
6736
6736
function hasExcessProperties(source: FreshObjectLiteralType, target: Type, reportErrors: boolean): boolean {
6737
- if (maybeTypeOfKind(target, TypeFlags.ObjectType) &&
6738
- (!(target.flags & TypeFlags.ObjectType) || !(target as ObjectType).isObjectLiteralPatternWithComputedProperties)) {
6737
+ if (maybeTypeOfKind(target, TypeFlags.ObjectType) && !(getObjectFlags(target) & ObjectFlags.ObjectLiteralPatternWithComputedProperties)) {
6739
6738
for (const prop of getPropertiesOfObjectType(source)) {
6740
6739
if (!isKnownProperty(target, prop.name)) {
6741
6740
if (reportErrors) {
@@ -10599,8 +10598,7 @@ namespace ts {
10599
10598
patternWithComputedProperties = true;
10600
10599
}
10601
10600
}
10602
- else if (contextualTypeHasPattern &&
10603
- !(contextualType.flags & TypeFlags.ObjectType && (contextualType as ObjectType).isObjectLiteralPatternWithComputedProperties)) {
10601
+ else if (contextualTypeHasPattern && !(getObjectFlags(contextualType) & ObjectFlags.ObjectLiteralPatternWithComputedProperties)) {
10604
10602
// If object literal is contextually typed by the implied type of a binding pattern, and if the
10605
10603
// binding pattern specifies a default value for the property, make the property optional.
10606
10604
const impliedProp = getPropertyOfType(contextualType, member.name);
@@ -10668,7 +10666,7 @@ namespace ts {
10668
10666
result.flags |= TypeFlags.ContainsObjectLiteral | freshObjectLiteralFlag | (typeFlags & TypeFlags.PropagatingFlags);
10669
10667
result.objectFlags |= ObjectFlags.ObjectLiteral;
10670
10668
if (patternWithComputedProperties) {
10671
- result.isObjectLiteralPatternWithComputedProperties = true ;
10669
+ result.objectFlags |= ObjectFlags.ObjectLiteralPatternWithComputedProperties ;
10672
10670
}
10673
10671
if (inDestructuringPattern) {
10674
10672
result.pattern = node;
0 commit comments