File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -22168,8 +22168,9 @@ namespace ts {
22168
22168
// constituent types keyed by the literal types of the property by that name in each constituent type.
22169
22169
function getKeyPropertyName(unionType: UnionType): __String | undefined {
22170
22170
const types = unionType.types;
22171
- // We only construct maps for large unions with non-primitive constituents.
22172
- if (types.length < 10 || getObjectFlags(unionType) & ObjectFlags.PrimitiveUnion) {
22171
+ // We only construct maps for unions with many non-primitive constituents.
22172
+ if (types.length < 10 || getObjectFlags(unionType) & ObjectFlags.PrimitiveUnion ||
22173
+ countWhere(types, t => !!(t.flags & (TypeFlags.Object | TypeFlags.InstantiableNonPrimitive))) < 10) {
22173
22174
return undefined;
22174
22175
}
22175
22176
if (unionType.keyPropertyName === undefined) {
You can’t perform that action at this time.
0 commit comments