@typescript-deploys/pr-build 5.4.0-pr-56594-3 → 5.4.0-pr-57293-15
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 +237 -202
- package/lib/tsserver.js +238 -203
- package/lib/typescript.d.ts +13 -12
- package/lib/typescript.js +238 -203
- package/lib/typingsInstaller.js +40 -39
- package/package.json +2 -2
package/lib/typescript.js
CHANGED
|
@@ -2188,8 +2188,8 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
2188
2188
|
// for use with vscode-js-debug's new customDescriptionGenerator in launch.json
|
|
2189
2189
|
__tsDebuggerDisplay: {
|
|
2190
2190
|
value() {
|
|
2191
|
-
const typeHeader = this.flags & 67359327 /* Intrinsic */ ? `IntrinsicType ${this.intrinsicName}${this.debugIntrinsicName ? ` (${this.debugIntrinsicName})` : ""}` : this.flags & 98304 /* Nullable */ ? "NullableType" : this.flags & 384 /* StringOrNumberLiteral */ ? `LiteralType ${JSON.stringify(this.value)}` : this.flags & 2048 /* BigIntLiteral */ ? `LiteralType ${this.value.negative ? "-" : ""}${this.value.base10Value}n` : this.flags & 8192 /* UniqueESSymbol */ ? "UniqueESSymbolType" : this.flags & 32 /* Enum */ ? "EnumType" : this.flags & 1048576 /* Union */ ? "UnionType" : this.flags & 2097152 /* Intersection */ ? "IntersectionType" : this.flags & 4194304 /* Index */ ? "IndexType" : this.flags & 8388608 /* IndexedAccess */ ? "IndexedAccessType" : this.flags & 16777216 /* Conditional */ ? "ConditionalType" : this.flags & 33554432 /* Substitution */ ? "SubstitutionType" : this.flags & 262144 /* TypeParameter */ ? "TypeParameter" : this.flags & 524288 /* Object */ ? this.objectFlags & 3 /* ClassOrInterface */ ? "InterfaceType" : this.objectFlags & 4 /* Reference */ ? "TypeReference" : this.objectFlags & 8 /* Tuple */ ? "TupleType" : this.objectFlags & 16 /* Anonymous */ ? "AnonymousType" : this.objectFlags & 32 /* Mapped */ ? "MappedType" : this.objectFlags &
|
|
2192
|
-
const remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~
|
|
2191
|
+
const typeHeader = this.flags & 67359327 /* Intrinsic */ ? `IntrinsicType ${this.intrinsicName}${this.debugIntrinsicName ? ` (${this.debugIntrinsicName})` : ""}` : this.flags & 98304 /* Nullable */ ? "NullableType" : this.flags & 384 /* StringOrNumberLiteral */ ? `LiteralType ${JSON.stringify(this.value)}` : this.flags & 2048 /* BigIntLiteral */ ? `LiteralType ${this.value.negative ? "-" : ""}${this.value.base10Value}n` : this.flags & 8192 /* UniqueESSymbol */ ? "UniqueESSymbolType" : this.flags & 32 /* Enum */ ? "EnumType" : this.flags & 1048576 /* Union */ ? "UnionType" : this.flags & 2097152 /* Intersection */ ? "IntersectionType" : this.flags & 4194304 /* Index */ ? "IndexType" : this.flags & 8388608 /* IndexedAccess */ ? "IndexedAccessType" : this.flags & 16777216 /* Conditional */ ? "ConditionalType" : this.flags & 33554432 /* Substitution */ ? "SubstitutionType" : this.flags & 262144 /* TypeParameter */ ? "TypeParameter" : this.flags & 524288 /* Object */ ? this.objectFlags & 3 /* ClassOrInterface */ ? "InterfaceType" : this.objectFlags & 4 /* Reference */ ? "TypeReference" : this.objectFlags & 8 /* Tuple */ ? "TupleType" : this.objectFlags & 16 /* Anonymous */ ? "AnonymousType" : this.objectFlags & 32 /* Mapped */ ? "MappedType" : this.objectFlags & 2048 /* ReverseMapped */ ? "ReverseMappedType" : this.objectFlags & 512 /* EvolvingArray */ ? "EvolvingArrayType" : "ObjectType" : "Type";
|
|
2192
|
+
const remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~2623 /* ObjectTypeKindMask */ : 0;
|
|
2193
2193
|
return `${typeHeader}${this.symbol ? ` '${symbolName(this.symbol)}'` : ""}${remainingObjectFlags ? ` (${formatObjectFlags(remainingObjectFlags)})` : ""}`;
|
|
2194
2194
|
}
|
|
2195
2195
|
},
|
|
@@ -3423,7 +3423,7 @@ ${lanes.join("\n")}
|
|
|
3423
3423
|
};
|
|
3424
3424
|
}
|
|
3425
3425
|
let reverseMappedProperties = {};
|
|
3426
|
-
if (objectFlags &
|
|
3426
|
+
if (objectFlags & 2048 /* ReverseMapped */) {
|
|
3427
3427
|
const reverseMappedType = type;
|
|
3428
3428
|
reverseMappedProperties = {
|
|
3429
3429
|
reverseMappedSourceType: (_l = reverseMappedType.source) == null ? void 0 : _l.id,
|
|
@@ -3432,7 +3432,7 @@ ${lanes.join("\n")}
|
|
|
3432
3432
|
};
|
|
3433
3433
|
}
|
|
3434
3434
|
let evolvingArrayProperties = {};
|
|
3435
|
-
if (objectFlags &
|
|
3435
|
+
if (objectFlags & 512 /* EvolvingArray */) {
|
|
3436
3436
|
const evolvingArrayType = type;
|
|
3437
3437
|
evolvingArrayProperties = {
|
|
3438
3438
|
evolvingArrayElementType: evolvingArrayType.elementType.id,
|
|
@@ -4462,42 +4462,43 @@ ${lanes.join("\n")}
|
|
|
4462
4462
|
ObjectFlags3[ObjectFlags3["Tuple"] = 8] = "Tuple";
|
|
4463
4463
|
ObjectFlags3[ObjectFlags3["Anonymous"] = 16] = "Anonymous";
|
|
4464
4464
|
ObjectFlags3[ObjectFlags3["Mapped"] = 32] = "Mapped";
|
|
4465
|
-
ObjectFlags3[ObjectFlags3["
|
|
4466
|
-
ObjectFlags3[ObjectFlags3["
|
|
4467
|
-
ObjectFlags3[ObjectFlags3["
|
|
4468
|
-
ObjectFlags3[ObjectFlags3["
|
|
4469
|
-
ObjectFlags3[ObjectFlags3["
|
|
4470
|
-
ObjectFlags3[ObjectFlags3["
|
|
4471
|
-
ObjectFlags3[ObjectFlags3["
|
|
4472
|
-
ObjectFlags3[ObjectFlags3["
|
|
4473
|
-
ObjectFlags3[ObjectFlags3["
|
|
4474
|
-
ObjectFlags3[ObjectFlags3["
|
|
4475
|
-
ObjectFlags3[ObjectFlags3["
|
|
4476
|
-
ObjectFlags3[ObjectFlags3["
|
|
4477
|
-
ObjectFlags3[ObjectFlags3["
|
|
4478
|
-
ObjectFlags3[ObjectFlags3["
|
|
4479
|
-
ObjectFlags3[ObjectFlags3["
|
|
4465
|
+
ObjectFlags3[ObjectFlags3["TypeAliasInstantiation"] = 64] = "TypeAliasInstantiation";
|
|
4466
|
+
ObjectFlags3[ObjectFlags3["Instantiated"] = 128] = "Instantiated";
|
|
4467
|
+
ObjectFlags3[ObjectFlags3["ObjectLiteral"] = 256] = "ObjectLiteral";
|
|
4468
|
+
ObjectFlags3[ObjectFlags3["EvolvingArray"] = 512] = "EvolvingArray";
|
|
4469
|
+
ObjectFlags3[ObjectFlags3["ObjectLiteralPatternWithComputedProperties"] = 1024] = "ObjectLiteralPatternWithComputedProperties";
|
|
4470
|
+
ObjectFlags3[ObjectFlags3["ReverseMapped"] = 2048] = "ReverseMapped";
|
|
4471
|
+
ObjectFlags3[ObjectFlags3["JsxAttributes"] = 4096] = "JsxAttributes";
|
|
4472
|
+
ObjectFlags3[ObjectFlags3["JSLiteral"] = 8192] = "JSLiteral";
|
|
4473
|
+
ObjectFlags3[ObjectFlags3["FreshLiteral"] = 16384] = "FreshLiteral";
|
|
4474
|
+
ObjectFlags3[ObjectFlags3["ArrayLiteral"] = 32768] = "ArrayLiteral";
|
|
4475
|
+
ObjectFlags3[ObjectFlags3["PrimitiveUnion"] = 65536] = "PrimitiveUnion";
|
|
4476
|
+
ObjectFlags3[ObjectFlags3["ContainsWideningType"] = 131072] = "ContainsWideningType";
|
|
4477
|
+
ObjectFlags3[ObjectFlags3["ContainsObjectOrArrayLiteral"] = 262144] = "ContainsObjectOrArrayLiteral";
|
|
4478
|
+
ObjectFlags3[ObjectFlags3["NonInferrableType"] = 524288] = "NonInferrableType";
|
|
4479
|
+
ObjectFlags3[ObjectFlags3["CouldContainTypeVariablesComputed"] = 1048576] = "CouldContainTypeVariablesComputed";
|
|
4480
|
+
ObjectFlags3[ObjectFlags3["CouldContainTypeVariables"] = 2097152] = "CouldContainTypeVariables";
|
|
4480
4481
|
ObjectFlags3[ObjectFlags3["ClassOrInterface"] = 3] = "ClassOrInterface";
|
|
4481
|
-
ObjectFlags3[ObjectFlags3["RequiresWidening"] =
|
|
4482
|
-
ObjectFlags3[ObjectFlags3["PropagatingFlags"] =
|
|
4483
|
-
ObjectFlags3[ObjectFlags3["InstantiatedMapped"] =
|
|
4484
|
-
ObjectFlags3[ObjectFlags3["ObjectTypeKindMask"] =
|
|
4485
|
-
ObjectFlags3[ObjectFlags3["ContainsSpread"] =
|
|
4486
|
-
ObjectFlags3[ObjectFlags3["ObjectRestType"] =
|
|
4487
|
-
ObjectFlags3[ObjectFlags3["InstantiationExpressionType"] =
|
|
4488
|
-
ObjectFlags3[ObjectFlags3["IsClassInstanceClone"] =
|
|
4489
|
-
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeCalculated"] =
|
|
4490
|
-
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeExists"] =
|
|
4491
|
-
ObjectFlags3[ObjectFlags3["IsGenericTypeComputed"] =
|
|
4492
|
-
ObjectFlags3[ObjectFlags3["IsGenericObjectType"] =
|
|
4493
|
-
ObjectFlags3[ObjectFlags3["IsGenericIndexType"] =
|
|
4494
|
-
ObjectFlags3[ObjectFlags3["IsGenericType"] =
|
|
4495
|
-
ObjectFlags3[ObjectFlags3["ContainsIntersections"] =
|
|
4496
|
-
ObjectFlags3[ObjectFlags3["IsUnknownLikeUnionComputed"] =
|
|
4497
|
-
ObjectFlags3[ObjectFlags3["IsUnknownLikeUnion"] =
|
|
4498
|
-
ObjectFlags3[ObjectFlags3["IsNeverIntersectionComputed"] =
|
|
4499
|
-
ObjectFlags3[ObjectFlags3["IsNeverIntersection"] =
|
|
4500
|
-
ObjectFlags3[ObjectFlags3["IsConstrainedTypeVariable"] =
|
|
4482
|
+
ObjectFlags3[ObjectFlags3["RequiresWidening"] = 393216] = "RequiresWidening";
|
|
4483
|
+
ObjectFlags3[ObjectFlags3["PropagatingFlags"] = 917504] = "PropagatingFlags";
|
|
4484
|
+
ObjectFlags3[ObjectFlags3["InstantiatedMapped"] = 160] = "InstantiatedMapped";
|
|
4485
|
+
ObjectFlags3[ObjectFlags3["ObjectTypeKindMask"] = 2623] = "ObjectTypeKindMask";
|
|
4486
|
+
ObjectFlags3[ObjectFlags3["ContainsSpread"] = 4194304] = "ContainsSpread";
|
|
4487
|
+
ObjectFlags3[ObjectFlags3["ObjectRestType"] = 8388608] = "ObjectRestType";
|
|
4488
|
+
ObjectFlags3[ObjectFlags3["InstantiationExpressionType"] = 16777216] = "InstantiationExpressionType";
|
|
4489
|
+
ObjectFlags3[ObjectFlags3["IsClassInstanceClone"] = 33554432] = "IsClassInstanceClone";
|
|
4490
|
+
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeCalculated"] = 67108864] = "IdenticalBaseTypeCalculated";
|
|
4491
|
+
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeExists"] = 134217728] = "IdenticalBaseTypeExists";
|
|
4492
|
+
ObjectFlags3[ObjectFlags3["IsGenericTypeComputed"] = 4194304] = "IsGenericTypeComputed";
|
|
4493
|
+
ObjectFlags3[ObjectFlags3["IsGenericObjectType"] = 8388608] = "IsGenericObjectType";
|
|
4494
|
+
ObjectFlags3[ObjectFlags3["IsGenericIndexType"] = 16777216] = "IsGenericIndexType";
|
|
4495
|
+
ObjectFlags3[ObjectFlags3["IsGenericType"] = 25165824] = "IsGenericType";
|
|
4496
|
+
ObjectFlags3[ObjectFlags3["ContainsIntersections"] = 33554432] = "ContainsIntersections";
|
|
4497
|
+
ObjectFlags3[ObjectFlags3["IsUnknownLikeUnionComputed"] = 67108864] = "IsUnknownLikeUnionComputed";
|
|
4498
|
+
ObjectFlags3[ObjectFlags3["IsUnknownLikeUnion"] = 134217728] = "IsUnknownLikeUnion";
|
|
4499
|
+
ObjectFlags3[ObjectFlags3["IsNeverIntersectionComputed"] = 33554432] = "IsNeverIntersectionComputed";
|
|
4500
|
+
ObjectFlags3[ObjectFlags3["IsNeverIntersection"] = 67108864] = "IsNeverIntersection";
|
|
4501
|
+
ObjectFlags3[ObjectFlags3["IsConstrainedTypeVariable"] = 134217728] = "IsConstrainedTypeVariable";
|
|
4501
4502
|
return ObjectFlags3;
|
|
4502
4503
|
})(ObjectFlags || {});
|
|
4503
4504
|
VarianceFlags = /* @__PURE__ */ ((VarianceFlags2) => {
|
|
@@ -46132,7 +46133,7 @@ ${lanes.join("\n")}
|
|
|
46132
46133
|
var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
|
|
46133
46134
|
var keyofStringsOnly = !!compilerOptions.keyofStringsOnly;
|
|
46134
46135
|
var defaultIndexFlags = keyofStringsOnly ? 1 /* StringsOnly */ : 0 /* None */;
|
|
46135
|
-
var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 :
|
|
46136
|
+
var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 16384 /* FreshLiteral */;
|
|
46136
46137
|
var exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes;
|
|
46137
46138
|
var checkBinaryExpression = createCheckBinaryExpression();
|
|
46138
46139
|
var emitResolver = createResolver();
|
|
@@ -46635,7 +46636,7 @@ ${lanes.join("\n")}
|
|
|
46635
46636
|
var errorTypes = /* @__PURE__ */ new Map();
|
|
46636
46637
|
var seenIntrinsicNames = /* @__PURE__ */ new Set();
|
|
46637
46638
|
var anyType = createIntrinsicType(1 /* Any */, "any");
|
|
46638
|
-
var autoType = createIntrinsicType(1 /* Any */, "any",
|
|
46639
|
+
var autoType = createIntrinsicType(1 /* Any */, "any", 524288 /* NonInferrableType */, "auto");
|
|
46639
46640
|
var wildcardType = createIntrinsicType(
|
|
46640
46641
|
1 /* Any */,
|
|
46641
46642
|
"any",
|
|
@@ -46652,7 +46653,7 @@ ${lanes.join("\n")}
|
|
|
46652
46653
|
);
|
|
46653
46654
|
var errorType = createIntrinsicType(1 /* Any */, "error");
|
|
46654
46655
|
var unresolvedType = createIntrinsicType(1 /* Any */, "unresolved");
|
|
46655
|
-
var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any",
|
|
46656
|
+
var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 131072 /* ContainsWideningType */, "non-inferrable");
|
|
46656
46657
|
var intrinsicMarkerType = createIntrinsicType(1 /* Any */, "intrinsic");
|
|
46657
46658
|
var unknownType = createIntrinsicType(2 /* Unknown */, "unknown");
|
|
46658
46659
|
var nonNullUnknownType = createIntrinsicType(
|
|
@@ -46663,7 +46664,7 @@ ${lanes.join("\n")}
|
|
|
46663
46664
|
"non-null"
|
|
46664
46665
|
);
|
|
46665
46666
|
var undefinedType = createIntrinsicType(32768 /* Undefined */, "undefined");
|
|
46666
|
-
var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined",
|
|
46667
|
+
var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 131072 /* ContainsWideningType */, "widening");
|
|
46667
46668
|
var missingType = createIntrinsicType(
|
|
46668
46669
|
32768 /* Undefined */,
|
|
46669
46670
|
"undefined",
|
|
@@ -46680,7 +46681,7 @@ ${lanes.join("\n")}
|
|
|
46680
46681
|
"optional"
|
|
46681
46682
|
);
|
|
46682
46683
|
var nullType = createIntrinsicType(65536 /* Null */, "null");
|
|
46683
|
-
var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null",
|
|
46684
|
+
var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null", 131072 /* ContainsWideningType */, "widening");
|
|
46684
46685
|
var stringType = createIntrinsicType(4 /* String */, "string");
|
|
46685
46686
|
var numberType = createIntrinsicType(8 /* Number */, "number");
|
|
46686
46687
|
var bigintType = createIntrinsicType(64 /* BigInt */, "bigint");
|
|
@@ -46712,7 +46713,7 @@ ${lanes.join("\n")}
|
|
|
46712
46713
|
var esSymbolType = createIntrinsicType(4096 /* ESSymbol */, "symbol");
|
|
46713
46714
|
var voidType = createIntrinsicType(16384 /* Void */, "void");
|
|
46714
46715
|
var neverType = createIntrinsicType(131072 /* Never */, "never");
|
|
46715
|
-
var silentNeverType = createIntrinsicType(131072 /* Never */, "never",
|
|
46716
|
+
var silentNeverType = createIntrinsicType(131072 /* Never */, "never", 524288 /* NonInferrableType */, "silent");
|
|
46716
46717
|
var implicitNeverType = createIntrinsicType(
|
|
46717
46718
|
131072 /* Never */,
|
|
46718
46719
|
"never",
|
|
@@ -46779,7 +46780,7 @@ ${lanes.join("\n")}
|
|
|
46779
46780
|
emptyArray,
|
|
46780
46781
|
emptyArray
|
|
46781
46782
|
);
|
|
46782
|
-
emptyJsxObjectType.objectFlags |=
|
|
46783
|
+
emptyJsxObjectType.objectFlags |= 4096 /* JsxAttributes */;
|
|
46783
46784
|
var emptyTypeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */);
|
|
46784
46785
|
emptyTypeLiteralSymbol.members = createSymbolTable();
|
|
46785
46786
|
var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, emptyArray, emptyArray, emptyArray);
|
|
@@ -46809,7 +46810,7 @@ ${lanes.join("\n")}
|
|
|
46809
46810
|
emptyArray,
|
|
46810
46811
|
emptyArray
|
|
46811
46812
|
);
|
|
46812
|
-
anyFunctionType.objectFlags |=
|
|
46813
|
+
anyFunctionType.objectFlags |= 524288 /* NonInferrableType */;
|
|
46813
46814
|
var noConstraintType = createAnonymousType(
|
|
46814
46815
|
/*symbol*/
|
|
46815
46816
|
void 0,
|
|
@@ -50047,7 +50048,7 @@ ${lanes.join("\n")}
|
|
|
50047
50048
|
const type = createType(kind);
|
|
50048
50049
|
type.intrinsicName = intrinsicName;
|
|
50049
50050
|
type.debugIntrinsicName = debugIntrinsicName;
|
|
50050
|
-
type.objectFlags = objectFlags |
|
|
50051
|
+
type.objectFlags = objectFlags | 1048576 /* CouldContainTypeVariablesComputed */ | 4194304 /* IsGenericTypeComputed */ | 67108864 /* IsUnknownLikeUnionComputed */ | 33554432 /* IsNeverIntersectionComputed */;
|
|
50051
50052
|
return type;
|
|
50052
50053
|
}
|
|
50053
50054
|
function checkIntrinsicName(name, debug) {
|
|
@@ -50636,7 +50637,7 @@ ${lanes.join("\n")}
|
|
|
50636
50637
|
return flags & 848330095 /* NodeBuilderFlagsMask */;
|
|
50637
50638
|
}
|
|
50638
50639
|
function isClassInstanceSide(type) {
|
|
50639
|
-
return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || !!(type.flags & 524288 /* Object */) && !!(getObjectFlags(type) &
|
|
50640
|
+
return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || !!(type.flags & 524288 /* Object */) && !!(getObjectFlags(type) & 33554432 /* IsClassInstanceClone */));
|
|
50640
50641
|
}
|
|
50641
50642
|
function createNodeBuilder() {
|
|
50642
50643
|
return {
|
|
@@ -50725,9 +50726,7 @@ ${lanes.join("\n")}
|
|
|
50725
50726
|
context.approximateLength += 3;
|
|
50726
50727
|
return factory.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
50727
50728
|
}
|
|
50728
|
-
|
|
50729
|
-
type = getReducedType(type);
|
|
50730
|
-
}
|
|
50729
|
+
type = context.flags & 536870912 /* NoTypeReduction */ ? getResolvedType(type) : getReducedType(type);
|
|
50731
50730
|
if (type.flags & 1 /* Any */) {
|
|
50732
50731
|
if (type.aliasSymbol) {
|
|
50733
50732
|
return factory.createTypeReferenceNode(symbolToEntityNameNode(type.aliasSymbol), mapToTypeNodes(type.aliasTypeArguments, context));
|
|
@@ -51099,7 +51098,7 @@ ${lanes.join("\n")}
|
|
|
51099
51098
|
const typeId = type2.id;
|
|
51100
51099
|
const symbol = type2.symbol;
|
|
51101
51100
|
if (symbol) {
|
|
51102
|
-
const isInstantiationExpressionType = !!(getObjectFlags(type2) &
|
|
51101
|
+
const isInstantiationExpressionType = !!(getObjectFlags(type2) & 16777216 /* InstantiationExpressionType */);
|
|
51103
51102
|
if (isInstantiationExpressionType) {
|
|
51104
51103
|
const instantiationExpressionType = type2;
|
|
51105
51104
|
const existing = instantiationExpressionType.node;
|
|
@@ -51437,7 +51436,7 @@ ${lanes.join("\n")}
|
|
|
51437
51436
|
typeElements.push(signatureToSignatureDeclarationHelper(signature, 180 /* ConstructSignature */, context));
|
|
51438
51437
|
}
|
|
51439
51438
|
for (const info of resolvedType.indexInfos) {
|
|
51440
|
-
typeElements.push(indexInfoToIndexSignatureDeclarationHelper(info, context, resolvedType.objectFlags &
|
|
51439
|
+
typeElements.push(indexInfoToIndexSignatureDeclarationHelper(info, context, resolvedType.objectFlags & 2048 /* ReverseMapped */ ? createElidedInformationPlaceholder(context) : void 0));
|
|
51441
51440
|
}
|
|
51442
51441
|
const properties = resolvedType.properties;
|
|
51443
51442
|
if (!properties) {
|
|
@@ -54681,7 +54680,7 @@ ${lanes.join("\n")}
|
|
|
54681
54680
|
));
|
|
54682
54681
|
}
|
|
54683
54682
|
const result = createAnonymousType(symbol, members, emptyArray, emptyArray, getIndexInfosOfType(source));
|
|
54684
|
-
result.objectFlags |=
|
|
54683
|
+
result.objectFlags |= 8388608 /* ObjectRestType */;
|
|
54685
54684
|
return result;
|
|
54686
54685
|
}
|
|
54687
54686
|
function isGenericTypeWithUndefinedConstraint(type) {
|
|
@@ -55111,7 +55110,7 @@ ${lanes.join("\n")}
|
|
|
55111
55110
|
mergeSymbolTable(exports, s.exports);
|
|
55112
55111
|
}
|
|
55113
55112
|
const type = createAnonymousType(symbol, exports, emptyArray, emptyArray, emptyArray);
|
|
55114
|
-
type.objectFlags |=
|
|
55113
|
+
type.objectFlags |= 8192 /* JSLiteral */;
|
|
55115
55114
|
return type;
|
|
55116
55115
|
}
|
|
55117
55116
|
function getAnnotatedTypeForAssignmentDeclaration(declaredType, expression, symbol, declaration) {
|
|
@@ -55232,9 +55231,9 @@ ${lanes.join("\n")}
|
|
|
55232
55231
|
result.aliasTypeArguments = length(args) ? args : void 0;
|
|
55233
55232
|
}
|
|
55234
55233
|
}
|
|
55235
|
-
result.objectFlags |= getObjectFlags(type) &
|
|
55234
|
+
result.objectFlags |= getObjectFlags(type) & 8192 /* JSLiteral */;
|
|
55236
55235
|
if (result.symbol && result.symbol.flags & 32 /* Class */ && type === getDeclaredTypeOfClassOrInterface(result.symbol)) {
|
|
55237
|
-
result.objectFlags |=
|
|
55236
|
+
result.objectFlags |= 33554432 /* IsClassInstanceClone */;
|
|
55238
55237
|
}
|
|
55239
55238
|
return result;
|
|
55240
55239
|
}
|
|
@@ -55287,7 +55286,7 @@ ${lanes.join("\n")}
|
|
|
55287
55286
|
function getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors2) {
|
|
55288
55287
|
const members = createSymbolTable();
|
|
55289
55288
|
let stringIndexInfo;
|
|
55290
|
-
let objectFlags =
|
|
55289
|
+
let objectFlags = 256 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
|
|
55291
55290
|
forEach(pattern.elements, (e) => {
|
|
55292
55291
|
const name = e.propertyName || e.name;
|
|
55293
55292
|
if (e.dotDotDotToken) {
|
|
@@ -55301,7 +55300,7 @@ ${lanes.join("\n")}
|
|
|
55301
55300
|
}
|
|
55302
55301
|
const exprType = getLiteralTypeFromPropertyName(name);
|
|
55303
55302
|
if (!isTypeUsableAsPropertyName(exprType)) {
|
|
55304
|
-
objectFlags |=
|
|
55303
|
+
objectFlags |= 1024 /* ObjectLiteralPatternWithComputedProperties */;
|
|
55305
55304
|
return;
|
|
55306
55305
|
}
|
|
55307
55306
|
const text = getPropertyNameFromType(exprType);
|
|
@@ -55322,7 +55321,7 @@ ${lanes.join("\n")}
|
|
|
55322
55321
|
result.objectFlags |= objectFlags;
|
|
55323
55322
|
if (includePatternInType) {
|
|
55324
55323
|
result.pattern = pattern;
|
|
55325
|
-
result.objectFlags |=
|
|
55324
|
+
result.objectFlags |= 262144 /* ContainsObjectOrArrayLiteral */;
|
|
55326
55325
|
}
|
|
55327
55326
|
return result;
|
|
55328
55327
|
}
|
|
@@ -55340,7 +55339,7 @@ ${lanes.join("\n")}
|
|
|
55340
55339
|
if (includePatternInType) {
|
|
55341
55340
|
result = cloneTypeReference(result);
|
|
55342
55341
|
result.pattern = pattern;
|
|
55343
|
-
result.objectFlags |=
|
|
55342
|
+
result.objectFlags |= 262144 /* ContainsObjectOrArrayLiteral */;
|
|
55344
55343
|
}
|
|
55345
55344
|
return result;
|
|
55346
55345
|
}
|
|
@@ -55368,7 +55367,7 @@ ${lanes.join("\n")}
|
|
|
55368
55367
|
members.set(member.escapedName, member);
|
|
55369
55368
|
});
|
|
55370
55369
|
const type = createAnonymousType(symbol, members, emptyArray, emptyArray, emptyArray);
|
|
55371
|
-
type.objectFlags |=
|
|
55370
|
+
type.objectFlags |= 256 /* ObjectLiteral */ | 524288 /* NonInferrableType */;
|
|
55372
55371
|
links.resolvedType = type;
|
|
55373
55372
|
}
|
|
55374
55373
|
return links.resolvedType;
|
|
@@ -57156,6 +57155,14 @@ ${lanes.join("\n")}
|
|
|
57156
57155
|
type.constructSignatures = constructSignatures;
|
|
57157
57156
|
}
|
|
57158
57157
|
}
|
|
57158
|
+
function resolveTypeAliasInstantiationMembers(type) {
|
|
57159
|
+
const resolved = resolveStructuredTypeMembers(getResolvedTypeAliasInstantiation(type));
|
|
57160
|
+
type.members = resolved.members;
|
|
57161
|
+
type.properties = resolved.properties;
|
|
57162
|
+
type.callSignatures = resolved.callSignatures;
|
|
57163
|
+
type.constructSignatures = resolved.constructSignatures;
|
|
57164
|
+
type.indexInfos = resolved.indexInfos;
|
|
57165
|
+
}
|
|
57159
57166
|
function replaceIndexedAccess(instantiable, type, replacement) {
|
|
57160
57167
|
return instantiateType(instantiable, createTypeMapper([type.indexType, type.objectType], [getNumberLiteralType(0), createTupleType([replacement])]));
|
|
57161
57168
|
}
|
|
@@ -57422,12 +57429,14 @@ ${lanes.join("\n")}
|
|
|
57422
57429
|
resolveTypeReferenceMembers(type);
|
|
57423
57430
|
} else if (type.objectFlags & 3 /* ClassOrInterface */) {
|
|
57424
57431
|
resolveClassOrInterfaceMembers(type);
|
|
57425
|
-
} else if (type.objectFlags &
|
|
57432
|
+
} else if (type.objectFlags & 2048 /* ReverseMapped */) {
|
|
57426
57433
|
resolveReverseMappedTypeMembers(type);
|
|
57427
57434
|
} else if (type.objectFlags & 16 /* Anonymous */) {
|
|
57428
57435
|
resolveAnonymousTypeMembers(type);
|
|
57429
57436
|
} else if (type.objectFlags & 32 /* Mapped */) {
|
|
57430
57437
|
resolveMappedTypeMembers(type);
|
|
57438
|
+
} else if (type.objectFlags & 64 /* TypeAliasInstantiation */) {
|
|
57439
|
+
resolveTypeAliasInstantiationMembers(type);
|
|
57431
57440
|
} else {
|
|
57432
57441
|
Debug.fail("Unhandled object type " + Debug.formatObjectFlags(type.objectFlags));
|
|
57433
57442
|
}
|
|
@@ -57873,7 +57882,7 @@ ${lanes.join("\n")}
|
|
|
57873
57882
|
if (indexInfo) {
|
|
57874
57883
|
checkFlags |= 32 /* WritePartial */ | (indexInfo.isReadonly ? 8 /* Readonly */ : 0);
|
|
57875
57884
|
indexTypes = append(indexTypes, isTupleType(type) ? getRestTypeOfTupleType(type) || undefinedType : indexInfo.type);
|
|
57876
|
-
} else if (isObjectLiteralType2(type) && !(getObjectFlags(type) &
|
|
57885
|
+
} else if (isObjectLiteralType2(type) && !(getObjectFlags(type) & 4194304 /* ContainsSpread */)) {
|
|
57877
57886
|
checkFlags |= 32 /* WritePartial */;
|
|
57878
57887
|
indexTypes = append(indexTypes, undefinedType);
|
|
57879
57888
|
} else {
|
|
@@ -57999,22 +58008,22 @@ ${lanes.join("\n")}
|
|
|
57999
58008
|
return property && !(getCheckFlags(property) & 16 /* ReadPartial */) ? property : void 0;
|
|
58000
58009
|
}
|
|
58001
58010
|
function getReducedType(type) {
|
|
58002
|
-
if (type.flags & 1048576 /* Union */ && type.objectFlags &
|
|
58011
|
+
if (type.flags & 1048576 /* Union */ && type.objectFlags & 33554432 /* ContainsIntersections */) {
|
|
58003
58012
|
return type.resolvedReducedType || (type.resolvedReducedType = getReducedUnionType(type));
|
|
58004
58013
|
} else if (type.flags & 2097152 /* Intersection */) {
|
|
58005
|
-
if (!(type.objectFlags &
|
|
58006
|
-
type.objectFlags |=
|
|
58014
|
+
if (!(type.objectFlags & 33554432 /* IsNeverIntersectionComputed */)) {
|
|
58015
|
+
type.objectFlags |= 33554432 /* IsNeverIntersectionComputed */ | (some(getPropertiesOfUnionOrIntersectionType(type), isNeverReducedProperty) ? 67108864 /* IsNeverIntersection */ : 0);
|
|
58007
58016
|
}
|
|
58008
|
-
return type.objectFlags &
|
|
58017
|
+
return type.objectFlags & 67108864 /* IsNeverIntersection */ ? neverType : type;
|
|
58009
58018
|
}
|
|
58010
|
-
return type;
|
|
58019
|
+
return getResolvedType(type);
|
|
58011
58020
|
}
|
|
58012
58021
|
function getReducedUnionType(unionType) {
|
|
58013
58022
|
const reducedTypes = sameMap(unionType.types, getReducedType);
|
|
58014
58023
|
if (reducedTypes === unionType.types) {
|
|
58015
58024
|
return unionType;
|
|
58016
58025
|
}
|
|
58017
|
-
const reduced = getUnionType(reducedTypes);
|
|
58026
|
+
const reduced = getResolvedType(getUnionType(reducedTypes));
|
|
58018
58027
|
if (reduced.flags & 1048576 /* Union */) {
|
|
58019
58028
|
reduced.resolvedReducedType = reduced;
|
|
58020
58029
|
}
|
|
@@ -58030,14 +58039,14 @@ ${lanes.join("\n")}
|
|
|
58030
58039
|
return !prop.valueDeclaration && !!(getCheckFlags(prop) & 1024 /* ContainsPrivate */);
|
|
58031
58040
|
}
|
|
58032
58041
|
function isGenericReducibleType(type) {
|
|
58033
|
-
return !!(type.flags & 1048576 /* Union */ && type.objectFlags &
|
|
58042
|
+
return !!(type.flags & 1048576 /* Union */ && type.objectFlags & 33554432 /* ContainsIntersections */ && some(type.types, isGenericReducibleType) || type.flags & 2097152 /* Intersection */ && isReducibleIntersection(type));
|
|
58034
58043
|
}
|
|
58035
58044
|
function isReducibleIntersection(type) {
|
|
58036
58045
|
const uniqueFilled = type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper));
|
|
58037
58046
|
return getReducedType(uniqueFilled) !== uniqueFilled;
|
|
58038
58047
|
}
|
|
58039
58048
|
function elaborateNeverIntersection(errorInfo, type) {
|
|
58040
|
-
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
58049
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsNeverIntersection */) {
|
|
58041
58050
|
const neverProp = find(getPropertiesOfUnionOrIntersectionType(type), isDiscriminantWithNeverType);
|
|
58042
58051
|
if (neverProp) {
|
|
58043
58052
|
return chainDiagnosticMessages(errorInfo, Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents, typeToString(
|
|
@@ -58823,7 +58832,7 @@ ${lanes.join("\n")}
|
|
|
58823
58832
|
result |= getObjectFlags(type);
|
|
58824
58833
|
}
|
|
58825
58834
|
}
|
|
58826
|
-
return result &
|
|
58835
|
+
return result & 917504 /* PropagatingFlags */;
|
|
58827
58836
|
}
|
|
58828
58837
|
function tryCreateTypeReference(target, typeArguments) {
|
|
58829
58838
|
if (some(typeArguments) && target === emptyGenericType) {
|
|
@@ -58910,7 +58919,7 @@ ${lanes.join("\n")}
|
|
|
58910
58919
|
return errorType;
|
|
58911
58920
|
}
|
|
58912
58921
|
}
|
|
58913
|
-
if (node.kind === 183 /* TypeReference */ && isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length)) {
|
|
58922
|
+
if (node.kind === 183 /* TypeReference */ && (getAliasSymbolForTypeNode(node) || isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length))) {
|
|
58914
58923
|
return createDeferredTypeReference(
|
|
58915
58924
|
type,
|
|
58916
58925
|
node,
|
|
@@ -58923,23 +58932,6 @@ ${lanes.join("\n")}
|
|
|
58923
58932
|
}
|
|
58924
58933
|
return checkNoTypeArguments(node, symbol) ? type : errorType;
|
|
58925
58934
|
}
|
|
58926
|
-
function getTypeAliasInstantiation(symbol, typeArguments, aliasSymbol, aliasTypeArguments) {
|
|
58927
|
-
const type = getDeclaredTypeOfSymbol(symbol);
|
|
58928
|
-
if (type === intrinsicMarkerType) {
|
|
58929
|
-
const typeKind = intrinsicTypeKinds.get(symbol.escapedName);
|
|
58930
|
-
if (typeKind !== void 0 && typeArguments && typeArguments.length === 1) {
|
|
58931
|
-
return typeKind === 4 /* NoInfer */ ? getNoInferType(typeArguments[0]) : getStringMappingType(symbol, typeArguments[0]);
|
|
58932
|
-
}
|
|
58933
|
-
}
|
|
58934
|
-
const links = getSymbolLinks(symbol);
|
|
58935
|
-
const typeParameters = links.typeParameters;
|
|
58936
|
-
const id = getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
58937
|
-
let instantiation = links.instantiations.get(id);
|
|
58938
|
-
if (!instantiation) {
|
|
58939
|
-
links.instantiations.set(id, instantiation = instantiateTypeWithAlias(type, createTypeMapper(typeParameters, fillMissingTypeArguments(typeArguments, typeParameters, getMinTypeArgumentCount(typeParameters), isInJSFile(symbol.valueDeclaration))), aliasSymbol, aliasTypeArguments));
|
|
58940
|
-
}
|
|
58941
|
-
return instantiation;
|
|
58942
|
-
}
|
|
58943
58935
|
function getTypeFromTypeAliasReference(node, symbol) {
|
|
58944
58936
|
if (getCheckFlags(symbol) & 1048576 /* Unresolved */) {
|
|
58945
58937
|
const typeArguments = typeArgumentsFromTypeReferenceNode(node);
|
|
@@ -58990,10 +58982,13 @@ ${lanes.join("\n")}
|
|
|
58990
58982
|
const resolved = resolveAlias(aliasSymbol2);
|
|
58991
58983
|
if (resolved && resolved.flags & 524288 /* TypeAlias */) {
|
|
58992
58984
|
newAliasSymbol = resolved;
|
|
58993
|
-
aliasTypeArguments = typeArgumentsFromTypeReferenceNode(node)
|
|
58985
|
+
aliasTypeArguments = typeArgumentsFromTypeReferenceNode(node) ?? [];
|
|
58994
58986
|
}
|
|
58995
58987
|
}
|
|
58996
58988
|
}
|
|
58989
|
+
if (getObjectFlags(type) & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */) && node.kind === 183 /* TypeReference */ && isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length)) {
|
|
58990
|
+
return createDeferredTypeAliasInstantiation(symbol, node, newAliasSymbol, aliasTypeArguments);
|
|
58991
|
+
}
|
|
58997
58992
|
return getTypeAliasInstantiation(symbol, typeArgumentsFromTypeReferenceNode(node), newAliasSymbol, aliasTypeArguments);
|
|
58998
58993
|
}
|
|
58999
58994
|
return checkNoTypeArguments(node, symbol) ? type : errorType;
|
|
@@ -59003,6 +58998,43 @@ ${lanes.join("\n")}
|
|
|
59003
58998
|
const declaration = (_a = symbol.declarations) == null ? void 0 : _a.find(isTypeAlias);
|
|
59004
58999
|
return !!(declaration && getContainingFunction(declaration));
|
|
59005
59000
|
}
|
|
59001
|
+
function getTypeAliasInstantiation(symbol, typeArguments, aliasSymbol, aliasTypeArguments) {
|
|
59002
|
+
const type = getDeclaredTypeOfSymbol(symbol);
|
|
59003
|
+
if (type === intrinsicMarkerType) {
|
|
59004
|
+
const typeKind = intrinsicTypeKinds.get(symbol.escapedName);
|
|
59005
|
+
if (typeKind !== void 0 && typeArguments && typeArguments.length === 1) {
|
|
59006
|
+
return typeKind === 4 /* NoInfer */ ? getNoInferType(typeArguments[0]) : getStringMappingType(symbol, typeArguments[0]);
|
|
59007
|
+
}
|
|
59008
|
+
}
|
|
59009
|
+
const links = getSymbolLinks(symbol);
|
|
59010
|
+
const typeParameters = links.typeParameters;
|
|
59011
|
+
const id = getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
59012
|
+
let instantiation = links.instantiations.get(id);
|
|
59013
|
+
if (!instantiation) {
|
|
59014
|
+
links.instantiations.set(id, instantiation = instantiateTypeWithAlias(type, createTypeMapper(typeParameters, fillMissingTypeArguments(typeArguments, typeParameters, getMinTypeArgumentCount(typeParameters), isInJSFile(symbol.valueDeclaration))), aliasSymbol, aliasTypeArguments));
|
|
59015
|
+
}
|
|
59016
|
+
return instantiation;
|
|
59017
|
+
}
|
|
59018
|
+
function createDeferredTypeAliasInstantiation(typeAlias, node, aliasSymbol, aliasTypeArguments) {
|
|
59019
|
+
const type = getDeclaredTypeOfSymbol(typeAlias);
|
|
59020
|
+
const result = createObjectType(64 /* TypeAliasInstantiation */, type.symbol);
|
|
59021
|
+
result.typeAlias = typeAlias;
|
|
59022
|
+
result.node = node;
|
|
59023
|
+
result.aliasSymbol = aliasSymbol;
|
|
59024
|
+
result.aliasTypeArguments = aliasTypeArguments;
|
|
59025
|
+
return result;
|
|
59026
|
+
}
|
|
59027
|
+
function getResolvedType(type) {
|
|
59028
|
+
return type.flags & 524288 /* Object */ && type.objectFlags & 64 /* TypeAliasInstantiation */ ? getResolvedTypeAliasInstantiation(type) : type;
|
|
59029
|
+
}
|
|
59030
|
+
function getResolvedTypeAliasInstantiation(type) {
|
|
59031
|
+
if (!type.resolvedType) {
|
|
59032
|
+
const typeArguments = typeArgumentsFromTypeReferenceNode(type.node);
|
|
59033
|
+
const mappedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments;
|
|
59034
|
+
type.resolvedType = getTypeAliasInstantiation(type.typeAlias, mappedTypeArguments, type.aliasSymbol, type.aliasTypeArguments);
|
|
59035
|
+
}
|
|
59036
|
+
return type.resolvedType;
|
|
59037
|
+
}
|
|
59006
59038
|
function getTypeReferenceName(node) {
|
|
59007
59039
|
switch (node.kind) {
|
|
59008
59040
|
case 183 /* TypeReference */:
|
|
@@ -59694,7 +59726,7 @@ ${lanes.join("\n")}
|
|
|
59694
59726
|
return isNamedTupleMember(member) || isParameter(member) ? member : void 0;
|
|
59695
59727
|
}
|
|
59696
59728
|
function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) {
|
|
59697
|
-
return
|
|
59729
|
+
return isResolvedByTypeAlias(node) && (node.kind === 188 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : node.kind === 189 /* TupleType */ ? some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || some(node.typeArguments, mayResolveTypeAlias));
|
|
59698
59730
|
}
|
|
59699
59731
|
function isResolvedByTypeAlias(node) {
|
|
59700
59732
|
const parent2 = node.parent;
|
|
@@ -59749,7 +59781,7 @@ ${lanes.join("\n")}
|
|
|
59749
59781
|
const target = getArrayOrTupleTargetType(node);
|
|
59750
59782
|
if (target === emptyGenericType) {
|
|
59751
59783
|
links.resolvedType = emptyObjectType;
|
|
59752
|
-
} else if (!(node.kind === 189 /* TupleType */ && some(node.elements, (e) => !!(getTupleElementFlags(e) & 8 /* Variadic */))) && isDeferredTypeReferenceNode(node)) {
|
|
59784
|
+
} else if (!(node.kind === 189 /* TupleType */ && some(node.elements, (e) => !!(getTupleElementFlags(e) & 8 /* Variadic */))) && (getAliasSymbolForTypeNode(node) || isDeferredTypeReferenceNode(node))) {
|
|
59753
59785
|
links.resolvedType = node.kind === 189 /* TupleType */ && node.elements.length === 0 ? target : createDeferredTypeReference(
|
|
59754
59786
|
target,
|
|
59755
59787
|
node,
|
|
@@ -59969,12 +60001,12 @@ ${lanes.join("\n")}
|
|
|
59969
60001
|
includes |= flags & 473694207 /* IncludesMask */;
|
|
59970
60002
|
if (flags & 465829888 /* Instantiable */)
|
|
59971
60003
|
includes |= 33554432 /* IncludesInstantiable */;
|
|
59972
|
-
if (flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
60004
|
+
if (flags & 2097152 /* Intersection */ && getObjectFlags(type) & 134217728 /* IsConstrainedTypeVariable */)
|
|
59973
60005
|
includes |= 536870912 /* IncludesConstrainedTypeVariable */;
|
|
59974
60006
|
if (type === wildcardType)
|
|
59975
60007
|
includes |= 8388608 /* IncludesWildcard */;
|
|
59976
60008
|
if (!strictNullChecks && flags & 98304 /* Nullable */) {
|
|
59977
|
-
if (!(getObjectFlags(type) &
|
|
60009
|
+
if (!(getObjectFlags(type) & 131072 /* ContainsWideningType */))
|
|
59978
60010
|
includes |= 4194304 /* IncludesNonWideningType */;
|
|
59979
60011
|
} else {
|
|
59980
60012
|
const len = typeSet.length;
|
|
@@ -60081,7 +60113,7 @@ ${lanes.join("\n")}
|
|
|
60081
60113
|
function removeConstrainedTypeVariables(types) {
|
|
60082
60114
|
const typeVariables = [];
|
|
60083
60115
|
for (const type of types) {
|
|
60084
|
-
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
60116
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 134217728 /* IsConstrainedTypeVariable */) {
|
|
60085
60117
|
const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
60086
60118
|
pushIfUnique(typeVariables, type.types[index]);
|
|
60087
60119
|
}
|
|
@@ -60089,7 +60121,7 @@ ${lanes.join("\n")}
|
|
|
60089
60121
|
for (const typeVariable of typeVariables) {
|
|
60090
60122
|
const primitives = [];
|
|
60091
60123
|
for (const type of types) {
|
|
60092
|
-
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
60124
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 134217728 /* IsConstrainedTypeVariable */) {
|
|
60093
60125
|
const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
60094
60126
|
if (type.types[index] === typeVariable) {
|
|
60095
60127
|
insertType(primitives, type.types[1 - index]);
|
|
@@ -60102,7 +60134,7 @@ ${lanes.join("\n")}
|
|
|
60102
60134
|
while (i > 0) {
|
|
60103
60135
|
i--;
|
|
60104
60136
|
const type = types[i];
|
|
60105
|
-
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
60137
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 134217728 /* IsConstrainedTypeVariable */) {
|
|
60106
60138
|
const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
60107
60139
|
if (type.types[index] === typeVariable && containsType(primitives, type.types[1 - index])) {
|
|
60108
60140
|
orderedRemoveItemAt(types, i);
|
|
@@ -60211,7 +60243,7 @@ ${lanes.join("\n")}
|
|
|
60211
60243
|
origin = createOriginUnionOrIntersectionType(1048576 /* Union */, reducedTypes);
|
|
60212
60244
|
}
|
|
60213
60245
|
}
|
|
60214
|
-
const objectFlags = (includes & 36323331 /* NotPrimitiveUnion */ ? 0 :
|
|
60246
|
+
const objectFlags = (includes & 36323331 /* NotPrimitiveUnion */ ? 0 : 65536 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 33554432 /* ContainsIntersections */ : 0);
|
|
60215
60247
|
return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments, origin);
|
|
60216
60248
|
}
|
|
60217
60249
|
function getUnionOrIntersectionTypePredicate(signatures, kind) {
|
|
@@ -60362,14 +60394,14 @@ ${lanes.join("\n")}
|
|
|
60362
60394
|
}
|
|
60363
60395
|
function intersectUnionsOfPrimitiveTypes(types) {
|
|
60364
60396
|
let unionTypes2;
|
|
60365
|
-
const index = findIndex(types, (t) => !!(getObjectFlags(t) &
|
|
60397
|
+
const index = findIndex(types, (t) => !!(getObjectFlags(t) & 65536 /* PrimitiveUnion */));
|
|
60366
60398
|
if (index < 0) {
|
|
60367
60399
|
return false;
|
|
60368
60400
|
}
|
|
60369
60401
|
let i = index + 1;
|
|
60370
60402
|
while (i < types.length) {
|
|
60371
60403
|
const t = types[i];
|
|
60372
|
-
if (getObjectFlags(t) &
|
|
60404
|
+
if (getObjectFlags(t) & 65536 /* PrimitiveUnion */) {
|
|
60373
60405
|
(unionTypes2 || (unionTypes2 = [types[index]])).push(t);
|
|
60374
60406
|
orderedRemoveItemAt(types, i);
|
|
60375
60407
|
} else {
|
|
@@ -60390,7 +60422,7 @@ ${lanes.join("\n")}
|
|
|
60390
60422
|
}
|
|
60391
60423
|
}
|
|
60392
60424
|
}
|
|
60393
|
-
types[index] = getUnionTypeFromSortedList(result,
|
|
60425
|
+
types[index] = getUnionTypeFromSortedList(result, 65536 /* PrimitiveUnion */);
|
|
60394
60426
|
return true;
|
|
60395
60427
|
}
|
|
60396
60428
|
function createIntersectionType(types, objectFlags, aliasSymbol, aliasTypeArguments) {
|
|
@@ -60453,7 +60485,7 @@ ${lanes.join("\n")}
|
|
|
60453
60485
|
return neverType;
|
|
60454
60486
|
}
|
|
60455
60487
|
}
|
|
60456
|
-
objectFlags =
|
|
60488
|
+
objectFlags = 134217728 /* IsConstrainedTypeVariable */;
|
|
60457
60489
|
}
|
|
60458
60490
|
}
|
|
60459
60491
|
}
|
|
@@ -60806,7 +60838,7 @@ ${lanes.join("\n")}
|
|
|
60806
60838
|
if (noImplicitAny) {
|
|
60807
60839
|
return false;
|
|
60808
60840
|
}
|
|
60809
|
-
if (getObjectFlags(type) &
|
|
60841
|
+
if (getObjectFlags(type) & 8192 /* JSLiteral */) {
|
|
60810
60842
|
return true;
|
|
60811
60843
|
}
|
|
60812
60844
|
if (type.flags & 1048576 /* Union */) {
|
|
@@ -61054,28 +61086,28 @@ ${lanes.join("\n")}
|
|
|
61054
61086
|
return !!getGenericObjectFlags(type);
|
|
61055
61087
|
}
|
|
61056
61088
|
function isGenericObjectType(type) {
|
|
61057
|
-
return !!(getGenericObjectFlags(type) &
|
|
61089
|
+
return !!(getGenericObjectFlags(type) & 8388608 /* IsGenericObjectType */);
|
|
61058
61090
|
}
|
|
61059
61091
|
function isGenericIndexType(type) {
|
|
61060
|
-
return !!(getGenericObjectFlags(type) &
|
|
61092
|
+
return !!(getGenericObjectFlags(type) & 16777216 /* IsGenericIndexType */);
|
|
61061
61093
|
}
|
|
61062
61094
|
function getGenericObjectFlags(type) {
|
|
61063
61095
|
if (type.flags & 3145728 /* UnionOrIntersection */) {
|
|
61064
|
-
if (!(type.objectFlags &
|
|
61065
|
-
type.objectFlags |=
|
|
61096
|
+
if (!(type.objectFlags & 4194304 /* IsGenericTypeComputed */)) {
|
|
61097
|
+
type.objectFlags |= 4194304 /* IsGenericTypeComputed */ | reduceLeft(type.types, (flags, t) => flags | getGenericObjectFlags(t), 0);
|
|
61066
61098
|
}
|
|
61067
|
-
return type.objectFlags &
|
|
61099
|
+
return type.objectFlags & 25165824 /* IsGenericType */;
|
|
61068
61100
|
}
|
|
61069
61101
|
if (type.flags & 33554432 /* Substitution */) {
|
|
61070
|
-
if (!(type.objectFlags &
|
|
61071
|
-
type.objectFlags |=
|
|
61102
|
+
if (!(type.objectFlags & 4194304 /* IsGenericTypeComputed */)) {
|
|
61103
|
+
type.objectFlags |= 4194304 /* IsGenericTypeComputed */ | getGenericObjectFlags(type.baseType) | getGenericObjectFlags(type.constraint);
|
|
61072
61104
|
}
|
|
61073
|
-
return type.objectFlags &
|
|
61105
|
+
return type.objectFlags & 25165824 /* IsGenericType */;
|
|
61074
61106
|
}
|
|
61075
|
-
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ?
|
|
61107
|
+
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(getResolvedType(type)) || isGenericTupleType(type) ? 8388608 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 16777216 /* IsGenericIndexType */ : 0);
|
|
61076
61108
|
}
|
|
61077
61109
|
function getSimplifiedType(type, writing) {
|
|
61078
|
-
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : type;
|
|
61110
|
+
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : getResolvedType(type);
|
|
61079
61111
|
}
|
|
61080
61112
|
function distributeIndexOverObjectType(objectType, indexType, writing) {
|
|
61081
61113
|
if (objectType.flags & 1048576 /* Union */ || objectType.flags & 2097152 /* Intersection */ && !shouldDeferIndexType(objectType)) {
|
|
@@ -61575,7 +61607,7 @@ ${lanes.join("\n")}
|
|
|
61575
61607
|
}
|
|
61576
61608
|
}
|
|
61577
61609
|
const spread = createAnonymousType(type2.symbol, members, emptyArray, emptyArray, getIndexInfosOfType(type2));
|
|
61578
|
-
spread.objectFlags |=
|
|
61610
|
+
spread.objectFlags |= 256 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
|
|
61579
61611
|
return spread;
|
|
61580
61612
|
}
|
|
61581
61613
|
}
|
|
@@ -61652,7 +61684,7 @@ ${lanes.join("\n")}
|
|
|
61652
61684
|
}
|
|
61653
61685
|
}
|
|
61654
61686
|
const spread = createAnonymousType(symbol, members, emptyArray, emptyArray, sameMap(indexInfos, (info) => getIndexInfoWithReadonly(info, readonly)));
|
|
61655
|
-
spread.objectFlags |=
|
|
61687
|
+
spread.objectFlags |= 256 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */ | 4194304 /* ContainsSpread */ | objectFlags;
|
|
61656
61688
|
return spread;
|
|
61657
61689
|
}
|
|
61658
61690
|
function isSpreadableProperty(prop) {
|
|
@@ -62073,9 +62105,9 @@ ${lanes.join("\n")}
|
|
|
62073
62105
|
return result;
|
|
62074
62106
|
}
|
|
62075
62107
|
function getObjectTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
62076
|
-
const declaration = type.objectFlags & 4 /* Reference */ ? type.node : type.objectFlags &
|
|
62108
|
+
const declaration = type.objectFlags & 4 /* Reference */ ? type.node : type.objectFlags & 16777216 /* InstantiationExpressionType */ ? type.node : type.objectFlags & 64 /* TypeAliasInstantiation */ ? type.node : type.symbol.declarations[0];
|
|
62077
62109
|
const links = getNodeLinks(declaration);
|
|
62078
|
-
const target = type.objectFlags & 4 /* Reference */ ? links.resolvedType : type.objectFlags &
|
|
62110
|
+
const target = type.objectFlags & 4 /* Reference */ ? links.resolvedType : type.objectFlags & 128 /* Instantiated */ ? type.target : type;
|
|
62079
62111
|
let typeParameters = links.outerTypeParameters;
|
|
62080
62112
|
if (!typeParameters) {
|
|
62081
62113
|
let outerTypeParameters = getOuterTypeParameters(
|
|
@@ -62088,8 +62120,8 @@ ${lanes.join("\n")}
|
|
|
62088
62120
|
outerTypeParameters = addRange(outerTypeParameters, templateTagParameters);
|
|
62089
62121
|
}
|
|
62090
62122
|
typeParameters = outerTypeParameters || emptyArray;
|
|
62091
|
-
const allDeclarations = type.objectFlags & (4 /* Reference */ |
|
|
62092
|
-
typeParameters = (target.objectFlags & (4 /* Reference */ |
|
|
62123
|
+
const allDeclarations = type.objectFlags & (4 /* Reference */ | 16777216 /* InstantiationExpressionType */ | 64 /* TypeAliasInstantiation */) ? [declaration] : type.symbol.declarations;
|
|
62124
|
+
typeParameters = (target.objectFlags & (4 /* Reference */ | 16777216 /* InstantiationExpressionType */ | 64 /* TypeAliasInstantiation */) || target.symbol.flags & 8192 /* Method */ || target.symbol.flags & 2048 /* TypeLiteral */) && !target.aliasTypeArguments ? filter(typeParameters, (tp) => some(allDeclarations, (d) => isTypeParameterPossiblyReferenced(tp, d))) : typeParameters;
|
|
62093
62125
|
links.outerTypeParameters = typeParameters;
|
|
62094
62126
|
}
|
|
62095
62127
|
if (typeParameters.length) {
|
|
@@ -62108,13 +62140,13 @@ ${lanes.join("\n")}
|
|
|
62108
62140
|
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);
|
|
62109
62141
|
target.instantiations.set(id, result);
|
|
62110
62142
|
const resultObjectFlags = getObjectFlags(result);
|
|
62111
|
-
if (result.flags & 3899393 /* ObjectFlagsType */ && !(resultObjectFlags &
|
|
62143
|
+
if (result.flags & 3899393 /* ObjectFlagsType */ && !(resultObjectFlags & 1048576 /* CouldContainTypeVariablesComputed */)) {
|
|
62112
62144
|
const resultCouldContainTypeVariables = some(typeArguments, couldContainTypeVariables);
|
|
62113
|
-
if (!(getObjectFlags(result) &
|
|
62145
|
+
if (!(getObjectFlags(result) & 1048576 /* CouldContainTypeVariablesComputed */)) {
|
|
62114
62146
|
if (resultObjectFlags & (32 /* Mapped */ | 16 /* Anonymous */ | 4 /* Reference */)) {
|
|
62115
|
-
result.objectFlags |=
|
|
62147
|
+
result.objectFlags |= 1048576 /* CouldContainTypeVariablesComputed */ | (resultCouldContainTypeVariables ? 2097152 /* CouldContainTypeVariables */ : 0);
|
|
62116
62148
|
} else {
|
|
62117
|
-
result.objectFlags |= !resultCouldContainTypeVariables ?
|
|
62149
|
+
result.objectFlags |= !resultCouldContainTypeVariables ? 1048576 /* CouldContainTypeVariablesComputed */ : 0;
|
|
62118
62150
|
}
|
|
62119
62151
|
}
|
|
62120
62152
|
}
|
|
@@ -62244,8 +62276,7 @@ ${lanes.join("\n")}
|
|
|
62244
62276
|
) : strictNullChecks && modifiers & 8 /* ExcludeOptional */ && isOptional ? getTypeWithFacts(propType, 524288 /* NEUndefined */) : propType;
|
|
62245
62277
|
}
|
|
62246
62278
|
function instantiateAnonymousType(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
62247
|
-
|
|
62248
|
-
const result = createObjectType(type.objectFlags & ~(524288 /* CouldContainTypeVariablesComputed */ | 1048576 /* CouldContainTypeVariables */) | 64 /* Instantiated */, type.symbol);
|
|
62279
|
+
const result = createObjectType(type.objectFlags & ~(1048576 /* CouldContainTypeVariablesComputed */ | 2097152 /* CouldContainTypeVariables */) | 128 /* Instantiated */, type.symbol);
|
|
62249
62280
|
if (type.objectFlags & 32 /* Mapped */) {
|
|
62250
62281
|
result.declaration = type.declaration;
|
|
62251
62282
|
const origTypeParameter = getTypeParameterFromMappedType(type);
|
|
@@ -62253,8 +62284,10 @@ ${lanes.join("\n")}
|
|
|
62253
62284
|
result.typeParameter = freshTypeParameter;
|
|
62254
62285
|
mapper = combineTypeMappers(makeUnaryTypeMapper(origTypeParameter, freshTypeParameter), mapper);
|
|
62255
62286
|
freshTypeParameter.mapper = mapper;
|
|
62256
|
-
}
|
|
62257
|
-
|
|
62287
|
+
} else if (type.objectFlags & 16777216 /* InstantiationExpressionType */) {
|
|
62288
|
+
result.node = type.node;
|
|
62289
|
+
} else if (type.objectFlags & 64 /* TypeAliasInstantiation */) {
|
|
62290
|
+
result.typeAlias = type.typeAlias;
|
|
62258
62291
|
result.node = type.node;
|
|
62259
62292
|
}
|
|
62260
62293
|
result.target = type;
|
|
@@ -62315,13 +62348,13 @@ ${lanes.join("\n")}
|
|
|
62315
62348
|
}
|
|
62316
62349
|
if (flags & 524288 /* Object */) {
|
|
62317
62350
|
const objectFlags = type.objectFlags;
|
|
62318
|
-
if (objectFlags & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */)) {
|
|
62351
|
+
if (objectFlags & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */ | 64 /* TypeAliasInstantiation */)) {
|
|
62319
62352
|
if (objectFlags & 4 /* Reference */ && !type.node) {
|
|
62320
62353
|
const resolvedTypeArguments = type.resolvedTypeArguments;
|
|
62321
62354
|
const newTypeArguments = instantiateTypes(resolvedTypeArguments, mapper);
|
|
62322
62355
|
return newTypeArguments !== resolvedTypeArguments ? createNormalizedTypeReference(type.target, newTypeArguments) : type;
|
|
62323
62356
|
}
|
|
62324
|
-
if (objectFlags &
|
|
62357
|
+
if (objectFlags & 2048 /* ReverseMapped */) {
|
|
62325
62358
|
return instantiateReverseMappedType(type, mapper);
|
|
62326
62359
|
}
|
|
62327
62360
|
return getObjectTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments);
|
|
@@ -63257,11 +63290,11 @@ ${lanes.join("\n")}
|
|
|
63257
63290
|
}
|
|
63258
63291
|
function isUnknownLikeUnionType(type) {
|
|
63259
63292
|
if (strictNullChecks && type.flags & 1048576 /* Union */) {
|
|
63260
|
-
if (!(type.objectFlags &
|
|
63293
|
+
if (!(type.objectFlags & 67108864 /* IsUnknownLikeUnionComputed */)) {
|
|
63261
63294
|
const types = type.types;
|
|
63262
|
-
type.objectFlags |=
|
|
63295
|
+
type.objectFlags |= 67108864 /* IsUnknownLikeUnionComputed */ | (types.length >= 3 && types[0].flags & 32768 /* Undefined */ && types[1].flags & 65536 /* Null */ && some(types, isEmptyAnonymousObjectType) ? 134217728 /* IsUnknownLikeUnion */ : 0);
|
|
63263
63296
|
}
|
|
63264
|
-
return !!(type.objectFlags &
|
|
63297
|
+
return !!(type.objectFlags & 134217728 /* IsUnknownLikeUnion */);
|
|
63265
63298
|
}
|
|
63266
63299
|
return false;
|
|
63267
63300
|
}
|
|
@@ -63372,7 +63405,7 @@ ${lanes.join("\n")}
|
|
|
63372
63405
|
return true;
|
|
63373
63406
|
if (s & 65536 /* Null */ && (!strictNullChecks && !(t & 3145728 /* UnionOrIntersection */) || t & 65536 /* Null */))
|
|
63374
63407
|
return true;
|
|
63375
|
-
if (s & 524288 /* Object */ && t & 67108864 /* NonPrimitive */ && !(relation === strictSubtypeRelation && isEmptyAnonymousObjectType(source) && !(getObjectFlags(source) &
|
|
63408
|
+
if (s & 524288 /* Object */ && t & 67108864 /* NonPrimitive */ && !(relation === strictSubtypeRelation && isEmptyAnonymousObjectType(source) && !(getObjectFlags(source) & 16384 /* FreshLiteral */)))
|
|
63376
63409
|
return true;
|
|
63377
63410
|
if (relation === assignableRelation || relation === comparableRelation) {
|
|
63378
63411
|
if (s & 1 /* Any */)
|
|
@@ -63431,11 +63464,11 @@ ${lanes.join("\n")}
|
|
|
63431
63464
|
return false;
|
|
63432
63465
|
}
|
|
63433
63466
|
function isIgnoredJsxProperty(source, sourceProp) {
|
|
63434
|
-
return getObjectFlags(source) &
|
|
63467
|
+
return getObjectFlags(source) & 4096 /* JsxAttributes */ && isHyphenatedJsxName(sourceProp.escapedName);
|
|
63435
63468
|
}
|
|
63436
63469
|
function getNormalizedType(type, writing) {
|
|
63437
63470
|
while (true) {
|
|
63438
|
-
const t = isFreshLiteralType(type) ? type.regularType : isGenericTupleType(type) ? getNormalizedTupleType(type, writing) : getObjectFlags(type) & 4 /* Reference */ ? type.node ? createTypeReference(type.target, getTypeArguments(type)) : getSingleBaseForNonAugmentingSubtype(type) || type : type.flags & 3145728 /* UnionOrIntersection */ ? getNormalizedUnionOrIntersectionType(type, writing) : type.flags & 33554432 /* Substitution */ ? writing ? type.baseType : getSubstitutionIntersection(type) : type.flags & 25165824 /* Simplifiable */ ? getSimplifiedType(type, writing) : type;
|
|
63471
|
+
const t = isFreshLiteralType(type) ? type.regularType : isGenericTupleType(type) ? getNormalizedTupleType(type, writing) : getObjectFlags(type) & 4 /* Reference */ ? type.node ? createTypeReference(type.target, getTypeArguments(type)) : getSingleBaseForNonAugmentingSubtype(type) || type : getObjectFlags(type) & 64 /* TypeAliasInstantiation */ ? getResolvedTypeAliasInstantiation(type) : type.flags & 3145728 /* UnionOrIntersection */ ? getNormalizedUnionOrIntersectionType(type, writing) : type.flags & 33554432 /* Substitution */ ? writing ? type.baseType : getSubstitutionIntersection(type) : type.flags & 25165824 /* Simplifiable */ ? getSimplifiedType(type, writing) : type;
|
|
63439
63472
|
if (t === type)
|
|
63440
63473
|
return t;
|
|
63441
63474
|
type = t;
|
|
@@ -63825,7 +63858,7 @@ ${lanes.join("\n")}
|
|
|
63825
63858
|
if (relation === comparableRelation && !(target2.flags & 131072 /* Never */) && isSimpleTypeRelatedTo(target2, source2, relation) || isSimpleTypeRelatedTo(source2, target2, relation, reportErrors2 ? reportError : void 0))
|
|
63826
63859
|
return -1 /* True */;
|
|
63827
63860
|
if (source2.flags & 469499904 /* StructuredOrInstantiable */ || target2.flags & 469499904 /* StructuredOrInstantiable */) {
|
|
63828
|
-
const isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType2(source2) && getObjectFlags(source2) &
|
|
63861
|
+
const isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType2(source2) && getObjectFlags(source2) & 16384 /* FreshLiteral */);
|
|
63829
63862
|
if (isPerformingExcessPropertyChecks) {
|
|
63830
63863
|
if (hasExcessProperties(source2, target2, reportErrors2)) {
|
|
63831
63864
|
if (reportErrors2) {
|
|
@@ -63835,7 +63868,7 @@ ${lanes.join("\n")}
|
|
|
63835
63868
|
}
|
|
63836
63869
|
}
|
|
63837
63870
|
const isPerformingCommonPropertyChecks = (relation !== comparableRelation || isUnitType(source2)) && !(intersectionState & 2 /* Target */) && source2.flags & (402784252 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source2 !== globalObjectType && target2.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target2) && (getPropertiesOfType(source2).length > 0 || typeHasCallOrConstructSignatures(source2));
|
|
63838
|
-
const isComparingJsxAttributes = !!(getObjectFlags(source2) &
|
|
63871
|
+
const isComparingJsxAttributes = !!(getObjectFlags(source2) & 4096 /* JsxAttributes */);
|
|
63839
63872
|
if (isPerformingCommonPropertyChecks && !hasCommonProperties(source2, target2, isComparingJsxAttributes)) {
|
|
63840
63873
|
if (reportErrors2) {
|
|
63841
63874
|
const sourceString = typeToString(originalSource.aliasSymbol ? originalSource : source2);
|
|
@@ -63900,7 +63933,7 @@ ${lanes.join("\n")}
|
|
|
63900
63933
|
tryElaborateErrorsForPrimitivesAndObjects(source2, target2);
|
|
63901
63934
|
} else if (source2.symbol && source2.flags & 524288 /* Object */ && globalObjectType === source2) {
|
|
63902
63935
|
reportError(Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
|
|
63903
|
-
} else if (getObjectFlags(source2) &
|
|
63936
|
+
} else if (getObjectFlags(source2) & 4096 /* JsxAttributes */ && target2.flags & 2097152 /* Intersection */) {
|
|
63904
63937
|
const targetTypes = target2.types;
|
|
63905
63938
|
const intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
|
|
63906
63939
|
const intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
|
|
@@ -63931,7 +63964,7 @@ ${lanes.join("\n")}
|
|
|
63931
63964
|
if (source2.flags & 3145728 /* UnionOrIntersection */ && target2.flags & 3145728 /* UnionOrIntersection */) {
|
|
63932
63965
|
const sourceUnionOrIntersection = source2;
|
|
63933
63966
|
const targetUnionOrIntersection = target2;
|
|
63934
|
-
if (sourceUnionOrIntersection.objectFlags & targetUnionOrIntersection.objectFlags &
|
|
63967
|
+
if (sourceUnionOrIntersection.objectFlags & targetUnionOrIntersection.objectFlags & 65536 /* PrimitiveUnion */) {
|
|
63935
63968
|
return;
|
|
63936
63969
|
}
|
|
63937
63970
|
const sourceSize = sourceUnionOrIntersection.types.length;
|
|
@@ -63965,10 +63998,10 @@ ${lanes.join("\n")}
|
|
|
63965
63998
|
}
|
|
63966
63999
|
function hasExcessProperties(source2, target2, reportErrors2) {
|
|
63967
64000
|
var _a2;
|
|
63968
|
-
if (!isExcessPropertyCheckTarget(target2) || !noImplicitAny && getObjectFlags(target2) &
|
|
64001
|
+
if (!isExcessPropertyCheckTarget(target2) || !noImplicitAny && getObjectFlags(target2) & 8192 /* JSLiteral */) {
|
|
63969
64002
|
return false;
|
|
63970
64003
|
}
|
|
63971
|
-
const isComparingJsxAttributes = !!(getObjectFlags(source2) &
|
|
64004
|
+
const isComparingJsxAttributes = !!(getObjectFlags(source2) & 4096 /* JsxAttributes */);
|
|
63972
64005
|
if ((relation === assignableRelation || relation === comparableRelation) && (isTypeSubsetOf(globalObjectType, target2) || !isComparingJsxAttributes && isEmptyObjectType(target2))) {
|
|
63973
64006
|
return false;
|
|
63974
64007
|
}
|
|
@@ -64107,7 +64140,7 @@ ${lanes.join("\n")}
|
|
|
64107
64140
|
if (containsType(targetTypes, source2)) {
|
|
64108
64141
|
return -1 /* True */;
|
|
64109
64142
|
}
|
|
64110
|
-
if (relation !== comparableRelation && getObjectFlags(target2) &
|
|
64143
|
+
if (relation !== comparableRelation && getObjectFlags(target2) & 65536 /* PrimitiveUnion */ && !(source2.flags & 1024 /* EnumLiteral */) && (source2.flags & (128 /* StringLiteral */ | 512 /* BooleanLiteral */ | 2048 /* BigIntLiteral */) || (relation === subtypeRelation || relation === strictSubtypeRelation) && source2.flags & 256 /* NumberLiteral */)) {
|
|
64111
64144
|
const alternateForm = source2 === source2.regularType ? source2.freshType : source2.regularType;
|
|
64112
64145
|
const primitive = source2.flags & 128 /* StringLiteral */ ? stringType : source2.flags & 256 /* NumberLiteral */ ? numberType : source2.flags & 2048 /* BigIntLiteral */ ? bigintType : void 0;
|
|
64113
64146
|
return primitive && containsType(targetTypes, primitive) || alternateForm && containsType(targetTypes, alternateForm) ? -1 /* True */ : 0 /* False */;
|
|
@@ -64511,7 +64544,7 @@ ${lanes.join("\n")}
|
|
|
64511
64544
|
false,
|
|
64512
64545
|
0 /* None */
|
|
64513
64546
|
);
|
|
64514
|
-
if (result2 && isObjectLiteralType2(source2) && getObjectFlags(source2) &
|
|
64547
|
+
if (result2 && isObjectLiteralType2(source2) && getObjectFlags(source2) & 16384 /* FreshLiteral */) {
|
|
64515
64548
|
result2 &= indexSignaturesRelatedTo(
|
|
64516
64549
|
source2,
|
|
64517
64550
|
target2,
|
|
@@ -64521,7 +64554,7 @@ ${lanes.join("\n")}
|
|
|
64521
64554
|
0 /* None */
|
|
64522
64555
|
);
|
|
64523
64556
|
}
|
|
64524
|
-
} else if (result2 && isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => t === target2 || !!(getObjectFlags(t) &
|
|
64557
|
+
} else if (result2 && isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => t === target2 || !!(getObjectFlags(t) & 524288 /* NonInferrableType */))) {
|
|
64525
64558
|
result2 &= propertiesRelatedTo(
|
|
64526
64559
|
source2,
|
|
64527
64560
|
target2,
|
|
@@ -65022,7 +65055,7 @@ ${lanes.join("\n")}
|
|
|
65022
65055
|
if (constraint !== source2) {
|
|
65023
65056
|
return isRelatedTo(constraint, target2, 1 /* Source */, reportErrors2);
|
|
65024
65057
|
}
|
|
65025
|
-
} else if ((relation === subtypeRelation || relation === strictSubtypeRelation) && isEmptyObjectType(target2) && getObjectFlags(target2) &
|
|
65058
|
+
} else if ((relation === subtypeRelation || relation === strictSubtypeRelation) && isEmptyObjectType(target2) && getObjectFlags(target2) & 16384 /* FreshLiteral */ && !isEmptyObjectType(source2)) {
|
|
65026
65059
|
return 0 /* False */;
|
|
65027
65060
|
}
|
|
65028
65061
|
if (sourceFlags & (524288 /* Object */ | 2097152 /* Intersection */) && targetFlags & 524288 /* Object */) {
|
|
@@ -65554,7 +65587,7 @@ ${lanes.join("\n")}
|
|
|
65554
65587
|
const incompatibleReporter = kind === 1 /* Construct */ ? reportIncompatibleConstructSignatureReturn : reportIncompatibleCallSignatureReturn;
|
|
65555
65588
|
const sourceObjectFlags = getObjectFlags(source2);
|
|
65556
65589
|
const targetObjectFlags = getObjectFlags(target2);
|
|
65557
|
-
if (sourceObjectFlags &
|
|
65590
|
+
if (sourceObjectFlags & 128 /* Instantiated */ && targetObjectFlags & 128 /* Instantiated */ && source2.symbol === target2.symbol || sourceObjectFlags & 4 /* Reference */ && targetObjectFlags & 4 /* Reference */ && source2.target === target2.target) {
|
|
65558
65591
|
Debug.assertEqual(sourceSignatures.length, targetSignatures.length);
|
|
65559
65592
|
for (let i = 0; i < targetSignatures.length; i++) {
|
|
65560
65593
|
const related = signatureRelatedTo(
|
|
@@ -65770,7 +65803,7 @@ ${lanes.join("\n")}
|
|
|
65770
65803
|
if (sourceInfo) {
|
|
65771
65804
|
return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2, intersectionState);
|
|
65772
65805
|
}
|
|
65773
|
-
if (!(intersectionState & 1 /* Source */) && (relation !== strictSubtypeRelation || getObjectFlags(source2) &
|
|
65806
|
+
if (!(intersectionState & 1 /* Source */) && (relation !== strictSubtypeRelation || getObjectFlags(source2) & 16384 /* FreshLiteral */) && isObjectTypeWithInferableIndex(source2)) {
|
|
65774
65807
|
return membersRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState);
|
|
65775
65808
|
}
|
|
65776
65809
|
if (reportErrors2) {
|
|
@@ -66044,11 +66077,11 @@ ${lanes.join("\n")}
|
|
|
66044
66077
|
}
|
|
66045
66078
|
function isDeeplyNestedType(type, stack, depth, maxDepth = 3) {
|
|
66046
66079
|
if (depth >= maxDepth) {
|
|
66047
|
-
if ((getObjectFlags(type) &
|
|
66080
|
+
if ((getObjectFlags(type) & 160 /* InstantiatedMapped */) === 160 /* InstantiatedMapped */) {
|
|
66048
66081
|
type = getMappedTargetWithSymbol(type);
|
|
66049
66082
|
}
|
|
66050
66083
|
if (type.flags & 2097152 /* Intersection */) {
|
|
66051
|
-
return some(type.types, (t) => isDeeplyNestedType(t, stack, depth, maxDepth));
|
|
66084
|
+
return some(type.types, (t) => isDeeplyNestedType(getResolvedType(t), stack, depth, maxDepth));
|
|
66052
66085
|
}
|
|
66053
66086
|
const identity2 = getRecursionIdentity(type);
|
|
66054
66087
|
let count = 0;
|
|
@@ -66070,17 +66103,17 @@ ${lanes.join("\n")}
|
|
|
66070
66103
|
}
|
|
66071
66104
|
function getMappedTargetWithSymbol(type) {
|
|
66072
66105
|
let target;
|
|
66073
|
-
while ((getObjectFlags(type) &
|
|
66106
|
+
while ((getObjectFlags(type) & 160 /* InstantiatedMapped */) === 160 /* InstantiatedMapped */ && (target = getModifiersTypeFromMappedType(type)) && (target.symbol || target.flags & 2097152 /* Intersection */ && some(target.types, (t) => !!t.symbol))) {
|
|
66074
66107
|
type = target;
|
|
66075
66108
|
}
|
|
66076
66109
|
return type;
|
|
66077
66110
|
}
|
|
66078
66111
|
function hasMatchingRecursionIdentity(type, identity2) {
|
|
66079
|
-
if ((getObjectFlags(type) &
|
|
66112
|
+
if ((getObjectFlags(type) & 160 /* InstantiatedMapped */) === 160 /* InstantiatedMapped */) {
|
|
66080
66113
|
type = getMappedTargetWithSymbol(type);
|
|
66081
66114
|
}
|
|
66082
66115
|
if (type.flags & 2097152 /* Intersection */) {
|
|
66083
|
-
return some(type.types, (t) => hasMatchingRecursionIdentity(t, identity2));
|
|
66116
|
+
return some(type.types, (t) => hasMatchingRecursionIdentity(getResolvedType(t), identity2));
|
|
66084
66117
|
}
|
|
66085
66118
|
return getRecursionIdentity(type) === identity2;
|
|
66086
66119
|
}
|
|
@@ -66263,10 +66296,10 @@ ${lanes.join("\n")}
|
|
|
66263
66296
|
if (!(getObjectFlags(type) & 4 /* Reference */) || !(getObjectFlags(type.target) & 3 /* ClassOrInterface */)) {
|
|
66264
66297
|
return void 0;
|
|
66265
66298
|
}
|
|
66266
|
-
if (getObjectFlags(type) &
|
|
66267
|
-
return getObjectFlags(type) &
|
|
66299
|
+
if (getObjectFlags(type) & 67108864 /* IdenticalBaseTypeCalculated */) {
|
|
66300
|
+
return getObjectFlags(type) & 134217728 /* IdenticalBaseTypeExists */ ? type.cachedEquivalentBaseType : void 0;
|
|
66268
66301
|
}
|
|
66269
|
-
type.objectFlags |=
|
|
66302
|
+
type.objectFlags |= 67108864 /* IdenticalBaseTypeCalculated */;
|
|
66270
66303
|
const target = type.target;
|
|
66271
66304
|
if (getObjectFlags(target) & 1 /* Class */) {
|
|
66272
66305
|
const baseTypeNode = getBaseTypeNodeOfClass(target);
|
|
@@ -66285,7 +66318,7 @@ ${lanes.join("\n")}
|
|
|
66285
66318
|
if (length(getTypeArguments(type)) > length(target.typeParameters)) {
|
|
66286
66319
|
instantiatedBase = getTypeWithThisArgument(instantiatedBase, last(getTypeArguments(type)));
|
|
66287
66320
|
}
|
|
66288
|
-
type.objectFlags |=
|
|
66321
|
+
type.objectFlags |= 134217728 /* IdenticalBaseTypeExists */;
|
|
66289
66322
|
return type.cachedEquivalentBaseType = instantiatedBase;
|
|
66290
66323
|
}
|
|
66291
66324
|
function isEmptyLiteralType(type) {
|
|
@@ -66470,7 +66503,7 @@ ${lanes.join("\n")}
|
|
|
66470
66503
|
}
|
|
66471
66504
|
function isObjectTypeWithInferableIndex(type) {
|
|
66472
66505
|
const objectFlags = getObjectFlags(type);
|
|
66473
|
-
return type.flags & 2097152 /* Intersection */ ? every(type.types, isObjectTypeWithInferableIndex) : !!(type.symbol && (type.symbol.flags & (4096 /* ObjectLiteral */ | 2048 /* TypeLiteral */ | 384 /* Enum */ | 512 /* ValueModule */)) !== 0 && !(type.symbol.flags & 32 /* Class */) && !typeHasCallOrConstructSignatures(type)) || !!(objectFlags &
|
|
66506
|
+
return type.flags & 2097152 /* Intersection */ ? every(type.types, isObjectTypeWithInferableIndex) : !!(type.symbol && (type.symbol.flags & (4096 /* ObjectLiteral */ | 2048 /* TypeLiteral */ | 384 /* Enum */ | 512 /* ValueModule */)) !== 0 && !(type.symbol.flags & 32 /* Class */) && !typeHasCallOrConstructSignatures(type)) || !!(objectFlags & 8388608 /* ObjectRestType */) || !!(objectFlags & 2048 /* ReverseMapped */ && isObjectTypeWithInferableIndex(type.source));
|
|
66474
66507
|
}
|
|
66475
66508
|
function createSymbolWithType(source, type) {
|
|
66476
66509
|
const symbol = createSymbol(source.flags, source.escapedName, getCheckFlags(source) & 8 /* Readonly */);
|
|
@@ -66497,7 +66530,7 @@ ${lanes.join("\n")}
|
|
|
66497
66530
|
return members;
|
|
66498
66531
|
}
|
|
66499
66532
|
function getRegularTypeOfObjectLiteral(type) {
|
|
66500
|
-
if (!(isObjectLiteralType2(type) && getObjectFlags(type) &
|
|
66533
|
+
if (!(isObjectLiteralType2(type) && getObjectFlags(type) & 16384 /* FreshLiteral */)) {
|
|
66501
66534
|
return type;
|
|
66502
66535
|
}
|
|
66503
66536
|
const regularType = type.regularType;
|
|
@@ -66508,7 +66541,7 @@ ${lanes.join("\n")}
|
|
|
66508
66541
|
const members = transformTypeOfMembers(type, getRegularTypeOfObjectLiteral);
|
|
66509
66542
|
const regularNew = createAnonymousType(resolved.symbol, members, resolved.callSignatures, resolved.constructSignatures, resolved.indexInfos);
|
|
66510
66543
|
regularNew.flags = resolved.flags;
|
|
66511
|
-
regularNew.objectFlags |= resolved.objectFlags & ~
|
|
66544
|
+
regularNew.objectFlags |= resolved.objectFlags & ~16384 /* FreshLiteral */;
|
|
66512
66545
|
type.regularType = regularNew;
|
|
66513
66546
|
return regularNew;
|
|
66514
66547
|
}
|
|
@@ -66536,7 +66569,7 @@ ${lanes.join("\n")}
|
|
|
66536
66569
|
if (!context.resolvedProperties) {
|
|
66537
66570
|
const names = /* @__PURE__ */ new Map();
|
|
66538
66571
|
for (const t of getSiblingsOfContext(context)) {
|
|
66539
|
-
if (isObjectLiteralType2(t) && !(getObjectFlags(t) &
|
|
66572
|
+
if (isObjectLiteralType2(t) && !(getObjectFlags(t) & 4194304 /* ContainsSpread */)) {
|
|
66540
66573
|
for (const prop of getPropertiesOfType(t)) {
|
|
66541
66574
|
names.set(prop.escapedName, prop);
|
|
66542
66575
|
}
|
|
@@ -66583,7 +66616,7 @@ ${lanes.join("\n")}
|
|
|
66583
66616
|
}
|
|
66584
66617
|
}
|
|
66585
66618
|
const result = createAnonymousType(type.symbol, members, emptyArray, emptyArray, sameMap(getIndexInfosOfType(type), (info) => createIndexInfo(info.keyType, getWidenedType(info.type), info.isReadonly)));
|
|
66586
|
-
result.objectFlags |= getObjectFlags(type) & (
|
|
66619
|
+
result.objectFlags |= getObjectFlags(type) & (8192 /* JSLiteral */ | 524288 /* NonInferrableType */);
|
|
66587
66620
|
return result;
|
|
66588
66621
|
}
|
|
66589
66622
|
function getWidenedType(type) {
|
|
@@ -66594,7 +66627,7 @@ ${lanes.join("\n")}
|
|
|
66594
66627
|
);
|
|
66595
66628
|
}
|
|
66596
66629
|
function getWidenedTypeWithContext(type, context) {
|
|
66597
|
-
if (getObjectFlags(type) &
|
|
66630
|
+
if (getObjectFlags(type) & 393216 /* RequiresWidening */) {
|
|
66598
66631
|
if (context === void 0 && type.widened) {
|
|
66599
66632
|
return type.widened;
|
|
66600
66633
|
}
|
|
@@ -66627,7 +66660,7 @@ ${lanes.join("\n")}
|
|
|
66627
66660
|
}
|
|
66628
66661
|
function reportWideningErrorsInType(type) {
|
|
66629
66662
|
let errorReported = false;
|
|
66630
|
-
if (getObjectFlags(type) &
|
|
66663
|
+
if (getObjectFlags(type) & 131072 /* ContainsWideningType */) {
|
|
66631
66664
|
if (type.flags & 1048576 /* Union */) {
|
|
66632
66665
|
if (some(type.types, isEmptyObjectType)) {
|
|
66633
66666
|
errorReported = true;
|
|
@@ -66649,7 +66682,7 @@ ${lanes.join("\n")}
|
|
|
66649
66682
|
if (isObjectLiteralType2(type)) {
|
|
66650
66683
|
for (const p of getPropertiesOfObjectType(type)) {
|
|
66651
66684
|
const t = getTypeOfSymbol(p);
|
|
66652
|
-
if (getObjectFlags(t) &
|
|
66685
|
+
if (getObjectFlags(t) & 131072 /* ContainsWideningType */) {
|
|
66653
66686
|
if (!reportWideningErrorsInType(t)) {
|
|
66654
66687
|
error2(p.valueDeclaration, Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, symbolToString(p), typeToString(getWidenedType(t)));
|
|
66655
66688
|
}
|
|
@@ -66737,7 +66770,7 @@ ${lanes.join("\n")}
|
|
|
66737
66770
|
}
|
|
66738
66771
|
function reportErrorsFromWidening(declaration, type, wideningKind) {
|
|
66739
66772
|
addLazyDiagnostic(() => {
|
|
66740
|
-
if (noImplicitAny && getObjectFlags(type) &
|
|
66773
|
+
if (noImplicitAny && getObjectFlags(type) & 131072 /* ContainsWideningType */ && (!wideningKind || !getContextualSignatureForFunctionLikeDeclaration(declaration))) {
|
|
66741
66774
|
if (!reportWideningErrorsInType(type)) {
|
|
66742
66775
|
reportImplicitAny(declaration, type, wideningKind);
|
|
66743
66776
|
}
|
|
@@ -66874,12 +66907,12 @@ ${lanes.join("\n")}
|
|
|
66874
66907
|
}
|
|
66875
66908
|
function couldContainTypeVariables(type) {
|
|
66876
66909
|
const objectFlags = getObjectFlags(type);
|
|
66877
|
-
if (objectFlags &
|
|
66878
|
-
return !!(objectFlags &
|
|
66910
|
+
if (objectFlags & 1048576 /* CouldContainTypeVariablesComputed */) {
|
|
66911
|
+
return !!(objectFlags & 2097152 /* CouldContainTypeVariables */);
|
|
66879
66912
|
}
|
|
66880
|
-
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 */ |
|
|
66913
|
+
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 */ | 2048 /* ReverseMapped */ | 8388608 /* ObjectRestType */ | 16777216 /* InstantiationExpressionType */ | 64 /* TypeAliasInstantiation */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
|
|
66881
66914
|
if (type.flags & 3899393 /* ObjectFlagsType */) {
|
|
66882
|
-
type.objectFlags |=
|
|
66915
|
+
type.objectFlags |= 1048576 /* CouldContainTypeVariablesComputed */ | (result ? 2097152 /* CouldContainTypeVariables */ : 0);
|
|
66883
66916
|
}
|
|
66884
66917
|
return result;
|
|
66885
66918
|
}
|
|
@@ -66943,7 +66976,7 @@ ${lanes.join("\n")}
|
|
|
66943
66976
|
return type;
|
|
66944
66977
|
}
|
|
66945
66978
|
function isPartiallyInferableType(type) {
|
|
66946
|
-
return !(getObjectFlags(type) &
|
|
66979
|
+
return !(getObjectFlags(type) & 524288 /* NonInferrableType */) || isObjectLiteralType2(type) && some(getPropertiesOfType(type), (prop) => isPartiallyInferableType(getTypeOfSymbol(prop))) || isTupleType(type) && some(getElementTypes(type), isPartiallyInferableType);
|
|
66947
66980
|
}
|
|
66948
66981
|
function createReverseMappedType(source, target, constraint) {
|
|
66949
66982
|
if (!(getIndexInfoOfType(source, stringType) || getPropertiesOfType(source).length !== 0 && isPartiallyInferableType(source))) {
|
|
@@ -66958,7 +66991,7 @@ ${lanes.join("\n")}
|
|
|
66958
66991
|
return createTupleType(elementTypes, elementFlags, source.target.readonly, source.target.labeledElementDeclarations);
|
|
66959
66992
|
}
|
|
66960
66993
|
const reversed = createObjectType(
|
|
66961
|
-
|
|
66994
|
+
2048 /* ReverseMapped */ | 16 /* Anonymous */,
|
|
66962
66995
|
/*symbol*/
|
|
66963
66996
|
void 0
|
|
66964
66997
|
);
|
|
@@ -67179,6 +67212,8 @@ ${lanes.join("\n")}
|
|
|
67179
67212
|
propagationType = savePropagationType;
|
|
67180
67213
|
return;
|
|
67181
67214
|
}
|
|
67215
|
+
source = getResolvedType(source);
|
|
67216
|
+
target = getResolvedType(target);
|
|
67182
67217
|
if (source.aliasSymbol && source.aliasSymbol === target.aliasSymbol) {
|
|
67183
67218
|
if (source.aliasTypeArguments) {
|
|
67184
67219
|
const params = getSymbolLinks(source.aliasSymbol).typeParameters;
|
|
@@ -67229,7 +67264,7 @@ ${lanes.join("\n")}
|
|
|
67229
67264
|
}
|
|
67230
67265
|
const inference = getInferenceInfoForType(target);
|
|
67231
67266
|
if (inference) {
|
|
67232
|
-
if (getObjectFlags(source) &
|
|
67267
|
+
if (getObjectFlags(source) & 524288 /* NonInferrableType */ || source === nonInferrableAnyType) {
|
|
67233
67268
|
return;
|
|
67234
67269
|
}
|
|
67235
67270
|
if (!inference.isFixed) {
|
|
@@ -67513,7 +67548,7 @@ ${lanes.join("\n")}
|
|
|
67513
67548
|
inferWithPriority(
|
|
67514
67549
|
inferredType,
|
|
67515
67550
|
inference.typeParameter,
|
|
67516
|
-
getObjectFlags(source) &
|
|
67551
|
+
getObjectFlags(source) & 524288 /* NonInferrableType */ ? 16 /* PartialHomomorphicMappedType */ : 8 /* HomomorphicMappedType */
|
|
67517
67552
|
);
|
|
67518
67553
|
}
|
|
67519
67554
|
}
|
|
@@ -67768,10 +67803,10 @@ ${lanes.join("\n")}
|
|
|
67768
67803
|
return !!constraint && maybeTypeOfKind(constraint.flags & 16777216 /* Conditional */ ? getDefaultConstraintOfConditionalType(constraint) : constraint, 402784252 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */);
|
|
67769
67804
|
}
|
|
67770
67805
|
function isObjectLiteralType2(type) {
|
|
67771
|
-
return !!(getObjectFlags(type) &
|
|
67806
|
+
return !!(getObjectFlags(type) & 256 /* ObjectLiteral */);
|
|
67772
67807
|
}
|
|
67773
67808
|
function isObjectOrArrayLiteralType(type) {
|
|
67774
|
-
return !!(getObjectFlags(type) & (
|
|
67809
|
+
return !!(getObjectFlags(type) & (256 /* ObjectLiteral */ | 32768 /* ArrayLiteral */));
|
|
67775
67810
|
}
|
|
67776
67811
|
function unionObjectAndArrayLiteralCandidates(candidates) {
|
|
67777
67812
|
if (candidates.length > 1) {
|
|
@@ -68099,7 +68134,7 @@ ${lanes.join("\n")}
|
|
|
68099
68134
|
}
|
|
68100
68135
|
function getKeyPropertyName(unionType) {
|
|
68101
68136
|
const types = unionType.types;
|
|
68102
|
-
if (types.length < 10 || getObjectFlags(unionType) &
|
|
68137
|
+
if (types.length < 10 || getObjectFlags(unionType) & 65536 /* PrimitiveUnion */ || countWhere(types, (t) => !!(t.flags & (524288 /* Object */ | 58982400 /* InstantiableNonPrimitive */))) < 10) {
|
|
68103
68138
|
return void 0;
|
|
68104
68139
|
}
|
|
68105
68140
|
if (unionType.keyPropertyName === void 0) {
|
|
@@ -68488,7 +68523,7 @@ ${lanes.join("\n")}
|
|
|
68488
68523
|
}
|
|
68489
68524
|
return getUnionTypeFromSortedList(
|
|
68490
68525
|
filtered,
|
|
68491
|
-
type.objectFlags & (
|
|
68526
|
+
type.objectFlags & (65536 /* PrimitiveUnion */ | 33554432 /* ContainsIntersections */),
|
|
68492
68527
|
/*aliasSymbol*/
|
|
68493
68528
|
void 0,
|
|
68494
68529
|
/*aliasTypeArguments*/
|
|
@@ -68550,7 +68585,7 @@ ${lanes.join("\n")}
|
|
|
68550
68585
|
return incomplete ? { flags: 0, type: type.flags & 131072 /* Never */ ? silentNeverType : type } : type;
|
|
68551
68586
|
}
|
|
68552
68587
|
function createEvolvingArrayType(elementType) {
|
|
68553
|
-
const result = createObjectType(
|
|
68588
|
+
const result = createObjectType(512 /* EvolvingArray */);
|
|
68554
68589
|
result.elementType = elementType;
|
|
68555
68590
|
return result;
|
|
68556
68591
|
}
|
|
@@ -68570,16 +68605,16 @@ ${lanes.join("\n")}
|
|
|
68570
68605
|
return evolvingArrayType.finalArrayType || (evolvingArrayType.finalArrayType = createFinalArrayType(evolvingArrayType.elementType));
|
|
68571
68606
|
}
|
|
68572
68607
|
function finalizeEvolvingArrayType(type) {
|
|
68573
|
-
return getObjectFlags(type) &
|
|
68608
|
+
return getObjectFlags(type) & 512 /* EvolvingArray */ ? getFinalArrayType(type) : type;
|
|
68574
68609
|
}
|
|
68575
68610
|
function getElementTypeOfEvolvingArrayType(type) {
|
|
68576
|
-
return getObjectFlags(type) &
|
|
68611
|
+
return getObjectFlags(type) & 512 /* EvolvingArray */ ? type.elementType : neverType;
|
|
68577
68612
|
}
|
|
68578
68613
|
function isEvolvingArrayTypeList(types) {
|
|
68579
68614
|
let hasEvolvingArrayType = false;
|
|
68580
68615
|
for (const t of types) {
|
|
68581
68616
|
if (!(t.flags & 131072 /* Never */)) {
|
|
68582
|
-
if (!(getObjectFlags(t) &
|
|
68617
|
+
if (!(getObjectFlags(t) & 512 /* EvolvingArray */)) {
|
|
68583
68618
|
return false;
|
|
68584
68619
|
}
|
|
68585
68620
|
hasEvolvingArrayType = true;
|
|
@@ -68883,7 +68918,7 @@ ${lanes.join("\n")}
|
|
|
68883
68918
|
const sharedFlowStart = sharedFlowCount;
|
|
68884
68919
|
const evolvedType = getTypeFromFlowType(getTypeAtFlowNode(flowNode));
|
|
68885
68920
|
sharedFlowCount = sharedFlowStart;
|
|
68886
|
-
const resultType = getObjectFlags(evolvedType) &
|
|
68921
|
+
const resultType = getObjectFlags(evolvedType) & 512 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType);
|
|
68887
68922
|
if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 235 /* NonNullExpression */ && !(resultType.flags & 131072 /* Never */) && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) {
|
|
68888
68923
|
return declaredType;
|
|
68889
68924
|
}
|
|
@@ -69070,7 +69105,7 @@ ${lanes.join("\n")}
|
|
|
69070
69105
|
if (isMatchingReference(reference, getReferenceCandidate(expr))) {
|
|
69071
69106
|
const flowType = getTypeAtFlowNode(flow.antecedent);
|
|
69072
69107
|
const type = getTypeFromFlowType(flowType);
|
|
69073
|
-
if (getObjectFlags(type) &
|
|
69108
|
+
if (getObjectFlags(type) & 512 /* EvolvingArray */) {
|
|
69074
69109
|
let evolvedType2 = type;
|
|
69075
69110
|
if (node.kind === 213 /* CallExpression */) {
|
|
69076
69111
|
for (const arg of node.arguments) {
|
|
@@ -69923,7 +69958,7 @@ ${lanes.join("\n")}
|
|
|
69923
69958
|
location = location.parent;
|
|
69924
69959
|
}
|
|
69925
69960
|
if (isExpressionNode(location) && (!isAssignmentTarget(location) || isWriteAccess(location))) {
|
|
69926
|
-
const type = removeOptionalTypeMarker(
|
|
69961
|
+
const type = getResolvedType(removeOptionalTypeMarker(
|
|
69927
69962
|
isWriteAccess(location) && location.kind === 211 /* PropertyAccessExpression */ ? checkPropertyAccessExpression(
|
|
69928
69963
|
location,
|
|
69929
69964
|
/*checkMode*/
|
|
@@ -69931,7 +69966,7 @@ ${lanes.join("\n")}
|
|
|
69931
69966
|
/*writeOnly*/
|
|
69932
69967
|
true
|
|
69933
69968
|
) : getTypeOfExpression(location)
|
|
69934
|
-
);
|
|
69969
|
+
));
|
|
69935
69970
|
if (getExportSymbolOfValueSymbolIfExported(getNodeLinks(location).resolvedSymbol) === symbol) {
|
|
69936
69971
|
return type;
|
|
69937
69972
|
}
|
|
@@ -71979,7 +72014,7 @@ ${lanes.join("\n")}
|
|
|
71979
72014
|
let literalType = type.literalType;
|
|
71980
72015
|
if (!literalType) {
|
|
71981
72016
|
literalType = type.literalType = cloneTypeReference(type);
|
|
71982
|
-
literalType.objectFlags |=
|
|
72017
|
+
literalType.objectFlags |= 32768 /* ArrayLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
|
|
71983
72018
|
}
|
|
71984
72019
|
return literalType;
|
|
71985
72020
|
}
|
|
@@ -72107,7 +72142,7 @@ ${lanes.join("\n")}
|
|
|
72107
72142
|
checkTypeAssignableTo(type, getTypeFromTypeNode(enumTag.typeExpression), memberDecl);
|
|
72108
72143
|
}
|
|
72109
72144
|
}
|
|
72110
|
-
objectFlags |= getObjectFlags(type) &
|
|
72145
|
+
objectFlags |= getObjectFlags(type) & 917504 /* PropagatingFlags */;
|
|
72111
72146
|
const nameType = computedNameType && isTypeUsableAsPropertyName(computedNameType) ? computedNameType : void 0;
|
|
72112
72147
|
const prop = nameType ? createSymbol(4 /* Property */ | member.flags, getPropertyNameFromType(nameType), checkFlags | 4096 /* Late */) : createSymbol(4 /* Property */ | member.flags, member.escapedName, checkFlags);
|
|
72113
72148
|
if (nameType) {
|
|
@@ -72118,7 +72153,7 @@ ${lanes.join("\n")}
|
|
|
72118
72153
|
if (isOptional) {
|
|
72119
72154
|
prop.flags |= 16777216 /* Optional */;
|
|
72120
72155
|
}
|
|
72121
|
-
} else if (contextualTypeHasPattern && !(getObjectFlags(contextualType) &
|
|
72156
|
+
} else if (contextualTypeHasPattern && !(getObjectFlags(contextualType) & 1024 /* ObjectLiteralPatternWithComputedProperties */)) {
|
|
72122
72157
|
const impliedProp = getPropertyOfType(contextualType, member.escapedName);
|
|
72123
72158
|
if (impliedProp) {
|
|
72124
72159
|
prop.flags |= impliedProp.flags & 16777216 /* Optional */;
|
|
@@ -72230,12 +72265,12 @@ ${lanes.join("\n")}
|
|
|
72230
72265
|
if (hasComputedSymbolProperty)
|
|
72231
72266
|
indexInfos.push(getObjectLiteralIndexInfo(node, offset, propertiesArray, esSymbolType));
|
|
72232
72267
|
const result = createAnonymousType(node.symbol, propertiesTable, emptyArray, emptyArray, indexInfos);
|
|
72233
|
-
result.objectFlags |= objectFlags |
|
|
72268
|
+
result.objectFlags |= objectFlags | 256 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
|
|
72234
72269
|
if (isJSObjectLiteral) {
|
|
72235
|
-
result.objectFlags |=
|
|
72270
|
+
result.objectFlags |= 8192 /* JSLiteral */;
|
|
72236
72271
|
}
|
|
72237
72272
|
if (patternWithComputedProperties) {
|
|
72238
|
-
result.objectFlags |=
|
|
72273
|
+
result.objectFlags |= 1024 /* ObjectLiteralPatternWithComputedProperties */;
|
|
72239
72274
|
}
|
|
72240
72275
|
if (inDestructuringPattern) {
|
|
72241
72276
|
result.pattern = node;
|
|
@@ -72297,13 +72332,13 @@ ${lanes.join("\n")}
|
|
|
72297
72332
|
let hasSpreadAnyType = false;
|
|
72298
72333
|
let typeToIntersect;
|
|
72299
72334
|
let explicitlySpecifyChildrenAttribute = false;
|
|
72300
|
-
let objectFlags =
|
|
72335
|
+
let objectFlags = 4096 /* JsxAttributes */;
|
|
72301
72336
|
const jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(openingLikeElement));
|
|
72302
72337
|
for (const attributeDecl of attributes.properties) {
|
|
72303
72338
|
const member = attributeDecl.symbol;
|
|
72304
72339
|
if (isJsxAttribute(attributeDecl)) {
|
|
72305
72340
|
const exprType = checkJsxAttribute(attributeDecl, checkMode);
|
|
72306
|
-
objectFlags |= getObjectFlags(exprType) &
|
|
72341
|
+
objectFlags |= getObjectFlags(exprType) & 917504 /* PropagatingFlags */;
|
|
72307
72342
|
const attributeSymbol = createSymbol(4 /* Property */ | member.flags, member.escapedName);
|
|
72308
72343
|
attributeSymbol.declarations = member.declarations;
|
|
72309
72344
|
attributeSymbol.parent = member.parent;
|
|
@@ -72424,7 +72459,7 @@ ${lanes.join("\n")}
|
|
|
72424
72459
|
function createJsxAttributesType() {
|
|
72425
72460
|
objectFlags |= freshObjectLiteralFlag;
|
|
72426
72461
|
const result = createAnonymousType(attributes.symbol, attributesTable, emptyArray, emptyArray, emptyArray);
|
|
72427
|
-
result.objectFlags |= objectFlags |
|
|
72462
|
+
result.objectFlags |= objectFlags | 256 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
|
|
72428
72463
|
return result;
|
|
72429
72464
|
}
|
|
72430
72465
|
}
|
|
@@ -72817,7 +72852,7 @@ ${lanes.join("\n")}
|
|
|
72817
72852
|
return false;
|
|
72818
72853
|
}
|
|
72819
72854
|
function isExcessPropertyCheckTarget(type) {
|
|
72820
|
-
return !!(type.flags & 524288 /* Object */ && !(getObjectFlags(type) &
|
|
72855
|
+
return !!(type.flags & 524288 /* Object */ && !(getObjectFlags(type) & 1024 /* ObjectLiteralPatternWithComputedProperties */) || type.flags & 67108864 /* NonPrimitive */ || type.flags & 1048576 /* Union */ && some(type.types, isExcessPropertyCheckTarget) || type.flags & 2097152 /* Intersection */ && every(type.types, isExcessPropertyCheckTarget));
|
|
72821
72856
|
}
|
|
72822
72857
|
function checkJsxExpression(node, checkMode) {
|
|
72823
72858
|
checkGrammarJsxExpression(node);
|
|
@@ -75585,7 +75620,7 @@ ${lanes.join("\n")}
|
|
|
75585
75620
|
);
|
|
75586
75621
|
if ((_c = jsSymbol == null ? void 0 : jsSymbol.exports) == null ? void 0 : _c.size) {
|
|
75587
75622
|
const jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, emptyArray, emptyArray, emptyArray);
|
|
75588
|
-
jsAssignmentType.objectFlags |=
|
|
75623
|
+
jsAssignmentType.objectFlags |= 8192 /* JSLiteral */;
|
|
75589
75624
|
return getIntersectionType([returnType, jsAssignmentType]);
|
|
75590
75625
|
}
|
|
75591
75626
|
}
|
|
@@ -75931,7 +75966,7 @@ ${lanes.join("\n")}
|
|
|
75931
75966
|
hasApplicableSignature || (hasApplicableSignature = callSignatures.length !== 0 || constructSignatures.length !== 0);
|
|
75932
75967
|
if (callSignatures !== resolved.callSignatures || constructSignatures !== resolved.constructSignatures) {
|
|
75933
75968
|
const result3 = createAnonymousType(createSymbol(0 /* None */, "__instantiationExpression" /* InstantiationExpression */), resolved.members, callSignatures, constructSignatures, resolved.indexInfos);
|
|
75934
|
-
result3.objectFlags |=
|
|
75969
|
+
result3.objectFlags |= 16777216 /* InstantiationExpressionType */;
|
|
75935
75970
|
result3.node = node;
|
|
75936
75971
|
return result3;
|
|
75937
75972
|
}
|
|
@@ -76972,7 +77007,7 @@ ${lanes.join("\n")}
|
|
|
76972
77007
|
64 /* IsNonInferrable */
|
|
76973
77008
|
);
|
|
76974
77009
|
const returnOnlyType = createAnonymousType(node.symbol, emptySymbols, [returnOnlySignature], emptyArray, emptyArray);
|
|
76975
|
-
returnOnlyType.objectFlags |=
|
|
77010
|
+
returnOnlyType.objectFlags |= 524288 /* NonInferrableType */;
|
|
76976
77011
|
return links.contextFreeType = returnOnlyType;
|
|
76977
77012
|
}
|
|
76978
77013
|
}
|
|
@@ -87748,7 +87783,7 @@ ${lanes.join("\n")}
|
|
|
87748
87783
|
}
|
|
87749
87784
|
}
|
|
87750
87785
|
function findBestTypeForObjectLiteral(source, unionTarget) {
|
|
87751
|
-
if (getObjectFlags(source) &
|
|
87786
|
+
if (getObjectFlags(source) & 256 /* ObjectLiteral */ && someType(unionTarget, isArrayLikeType)) {
|
|
87752
87787
|
return find(unionTarget.types, (t) => !isArrayLikeType(t));
|
|
87753
87788
|
}
|
|
87754
87789
|
}
|
|
@@ -153049,7 +153084,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
153049
153084
|
return factory.createIdentifier("undefined");
|
|
153050
153085
|
}
|
|
153051
153086
|
function isObjectLiteralType(type) {
|
|
153052
|
-
return type.flags & 524288 /* Object */ && (getObjectFlags(type) &
|
|
153087
|
+
return type.flags & 524288 /* Object */ && (getObjectFlags(type) & 256 /* ObjectLiteral */ || type.symbol && tryCast(singleOrUndefined(type.symbol.declarations), isTypeLiteralNode));
|
|
153053
153088
|
}
|
|
153054
153089
|
function getUnmatchedAttributes(checker, target, source) {
|
|
153055
153090
|
const attrsType = checker.getContextualType(source.attributes);
|