@typescript-deploys/pr-build 5.4.0-pr-56476-3 → 5.4.0-pr-56488-8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +52 -77
- package/lib/tsserver.js +145 -143
- package/lib/typescript.js +145 -143
- package/lib/typingsInstaller.js +1 -1
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -3661,7 +3661,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
|
|
|
3661
3661
|
TypeFlags2[TypeFlags2["InstantiablePrimitive"] = 406847488] = "InstantiablePrimitive";
|
|
3662
3662
|
TypeFlags2[TypeFlags2["Instantiable"] = 465829888] = "Instantiable";
|
|
3663
3663
|
TypeFlags2[TypeFlags2["StructuredOrInstantiable"] = 469499904] = "StructuredOrInstantiable";
|
|
3664
|
-
TypeFlags2[TypeFlags2["ObjectFlagsType"] =
|
|
3664
|
+
TypeFlags2[TypeFlags2["ObjectFlagsType"] = 138117121] = "ObjectFlagsType";
|
|
3665
3665
|
TypeFlags2[TypeFlags2["Simplifiable"] = 25165824] = "Simplifiable";
|
|
3666
3666
|
TypeFlags2[TypeFlags2["Singleton"] = 67358815] = "Singleton";
|
|
3667
3667
|
TypeFlags2[TypeFlags2["Narrowable"] = 536624127] = "Narrowable";
|
|
@@ -15974,7 +15974,7 @@ function getClassLikeDeclarationOfSymbol(symbol) {
|
|
|
15974
15974
|
return (_a = symbol.declarations) == null ? void 0 : _a.find(isClassLike);
|
|
15975
15975
|
}
|
|
15976
15976
|
function getObjectFlags(type) {
|
|
15977
|
-
return type.flags &
|
|
15977
|
+
return type.flags & 138117121 /* ObjectFlagsType */ ? type.objectFlags : 0;
|
|
15978
15978
|
}
|
|
15979
15979
|
function isUMDExportSymbol(symbol) {
|
|
15980
15980
|
return !!symbol && !!symbol.declarations && !!symbol.declarations[0] && isNamespaceExportDeclaration(symbol.declarations[0]);
|
|
@@ -54245,12 +54245,7 @@ function createTypeChecker(host) {
|
|
|
54245
54245
|
const checkType = type.checkType;
|
|
54246
54246
|
const constraint = getLowerBoundOfKeyType(checkType);
|
|
54247
54247
|
if (constraint !== checkType) {
|
|
54248
|
-
return getConditionalTypeInstantiation(
|
|
54249
|
-
type,
|
|
54250
|
-
prependTypeMapping(type.root.checkType, constraint, type.mapper),
|
|
54251
|
-
/*forConstraint*/
|
|
54252
|
-
false
|
|
54253
|
-
);
|
|
54248
|
+
return getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper));
|
|
54254
54249
|
}
|
|
54255
54250
|
}
|
|
54256
54251
|
return type;
|
|
@@ -54602,12 +54597,7 @@ function createTypeChecker(host) {
|
|
|
54602
54597
|
);
|
|
54603
54598
|
const constraint = simplified === type.checkType ? getConstraintOfType(simplified) : simplified;
|
|
54604
54599
|
if (constraint && constraint !== type.checkType) {
|
|
54605
|
-
const instantiated = getConditionalTypeInstantiation(
|
|
54606
|
-
type,
|
|
54607
|
-
prependTypeMapping(type.root.checkType, constraint, type.mapper),
|
|
54608
|
-
/*forConstraint*/
|
|
54609
|
-
true
|
|
54610
|
-
);
|
|
54600
|
+
const instantiated = getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper));
|
|
54611
54601
|
if (!(instantiated.flags & 131072 /* Never */)) {
|
|
54612
54602
|
type.resolvedConstraintOfDistributive = instantiated;
|
|
54613
54603
|
return instantiated;
|
|
@@ -57041,7 +57031,7 @@ function createTypeChecker(host) {
|
|
|
57041
57031
|
}
|
|
57042
57032
|
}
|
|
57043
57033
|
function removeStringLiteralsMatchedByTemplateLiterals(types) {
|
|
57044
|
-
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
|
|
57034
|
+
const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t) && t.types.every((t2) => !(t2.flags & 2097152 /* Intersection */) || !areIntersectedTypesAvoidingPrimitiveReduction(t2.types)));
|
|
57045
57035
|
if (templates.length) {
|
|
57046
57036
|
let i = types.length;
|
|
57047
57037
|
while (i > 0) {
|
|
@@ -57441,14 +57431,19 @@ function createTypeChecker(host) {
|
|
|
57441
57431
|
function getConstituentCountOfTypes(types) {
|
|
57442
57432
|
return reduceLeft(types, (n, t) => n + getConstituentCount(t), 0);
|
|
57443
57433
|
}
|
|
57434
|
+
function areIntersectedTypesAvoidingPrimitiveReduction(types, primitiveFlags = 4 /* String */ | 8 /* Number */ | 64 /* BigInt */) {
|
|
57435
|
+
if (types.length !== 2) {
|
|
57436
|
+
return false;
|
|
57437
|
+
}
|
|
57438
|
+
const [t1, t2] = types;
|
|
57439
|
+
return !!(t1.flags & primitiveFlags) && t2 === emptyTypeLiteralType || !!(t2.flags & primitiveFlags) && t1 === emptyTypeLiteralType;
|
|
57440
|
+
}
|
|
57444
57441
|
function getTypeFromIntersectionTypeNode(node) {
|
|
57445
57442
|
const links = getNodeLinks(node);
|
|
57446
57443
|
if (!links.resolvedType) {
|
|
57447
57444
|
const aliasSymbol = getAliasSymbolForTypeNode(node);
|
|
57448
57445
|
const types = map(node.types, getTypeFromTypeNode);
|
|
57449
|
-
const
|
|
57450
|
-
const t = emptyIndex >= 0 ? types[1 - emptyIndex] : unknownType;
|
|
57451
|
-
const noSupertypeReduction = !!(t.flags & (4 /* String */ | 8 /* Number */ | 64 /* BigInt */) || t.flags & 134217728 /* TemplateLiteral */ && isPatternLiteralType(t));
|
|
57446
|
+
const noSupertypeReduction = areIntersectedTypesAvoidingPrimitiveReduction(types);
|
|
57452
57447
|
links.resolvedType = getIntersectionType(types, aliasSymbol, getTypeArgumentsForAliasSymbol(aliasSymbol), noSupertypeReduction);
|
|
57453
57448
|
}
|
|
57454
57449
|
return links.resolvedType;
|
|
@@ -57475,17 +57470,19 @@ function createTypeChecker(host) {
|
|
|
57475
57470
|
return constraintType;
|
|
57476
57471
|
}
|
|
57477
57472
|
const keyTypes = [];
|
|
57478
|
-
if (
|
|
57479
|
-
if (
|
|
57473
|
+
if (isMappedTypeWithKeyofConstraintDeclaration(type)) {
|
|
57474
|
+
if (!isGenericIndexType(constraintType)) {
|
|
57475
|
+
const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
|
|
57476
|
+
forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, 8576 /* StringOrNumberLiteralOrUnique */, !!(indexFlags & 1 /* StringsOnly */), addMemberForKeyType);
|
|
57477
|
+
} else {
|
|
57480
57478
|
return getIndexTypeForGenericType(type, indexFlags);
|
|
57481
57479
|
}
|
|
57482
|
-
forEachType(constraintType, addMemberForKeyType);
|
|
57483
|
-
} else if (isMappedTypeWithKeyofConstraintDeclaration(type)) {
|
|
57484
|
-
const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
|
|
57485
|
-
forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, 8576 /* StringOrNumberLiteralOrUnique */, !!(indexFlags & 1 /* StringsOnly */), addMemberForKeyType);
|
|
57486
57480
|
} else {
|
|
57487
57481
|
forEachType(getLowerBoundOfKeyType(constraintType), addMemberForKeyType);
|
|
57488
57482
|
}
|
|
57483
|
+
if (isGenericIndexType(constraintType)) {
|
|
57484
|
+
forEachType(constraintType, addMemberForKeyType);
|
|
57485
|
+
}
|
|
57489
57486
|
const result = indexFlags & 2 /* NoIndexSignatures */ ? filterType(getUnionType(keyTypes), (t) => !(t.flags & (1 /* Any */ | 4 /* String */))) : getUnionType(keyTypes);
|
|
57490
57487
|
if (result.flags & 1048576 /* Union */ && constraintType.flags & 1048576 /* Union */ && getTypeListId(result.types) === getTypeListId(constraintType.types)) {
|
|
57491
57488
|
return constraintType;
|
|
@@ -57658,6 +57655,11 @@ function createTypeChecker(host) {
|
|
|
57658
57655
|
}
|
|
57659
57656
|
function createTemplateLiteralType(texts, types) {
|
|
57660
57657
|
const type = createType(134217728 /* TemplateLiteral */);
|
|
57658
|
+
type.objectFlags = getPropagatingFlagsOfTypes(
|
|
57659
|
+
types,
|
|
57660
|
+
/*excludeKinds*/
|
|
57661
|
+
98304 /* Nullable */
|
|
57662
|
+
);
|
|
57661
57663
|
type.texts = texts;
|
|
57662
57664
|
type.types = types;
|
|
57663
57665
|
return type;
|
|
@@ -57952,15 +57954,7 @@ function createTypeChecker(host) {
|
|
|
57952
57954
|
}
|
|
57953
57955
|
function isPatternLiteralPlaceholderType(type) {
|
|
57954
57956
|
if (type.flags & 2097152 /* Intersection */) {
|
|
57955
|
-
|
|
57956
|
-
for (const t of type.types) {
|
|
57957
|
-
if (t.flags & (2944 /* Literal */ | 98304 /* Nullable */) || isPatternLiteralPlaceholderType(t)) {
|
|
57958
|
-
seenPlaceholder = true;
|
|
57959
|
-
} else if (!(t.flags & 524288 /* Object */)) {
|
|
57960
|
-
return false;
|
|
57961
|
-
}
|
|
57962
|
-
}
|
|
57963
|
-
return seenPlaceholder;
|
|
57957
|
+
return !isGenericType(type) && some(type.types, (t) => !!(t.flags & (2944 /* Literal */ | 98304 /* Nullable */)) || isPatternLiteralPlaceholderType(t));
|
|
57964
57958
|
}
|
|
57965
57959
|
return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) || isPatternLiteralType(type);
|
|
57966
57960
|
}
|
|
@@ -57977,7 +57971,7 @@ function createTypeChecker(host) {
|
|
|
57977
57971
|
return !!(getGenericObjectFlags(type) & 8388608 /* IsGenericIndexType */);
|
|
57978
57972
|
}
|
|
57979
57973
|
function getGenericObjectFlags(type) {
|
|
57980
|
-
if (type.flags & 3145728 /* UnionOrIntersection */) {
|
|
57974
|
+
if (type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */)) {
|
|
57981
57975
|
if (!(type.objectFlags & 2097152 /* IsGenericTypeComputed */)) {
|
|
57982
57976
|
type.objectFlags |= 2097152 /* IsGenericTypeComputed */ | reduceLeft(type.types, (flags, t) => flags | getGenericObjectFlags(t), 0);
|
|
57983
57977
|
}
|
|
@@ -57989,7 +57983,7 @@ function createTypeChecker(host) {
|
|
|
57989
57983
|
}
|
|
57990
57984
|
return type.objectFlags & 12582912 /* IsGenericType */;
|
|
57991
57985
|
}
|
|
57992
|
-
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ |
|
|
57986
|
+
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
|
|
57993
57987
|
}
|
|
57994
57988
|
function getSimplifiedType(type, writing) {
|
|
57995
57989
|
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : type;
|
|
@@ -58170,7 +58164,7 @@ function createTypeChecker(host) {
|
|
|
58170
58164
|
function isDeferredType(type, checkTuples) {
|
|
58171
58165
|
return isGenericType(type) || checkTuples && isTupleType(type) && some(getElementTypes(type), isGenericType);
|
|
58172
58166
|
}
|
|
58173
|
-
function getConditionalType(root, mapper,
|
|
58167
|
+
function getConditionalType(root, mapper, aliasSymbol, aliasTypeArguments) {
|
|
58174
58168
|
let result;
|
|
58175
58169
|
let extraTypes;
|
|
58176
58170
|
let tailCount = 0;
|
|
@@ -58216,7 +58210,7 @@ function createTypeChecker(host) {
|
|
|
58216
58210
|
const inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType;
|
|
58217
58211
|
if (!checkTypeDeferred && !isDeferredType(inferredExtendsType, checkTuples)) {
|
|
58218
58212
|
if (!(inferredExtendsType.flags & 3 /* AnyOrUnknown */) && (checkType.flags & 1 /* Any */ || !isTypeAssignableTo(getPermissiveInstantiation(checkType), getPermissiveInstantiation(inferredExtendsType)))) {
|
|
58219
|
-
if (checkType.flags & 1 /* Any */
|
|
58213
|
+
if (checkType.flags & 1 /* Any */) {
|
|
58220
58214
|
(extraTypes || (extraTypes = [])).push(instantiateType(getTypeFromTypeNode(root.node.trueType), combinedMapper || mapper));
|
|
58221
58215
|
}
|
|
58222
58216
|
const falseType2 = getTypeFromTypeNode(root.node.falseType);
|
|
@@ -58326,9 +58320,7 @@ function createTypeChecker(host) {
|
|
|
58326
58320
|
links.resolvedType = getConditionalType(
|
|
58327
58321
|
root,
|
|
58328
58322
|
/*mapper*/
|
|
58329
|
-
void 0
|
|
58330
|
-
/*forConstraint*/
|
|
58331
|
-
false
|
|
58323
|
+
void 0
|
|
58332
58324
|
);
|
|
58333
58325
|
if (outerTypeParameters) {
|
|
58334
58326
|
root.instantiations = /* @__PURE__ */ new Map();
|
|
@@ -59017,7 +59009,7 @@ function createTypeChecker(host) {
|
|
|
59017
59009
|
result = target.objectFlags & 4 /* Reference */ ? createDeferredTypeReference(type.target, type.node, newMapper, newAliasSymbol, newAliasTypeArguments) : target.objectFlags & 32 /* Mapped */ ? instantiateMappedType(target, newMapper, newAliasSymbol, newAliasTypeArguments) : instantiateAnonymousType(target, newMapper, newAliasSymbol, newAliasTypeArguments);
|
|
59018
59010
|
target.instantiations.set(id, result);
|
|
59019
59011
|
const resultObjectFlags = getObjectFlags(result);
|
|
59020
|
-
if (result.flags &
|
|
59012
|
+
if (result.flags & 138117121 /* ObjectFlagsType */ && !(resultObjectFlags & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
59021
59013
|
const resultCouldContainTypeVariables = some(typeArguments, couldContainTypeVariables);
|
|
59022
59014
|
if (!(getObjectFlags(result) & 524288 /* CouldContainTypeVariablesComputed */)) {
|
|
59023
59015
|
if (resultObjectFlags & (32 /* Mapped */ | 16 /* Anonymous */ | 4 /* Reference */)) {
|
|
@@ -59183,17 +59175,17 @@ function createTypeChecker(host) {
|
|
|
59183
59175
|
result.objectFlags |= result.aliasTypeArguments ? getPropagatingFlagsOfTypes(result.aliasTypeArguments) : 0;
|
|
59184
59176
|
return result;
|
|
59185
59177
|
}
|
|
59186
|
-
function getConditionalTypeInstantiation(type, mapper,
|
|
59178
|
+
function getConditionalTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
59187
59179
|
const root = type.root;
|
|
59188
59180
|
if (root.outerTypeParameters) {
|
|
59189
59181
|
const typeArguments = map(root.outerTypeParameters, (t) => getMappedType(t, mapper));
|
|
59190
|
-
const id =
|
|
59182
|
+
const id = getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
59191
59183
|
let result = root.instantiations.get(id);
|
|
59192
59184
|
if (!result) {
|
|
59193
59185
|
const newMapper = createTypeMapper(root.outerTypeParameters, typeArguments);
|
|
59194
59186
|
const checkType = root.checkType;
|
|
59195
59187
|
const distributionType = root.isDistributive ? getMappedType(checkType, newMapper) : void 0;
|
|
59196
|
-
result = distributionType && checkType !== distributionType && distributionType.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapTypeWithAlias(getReducedType(distributionType), (t) => getConditionalType(root, prependTypeMapping(checkType, t, newMapper)
|
|
59188
|
+
result = distributionType && checkType !== distributionType && distributionType.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapTypeWithAlias(getReducedType(distributionType), (t) => getConditionalType(root, prependTypeMapping(checkType, t, newMapper)), aliasSymbol, aliasTypeArguments) : getConditionalType(root, newMapper, aliasSymbol, aliasTypeArguments);
|
|
59197
59189
|
root.instantiations.set(id, result);
|
|
59198
59190
|
}
|
|
59199
59191
|
return result;
|
|
@@ -59281,14 +59273,7 @@ function createTypeChecker(host) {
|
|
|
59281
59273
|
);
|
|
59282
59274
|
}
|
|
59283
59275
|
if (flags & 16777216 /* Conditional */) {
|
|
59284
|
-
return getConditionalTypeInstantiation(
|
|
59285
|
-
type,
|
|
59286
|
-
combineTypeMappers(type.mapper, mapper),
|
|
59287
|
-
/*forConstraint*/
|
|
59288
|
-
false,
|
|
59289
|
-
aliasSymbol,
|
|
59290
|
-
aliasTypeArguments
|
|
59291
|
-
);
|
|
59276
|
+
return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper), aliasSymbol, aliasTypeArguments);
|
|
59292
59277
|
}
|
|
59293
59278
|
if (flags & 33554432 /* Substitution */) {
|
|
59294
59279
|
const newBaseType = instantiateType(type.baseType, mapper);
|
|
@@ -60932,7 +60917,7 @@ function createTypeChecker(host) {
|
|
|
60932
60917
|
return relation === comparableRelation ? someTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 402784252 /* Primitive */), intersectionState) : eachTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 402784252 /* Primitive */), intersectionState);
|
|
60933
60918
|
}
|
|
60934
60919
|
if (target2.flags & 1048576 /* Union */) {
|
|
60935
|
-
return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source2), target2, reportErrors2 && !(source2.flags & 402784252 /* Primitive */) && !(target2.flags & 402784252 /* Primitive */)
|
|
60920
|
+
return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source2), target2, reportErrors2 && !(source2.flags & 402784252 /* Primitive */) && !(target2.flags & 402784252 /* Primitive */));
|
|
60936
60921
|
}
|
|
60937
60922
|
if (target2.flags & 2097152 /* Intersection */) {
|
|
60938
60923
|
return typeRelatedToEachType(source2, target2, reportErrors2, 2 /* Target */);
|
|
@@ -60977,8 +60962,7 @@ function createTypeChecker(host) {
|
|
|
60977
60962
|
sourceType,
|
|
60978
60963
|
target2,
|
|
60979
60964
|
/*reportErrors*/
|
|
60980
|
-
false
|
|
60981
|
-
0 /* None */
|
|
60965
|
+
false
|
|
60982
60966
|
);
|
|
60983
60967
|
if (!related) {
|
|
60984
60968
|
return 0 /* False */;
|
|
@@ -60987,7 +60971,7 @@ function createTypeChecker(host) {
|
|
|
60987
60971
|
}
|
|
60988
60972
|
return result2;
|
|
60989
60973
|
}
|
|
60990
|
-
function typeRelatedToSomeType(source2, target2, reportErrors2
|
|
60974
|
+
function typeRelatedToSomeType(source2, target2, reportErrors2) {
|
|
60991
60975
|
const targetTypes = target2.types;
|
|
60992
60976
|
if (target2.flags & 1048576 /* Union */) {
|
|
60993
60977
|
if (containsType(targetTypes, source2)) {
|
|
@@ -61005,10 +60989,7 @@ function createTypeChecker(host) {
|
|
|
61005
60989
|
match,
|
|
61006
60990
|
2 /* Target */,
|
|
61007
60991
|
/*reportErrors*/
|
|
61008
|
-
false
|
|
61009
|
-
/*headMessage*/
|
|
61010
|
-
void 0,
|
|
61011
|
-
intersectionState
|
|
60992
|
+
false
|
|
61012
60993
|
);
|
|
61013
60994
|
if (related) {
|
|
61014
60995
|
return related;
|
|
@@ -61021,10 +61002,7 @@ function createTypeChecker(host) {
|
|
|
61021
61002
|
type,
|
|
61022
61003
|
2 /* Target */,
|
|
61023
61004
|
/*reportErrors*/
|
|
61024
|
-
false
|
|
61025
|
-
/*headMessage*/
|
|
61026
|
-
void 0,
|
|
61027
|
-
intersectionState
|
|
61005
|
+
false
|
|
61028
61006
|
);
|
|
61029
61007
|
if (related) {
|
|
61030
61008
|
return related;
|
|
@@ -61038,10 +61016,7 @@ function createTypeChecker(host) {
|
|
|
61038
61016
|
bestMatchingType,
|
|
61039
61017
|
2 /* Target */,
|
|
61040
61018
|
/*reportErrors*/
|
|
61041
|
-
true
|
|
61042
|
-
/*headMessage*/
|
|
61043
|
-
void 0,
|
|
61044
|
-
intersectionState
|
|
61019
|
+
true
|
|
61045
61020
|
);
|
|
61046
61021
|
}
|
|
61047
61022
|
}
|
|
@@ -61839,6 +61814,13 @@ function createTypeChecker(host) {
|
|
|
61839
61814
|
return result2;
|
|
61840
61815
|
}
|
|
61841
61816
|
}
|
|
61817
|
+
} else {
|
|
61818
|
+
const distributiveConstraint = hasNonCircularBaseConstraint(source2) ? getConstraintOfDistributiveConditionalType(source2) : void 0;
|
|
61819
|
+
if (distributiveConstraint) {
|
|
61820
|
+
if (result2 = isRelatedTo(distributiveConstraint, target2, 1 /* Source */, reportErrors2)) {
|
|
61821
|
+
return result2;
|
|
61822
|
+
}
|
|
61823
|
+
}
|
|
61842
61824
|
}
|
|
61843
61825
|
const defaultConstraint = getDefaultConstraintOfConditionalType(source2);
|
|
61844
61826
|
if (defaultConstraint) {
|
|
@@ -61846,13 +61828,6 @@ function createTypeChecker(host) {
|
|
|
61846
61828
|
return result2;
|
|
61847
61829
|
}
|
|
61848
61830
|
}
|
|
61849
|
-
const distributiveConstraint = !(targetFlags & 16777216 /* Conditional */) && hasNonCircularBaseConstraint(source2) ? getConstraintOfDistributiveConditionalType(source2) : void 0;
|
|
61850
|
-
if (distributiveConstraint) {
|
|
61851
|
-
resetErrorInfo(saveErrorInfo);
|
|
61852
|
-
if (result2 = isRelatedTo(distributiveConstraint, target2, 1 /* Source */, reportErrors2)) {
|
|
61853
|
-
return result2;
|
|
61854
|
-
}
|
|
61855
|
-
}
|
|
61856
61831
|
} else {
|
|
61857
61832
|
if (relation !== subtypeRelation && relation !== strictSubtypeRelation && isPartialMappedType(target2) && isEmptyObjectType(source2)) {
|
|
61858
61833
|
return -1 /* True */;
|
|
@@ -63750,8 +63725,8 @@ function createTypeChecker(host) {
|
|
|
63750
63725
|
if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
|
|
63751
63726
|
return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
|
|
63752
63727
|
}
|
|
63753
|
-
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
|
|
63754
|
-
if (type.flags &
|
|
63728
|
+
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & (3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */) && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
|
|
63729
|
+
if (type.flags & 138117121 /* ObjectFlagsType */) {
|
|
63755
63730
|
type.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (result ? 1048576 /* CouldContainTypeVariables */ : 0);
|
|
63756
63731
|
}
|
|
63757
63732
|
return result;
|