@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/tsserver.js
CHANGED
|
@@ -4481,8 +4481,8 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
4481
4481
|
// for use with vscode-js-debug's new customDescriptionGenerator in launch.json
|
|
4482
4482
|
__tsDebuggerDisplay: {
|
|
4483
4483
|
value() {
|
|
4484
|
-
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 &
|
|
4485
|
-
const remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~
|
|
4484
|
+
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";
|
|
4485
|
+
const remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~2623 /* ObjectTypeKindMask */ : 0;
|
|
4486
4486
|
return `${typeHeader}${this.symbol ? ` '${symbolName(this.symbol)}'` : ""}${remainingObjectFlags ? ` (${formatObjectFlags(remainingObjectFlags)})` : ""}`;
|
|
4487
4487
|
}
|
|
4488
4488
|
},
|
|
@@ -5680,7 +5680,7 @@ var tracingEnabled;
|
|
|
5680
5680
|
};
|
|
5681
5681
|
}
|
|
5682
5682
|
let reverseMappedProperties = {};
|
|
5683
|
-
if (objectFlags &
|
|
5683
|
+
if (objectFlags & 2048 /* ReverseMapped */) {
|
|
5684
5684
|
const reverseMappedType = type;
|
|
5685
5685
|
reverseMappedProperties = {
|
|
5686
5686
|
reverseMappedSourceType: (_l = reverseMappedType.source) == null ? void 0 : _l.id,
|
|
@@ -5689,7 +5689,7 @@ var tracingEnabled;
|
|
|
5689
5689
|
};
|
|
5690
5690
|
}
|
|
5691
5691
|
let evolvingArrayProperties = {};
|
|
5692
|
-
if (objectFlags &
|
|
5692
|
+
if (objectFlags & 512 /* EvolvingArray */) {
|
|
5693
5693
|
const evolvingArrayType = type;
|
|
5694
5694
|
evolvingArrayProperties = {
|
|
5695
5695
|
evolvingArrayElementType: evolvingArrayType.elementType.id,
|
|
@@ -6709,42 +6709,43 @@ var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => {
|
|
|
6709
6709
|
ObjectFlags3[ObjectFlags3["Tuple"] = 8] = "Tuple";
|
|
6710
6710
|
ObjectFlags3[ObjectFlags3["Anonymous"] = 16] = "Anonymous";
|
|
6711
6711
|
ObjectFlags3[ObjectFlags3["Mapped"] = 32] = "Mapped";
|
|
6712
|
-
ObjectFlags3[ObjectFlags3["
|
|
6713
|
-
ObjectFlags3[ObjectFlags3["
|
|
6714
|
-
ObjectFlags3[ObjectFlags3["
|
|
6715
|
-
ObjectFlags3[ObjectFlags3["
|
|
6716
|
-
ObjectFlags3[ObjectFlags3["
|
|
6717
|
-
ObjectFlags3[ObjectFlags3["
|
|
6718
|
-
ObjectFlags3[ObjectFlags3["
|
|
6719
|
-
ObjectFlags3[ObjectFlags3["
|
|
6720
|
-
ObjectFlags3[ObjectFlags3["
|
|
6721
|
-
ObjectFlags3[ObjectFlags3["
|
|
6722
|
-
ObjectFlags3[ObjectFlags3["
|
|
6723
|
-
ObjectFlags3[ObjectFlags3["
|
|
6724
|
-
ObjectFlags3[ObjectFlags3["
|
|
6725
|
-
ObjectFlags3[ObjectFlags3["
|
|
6726
|
-
ObjectFlags3[ObjectFlags3["
|
|
6712
|
+
ObjectFlags3[ObjectFlags3["TypeAliasInstantiation"] = 64] = "TypeAliasInstantiation";
|
|
6713
|
+
ObjectFlags3[ObjectFlags3["Instantiated"] = 128] = "Instantiated";
|
|
6714
|
+
ObjectFlags3[ObjectFlags3["ObjectLiteral"] = 256] = "ObjectLiteral";
|
|
6715
|
+
ObjectFlags3[ObjectFlags3["EvolvingArray"] = 512] = "EvolvingArray";
|
|
6716
|
+
ObjectFlags3[ObjectFlags3["ObjectLiteralPatternWithComputedProperties"] = 1024] = "ObjectLiteralPatternWithComputedProperties";
|
|
6717
|
+
ObjectFlags3[ObjectFlags3["ReverseMapped"] = 2048] = "ReverseMapped";
|
|
6718
|
+
ObjectFlags3[ObjectFlags3["JsxAttributes"] = 4096] = "JsxAttributes";
|
|
6719
|
+
ObjectFlags3[ObjectFlags3["JSLiteral"] = 8192] = "JSLiteral";
|
|
6720
|
+
ObjectFlags3[ObjectFlags3["FreshLiteral"] = 16384] = "FreshLiteral";
|
|
6721
|
+
ObjectFlags3[ObjectFlags3["ArrayLiteral"] = 32768] = "ArrayLiteral";
|
|
6722
|
+
ObjectFlags3[ObjectFlags3["PrimitiveUnion"] = 65536] = "PrimitiveUnion";
|
|
6723
|
+
ObjectFlags3[ObjectFlags3["ContainsWideningType"] = 131072] = "ContainsWideningType";
|
|
6724
|
+
ObjectFlags3[ObjectFlags3["ContainsObjectOrArrayLiteral"] = 262144] = "ContainsObjectOrArrayLiteral";
|
|
6725
|
+
ObjectFlags3[ObjectFlags3["NonInferrableType"] = 524288] = "NonInferrableType";
|
|
6726
|
+
ObjectFlags3[ObjectFlags3["CouldContainTypeVariablesComputed"] = 1048576] = "CouldContainTypeVariablesComputed";
|
|
6727
|
+
ObjectFlags3[ObjectFlags3["CouldContainTypeVariables"] = 2097152] = "CouldContainTypeVariables";
|
|
6727
6728
|
ObjectFlags3[ObjectFlags3["ClassOrInterface"] = 3] = "ClassOrInterface";
|
|
6728
|
-
ObjectFlags3[ObjectFlags3["RequiresWidening"] =
|
|
6729
|
-
ObjectFlags3[ObjectFlags3["PropagatingFlags"] =
|
|
6730
|
-
ObjectFlags3[ObjectFlags3["InstantiatedMapped"] =
|
|
6731
|
-
ObjectFlags3[ObjectFlags3["ObjectTypeKindMask"] =
|
|
6732
|
-
ObjectFlags3[ObjectFlags3["ContainsSpread"] =
|
|
6733
|
-
ObjectFlags3[ObjectFlags3["ObjectRestType"] =
|
|
6734
|
-
ObjectFlags3[ObjectFlags3["InstantiationExpressionType"] =
|
|
6735
|
-
ObjectFlags3[ObjectFlags3["IsClassInstanceClone"] =
|
|
6736
|
-
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeCalculated"] =
|
|
6737
|
-
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeExists"] =
|
|
6738
|
-
ObjectFlags3[ObjectFlags3["IsGenericTypeComputed"] =
|
|
6739
|
-
ObjectFlags3[ObjectFlags3["IsGenericObjectType"] =
|
|
6740
|
-
ObjectFlags3[ObjectFlags3["IsGenericIndexType"] =
|
|
6741
|
-
ObjectFlags3[ObjectFlags3["IsGenericType"] =
|
|
6742
|
-
ObjectFlags3[ObjectFlags3["ContainsIntersections"] =
|
|
6743
|
-
ObjectFlags3[ObjectFlags3["IsUnknownLikeUnionComputed"] =
|
|
6744
|
-
ObjectFlags3[ObjectFlags3["IsUnknownLikeUnion"] =
|
|
6745
|
-
ObjectFlags3[ObjectFlags3["IsNeverIntersectionComputed"] =
|
|
6746
|
-
ObjectFlags3[ObjectFlags3["IsNeverIntersection"] =
|
|
6747
|
-
ObjectFlags3[ObjectFlags3["IsConstrainedTypeVariable"] =
|
|
6729
|
+
ObjectFlags3[ObjectFlags3["RequiresWidening"] = 393216] = "RequiresWidening";
|
|
6730
|
+
ObjectFlags3[ObjectFlags3["PropagatingFlags"] = 917504] = "PropagatingFlags";
|
|
6731
|
+
ObjectFlags3[ObjectFlags3["InstantiatedMapped"] = 160] = "InstantiatedMapped";
|
|
6732
|
+
ObjectFlags3[ObjectFlags3["ObjectTypeKindMask"] = 2623] = "ObjectTypeKindMask";
|
|
6733
|
+
ObjectFlags3[ObjectFlags3["ContainsSpread"] = 4194304] = "ContainsSpread";
|
|
6734
|
+
ObjectFlags3[ObjectFlags3["ObjectRestType"] = 8388608] = "ObjectRestType";
|
|
6735
|
+
ObjectFlags3[ObjectFlags3["InstantiationExpressionType"] = 16777216] = "InstantiationExpressionType";
|
|
6736
|
+
ObjectFlags3[ObjectFlags3["IsClassInstanceClone"] = 33554432] = "IsClassInstanceClone";
|
|
6737
|
+
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeCalculated"] = 67108864] = "IdenticalBaseTypeCalculated";
|
|
6738
|
+
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeExists"] = 134217728] = "IdenticalBaseTypeExists";
|
|
6739
|
+
ObjectFlags3[ObjectFlags3["IsGenericTypeComputed"] = 4194304] = "IsGenericTypeComputed";
|
|
6740
|
+
ObjectFlags3[ObjectFlags3["IsGenericObjectType"] = 8388608] = "IsGenericObjectType";
|
|
6741
|
+
ObjectFlags3[ObjectFlags3["IsGenericIndexType"] = 16777216] = "IsGenericIndexType";
|
|
6742
|
+
ObjectFlags3[ObjectFlags3["IsGenericType"] = 25165824] = "IsGenericType";
|
|
6743
|
+
ObjectFlags3[ObjectFlags3["ContainsIntersections"] = 33554432] = "ContainsIntersections";
|
|
6744
|
+
ObjectFlags3[ObjectFlags3["IsUnknownLikeUnionComputed"] = 67108864] = "IsUnknownLikeUnionComputed";
|
|
6745
|
+
ObjectFlags3[ObjectFlags3["IsUnknownLikeUnion"] = 134217728] = "IsUnknownLikeUnion";
|
|
6746
|
+
ObjectFlags3[ObjectFlags3["IsNeverIntersectionComputed"] = 33554432] = "IsNeverIntersectionComputed";
|
|
6747
|
+
ObjectFlags3[ObjectFlags3["IsNeverIntersection"] = 67108864] = "IsNeverIntersection";
|
|
6748
|
+
ObjectFlags3[ObjectFlags3["IsConstrainedTypeVariable"] = 134217728] = "IsConstrainedTypeVariable";
|
|
6748
6749
|
return ObjectFlags3;
|
|
6749
6750
|
})(ObjectFlags || {});
|
|
6750
6751
|
var VarianceFlags = /* @__PURE__ */ ((VarianceFlags2) => {
|
|
@@ -48378,7 +48379,7 @@ function createTypeChecker(host) {
|
|
|
48378
48379
|
var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
|
|
48379
48380
|
var keyofStringsOnly = !!compilerOptions.keyofStringsOnly;
|
|
48380
48381
|
var defaultIndexFlags = keyofStringsOnly ? 1 /* StringsOnly */ : 0 /* None */;
|
|
48381
|
-
var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 :
|
|
48382
|
+
var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 16384 /* FreshLiteral */;
|
|
48382
48383
|
var exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes;
|
|
48383
48384
|
var checkBinaryExpression = createCheckBinaryExpression();
|
|
48384
48385
|
var emitResolver = createResolver();
|
|
@@ -48881,7 +48882,7 @@ function createTypeChecker(host) {
|
|
|
48881
48882
|
var errorTypes = /* @__PURE__ */ new Map();
|
|
48882
48883
|
var seenIntrinsicNames = /* @__PURE__ */ new Set();
|
|
48883
48884
|
var anyType = createIntrinsicType(1 /* Any */, "any");
|
|
48884
|
-
var autoType = createIntrinsicType(1 /* Any */, "any",
|
|
48885
|
+
var autoType = createIntrinsicType(1 /* Any */, "any", 524288 /* NonInferrableType */, "auto");
|
|
48885
48886
|
var wildcardType = createIntrinsicType(
|
|
48886
48887
|
1 /* Any */,
|
|
48887
48888
|
"any",
|
|
@@ -48898,7 +48899,7 @@ function createTypeChecker(host) {
|
|
|
48898
48899
|
);
|
|
48899
48900
|
var errorType = createIntrinsicType(1 /* Any */, "error");
|
|
48900
48901
|
var unresolvedType = createIntrinsicType(1 /* Any */, "unresolved");
|
|
48901
|
-
var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any",
|
|
48902
|
+
var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 131072 /* ContainsWideningType */, "non-inferrable");
|
|
48902
48903
|
var intrinsicMarkerType = createIntrinsicType(1 /* Any */, "intrinsic");
|
|
48903
48904
|
var unknownType = createIntrinsicType(2 /* Unknown */, "unknown");
|
|
48904
48905
|
var nonNullUnknownType = createIntrinsicType(
|
|
@@ -48909,7 +48910,7 @@ function createTypeChecker(host) {
|
|
|
48909
48910
|
"non-null"
|
|
48910
48911
|
);
|
|
48911
48912
|
var undefinedType = createIntrinsicType(32768 /* Undefined */, "undefined");
|
|
48912
|
-
var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined",
|
|
48913
|
+
var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 131072 /* ContainsWideningType */, "widening");
|
|
48913
48914
|
var missingType = createIntrinsicType(
|
|
48914
48915
|
32768 /* Undefined */,
|
|
48915
48916
|
"undefined",
|
|
@@ -48926,7 +48927,7 @@ function createTypeChecker(host) {
|
|
|
48926
48927
|
"optional"
|
|
48927
48928
|
);
|
|
48928
48929
|
var nullType = createIntrinsicType(65536 /* Null */, "null");
|
|
48929
|
-
var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null",
|
|
48930
|
+
var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null", 131072 /* ContainsWideningType */, "widening");
|
|
48930
48931
|
var stringType = createIntrinsicType(4 /* String */, "string");
|
|
48931
48932
|
var numberType = createIntrinsicType(8 /* Number */, "number");
|
|
48932
48933
|
var bigintType = createIntrinsicType(64 /* BigInt */, "bigint");
|
|
@@ -48958,7 +48959,7 @@ function createTypeChecker(host) {
|
|
|
48958
48959
|
var esSymbolType = createIntrinsicType(4096 /* ESSymbol */, "symbol");
|
|
48959
48960
|
var voidType = createIntrinsicType(16384 /* Void */, "void");
|
|
48960
48961
|
var neverType = createIntrinsicType(131072 /* Never */, "never");
|
|
48961
|
-
var silentNeverType = createIntrinsicType(131072 /* Never */, "never",
|
|
48962
|
+
var silentNeverType = createIntrinsicType(131072 /* Never */, "never", 524288 /* NonInferrableType */, "silent");
|
|
48962
48963
|
var implicitNeverType = createIntrinsicType(
|
|
48963
48964
|
131072 /* Never */,
|
|
48964
48965
|
"never",
|
|
@@ -49025,7 +49026,7 @@ function createTypeChecker(host) {
|
|
|
49025
49026
|
emptyArray,
|
|
49026
49027
|
emptyArray
|
|
49027
49028
|
);
|
|
49028
|
-
emptyJsxObjectType.objectFlags |=
|
|
49029
|
+
emptyJsxObjectType.objectFlags |= 4096 /* JsxAttributes */;
|
|
49029
49030
|
var emptyTypeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */);
|
|
49030
49031
|
emptyTypeLiteralSymbol.members = createSymbolTable();
|
|
49031
49032
|
var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, emptyArray, emptyArray, emptyArray);
|
|
@@ -49055,7 +49056,7 @@ function createTypeChecker(host) {
|
|
|
49055
49056
|
emptyArray,
|
|
49056
49057
|
emptyArray
|
|
49057
49058
|
);
|
|
49058
|
-
anyFunctionType.objectFlags |=
|
|
49059
|
+
anyFunctionType.objectFlags |= 524288 /* NonInferrableType */;
|
|
49059
49060
|
var noConstraintType = createAnonymousType(
|
|
49060
49061
|
/*symbol*/
|
|
49061
49062
|
void 0,
|
|
@@ -52293,7 +52294,7 @@ function createTypeChecker(host) {
|
|
|
52293
52294
|
const type = createType(kind);
|
|
52294
52295
|
type.intrinsicName = intrinsicName;
|
|
52295
52296
|
type.debugIntrinsicName = debugIntrinsicName;
|
|
52296
|
-
type.objectFlags = objectFlags |
|
|
52297
|
+
type.objectFlags = objectFlags | 1048576 /* CouldContainTypeVariablesComputed */ | 4194304 /* IsGenericTypeComputed */ | 67108864 /* IsUnknownLikeUnionComputed */ | 33554432 /* IsNeverIntersectionComputed */;
|
|
52297
52298
|
return type;
|
|
52298
52299
|
}
|
|
52299
52300
|
function checkIntrinsicName(name, debug) {
|
|
@@ -52882,7 +52883,7 @@ function createTypeChecker(host) {
|
|
|
52882
52883
|
return flags & 848330095 /* NodeBuilderFlagsMask */;
|
|
52883
52884
|
}
|
|
52884
52885
|
function isClassInstanceSide(type) {
|
|
52885
|
-
return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || !!(type.flags & 524288 /* Object */) && !!(getObjectFlags(type) &
|
|
52886
|
+
return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || !!(type.flags & 524288 /* Object */) && !!(getObjectFlags(type) & 33554432 /* IsClassInstanceClone */));
|
|
52886
52887
|
}
|
|
52887
52888
|
function createNodeBuilder() {
|
|
52888
52889
|
return {
|
|
@@ -52971,9 +52972,7 @@ function createTypeChecker(host) {
|
|
|
52971
52972
|
context.approximateLength += 3;
|
|
52972
52973
|
return factory.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
52973
52974
|
}
|
|
52974
|
-
|
|
52975
|
-
type = getReducedType(type);
|
|
52976
|
-
}
|
|
52975
|
+
type = context.flags & 536870912 /* NoTypeReduction */ ? getResolvedType(type) : getReducedType(type);
|
|
52977
52976
|
if (type.flags & 1 /* Any */) {
|
|
52978
52977
|
if (type.aliasSymbol) {
|
|
52979
52978
|
return factory.createTypeReferenceNode(symbolToEntityNameNode(type.aliasSymbol), mapToTypeNodes(type.aliasTypeArguments, context));
|
|
@@ -53345,7 +53344,7 @@ function createTypeChecker(host) {
|
|
|
53345
53344
|
const typeId = type2.id;
|
|
53346
53345
|
const symbol = type2.symbol;
|
|
53347
53346
|
if (symbol) {
|
|
53348
|
-
const isInstantiationExpressionType = !!(getObjectFlags(type2) &
|
|
53347
|
+
const isInstantiationExpressionType = !!(getObjectFlags(type2) & 16777216 /* InstantiationExpressionType */);
|
|
53349
53348
|
if (isInstantiationExpressionType) {
|
|
53350
53349
|
const instantiationExpressionType = type2;
|
|
53351
53350
|
const existing = instantiationExpressionType.node;
|
|
@@ -53683,7 +53682,7 @@ function createTypeChecker(host) {
|
|
|
53683
53682
|
typeElements.push(signatureToSignatureDeclarationHelper(signature, 180 /* ConstructSignature */, context));
|
|
53684
53683
|
}
|
|
53685
53684
|
for (const info of resolvedType.indexInfos) {
|
|
53686
|
-
typeElements.push(indexInfoToIndexSignatureDeclarationHelper(info, context, resolvedType.objectFlags &
|
|
53685
|
+
typeElements.push(indexInfoToIndexSignatureDeclarationHelper(info, context, resolvedType.objectFlags & 2048 /* ReverseMapped */ ? createElidedInformationPlaceholder(context) : void 0));
|
|
53687
53686
|
}
|
|
53688
53687
|
const properties = resolvedType.properties;
|
|
53689
53688
|
if (!properties) {
|
|
@@ -56927,7 +56926,7 @@ function createTypeChecker(host) {
|
|
|
56927
56926
|
));
|
|
56928
56927
|
}
|
|
56929
56928
|
const result = createAnonymousType(symbol, members, emptyArray, emptyArray, getIndexInfosOfType(source));
|
|
56930
|
-
result.objectFlags |=
|
|
56929
|
+
result.objectFlags |= 8388608 /* ObjectRestType */;
|
|
56931
56930
|
return result;
|
|
56932
56931
|
}
|
|
56933
56932
|
function isGenericTypeWithUndefinedConstraint(type) {
|
|
@@ -57357,7 +57356,7 @@ function createTypeChecker(host) {
|
|
|
57357
57356
|
mergeSymbolTable(exports2, s.exports);
|
|
57358
57357
|
}
|
|
57359
57358
|
const type = createAnonymousType(symbol, exports2, emptyArray, emptyArray, emptyArray);
|
|
57360
|
-
type.objectFlags |=
|
|
57359
|
+
type.objectFlags |= 8192 /* JSLiteral */;
|
|
57361
57360
|
return type;
|
|
57362
57361
|
}
|
|
57363
57362
|
function getAnnotatedTypeForAssignmentDeclaration(declaredType, expression, symbol, declaration) {
|
|
@@ -57478,9 +57477,9 @@ function createTypeChecker(host) {
|
|
|
57478
57477
|
result.aliasTypeArguments = length(args) ? args : void 0;
|
|
57479
57478
|
}
|
|
57480
57479
|
}
|
|
57481
|
-
result.objectFlags |= getObjectFlags(type) &
|
|
57480
|
+
result.objectFlags |= getObjectFlags(type) & 8192 /* JSLiteral */;
|
|
57482
57481
|
if (result.symbol && result.symbol.flags & 32 /* Class */ && type === getDeclaredTypeOfClassOrInterface(result.symbol)) {
|
|
57483
|
-
result.objectFlags |=
|
|
57482
|
+
result.objectFlags |= 33554432 /* IsClassInstanceClone */;
|
|
57484
57483
|
}
|
|
57485
57484
|
return result;
|
|
57486
57485
|
}
|
|
@@ -57533,7 +57532,7 @@ function createTypeChecker(host) {
|
|
|
57533
57532
|
function getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors2) {
|
|
57534
57533
|
const members = createSymbolTable();
|
|
57535
57534
|
let stringIndexInfo;
|
|
57536
|
-
let objectFlags =
|
|
57535
|
+
let objectFlags = 256 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
|
|
57537
57536
|
forEach(pattern.elements, (e) => {
|
|
57538
57537
|
const name = e.propertyName || e.name;
|
|
57539
57538
|
if (e.dotDotDotToken) {
|
|
@@ -57547,7 +57546,7 @@ function createTypeChecker(host) {
|
|
|
57547
57546
|
}
|
|
57548
57547
|
const exprType = getLiteralTypeFromPropertyName(name);
|
|
57549
57548
|
if (!isTypeUsableAsPropertyName(exprType)) {
|
|
57550
|
-
objectFlags |=
|
|
57549
|
+
objectFlags |= 1024 /* ObjectLiteralPatternWithComputedProperties */;
|
|
57551
57550
|
return;
|
|
57552
57551
|
}
|
|
57553
57552
|
const text = getPropertyNameFromType(exprType);
|
|
@@ -57568,7 +57567,7 @@ function createTypeChecker(host) {
|
|
|
57568
57567
|
result.objectFlags |= objectFlags;
|
|
57569
57568
|
if (includePatternInType) {
|
|
57570
57569
|
result.pattern = pattern;
|
|
57571
|
-
result.objectFlags |=
|
|
57570
|
+
result.objectFlags |= 262144 /* ContainsObjectOrArrayLiteral */;
|
|
57572
57571
|
}
|
|
57573
57572
|
return result;
|
|
57574
57573
|
}
|
|
@@ -57586,7 +57585,7 @@ function createTypeChecker(host) {
|
|
|
57586
57585
|
if (includePatternInType) {
|
|
57587
57586
|
result = cloneTypeReference(result);
|
|
57588
57587
|
result.pattern = pattern;
|
|
57589
|
-
result.objectFlags |=
|
|
57588
|
+
result.objectFlags |= 262144 /* ContainsObjectOrArrayLiteral */;
|
|
57590
57589
|
}
|
|
57591
57590
|
return result;
|
|
57592
57591
|
}
|
|
@@ -57614,7 +57613,7 @@ function createTypeChecker(host) {
|
|
|
57614
57613
|
members.set(member.escapedName, member);
|
|
57615
57614
|
});
|
|
57616
57615
|
const type = createAnonymousType(symbol, members, emptyArray, emptyArray, emptyArray);
|
|
57617
|
-
type.objectFlags |=
|
|
57616
|
+
type.objectFlags |= 256 /* ObjectLiteral */ | 524288 /* NonInferrableType */;
|
|
57618
57617
|
links.resolvedType = type;
|
|
57619
57618
|
}
|
|
57620
57619
|
return links.resolvedType;
|
|
@@ -59402,6 +59401,14 @@ function createTypeChecker(host) {
|
|
|
59402
59401
|
type.constructSignatures = constructSignatures;
|
|
59403
59402
|
}
|
|
59404
59403
|
}
|
|
59404
|
+
function resolveTypeAliasInstantiationMembers(type) {
|
|
59405
|
+
const resolved = resolveStructuredTypeMembers(getResolvedTypeAliasInstantiation(type));
|
|
59406
|
+
type.members = resolved.members;
|
|
59407
|
+
type.properties = resolved.properties;
|
|
59408
|
+
type.callSignatures = resolved.callSignatures;
|
|
59409
|
+
type.constructSignatures = resolved.constructSignatures;
|
|
59410
|
+
type.indexInfos = resolved.indexInfos;
|
|
59411
|
+
}
|
|
59405
59412
|
function replaceIndexedAccess(instantiable, type, replacement) {
|
|
59406
59413
|
return instantiateType(instantiable, createTypeMapper([type.indexType, type.objectType], [getNumberLiteralType(0), createTupleType([replacement])]));
|
|
59407
59414
|
}
|
|
@@ -59668,12 +59675,14 @@ function createTypeChecker(host) {
|
|
|
59668
59675
|
resolveTypeReferenceMembers(type);
|
|
59669
59676
|
} else if (type.objectFlags & 3 /* ClassOrInterface */) {
|
|
59670
59677
|
resolveClassOrInterfaceMembers(type);
|
|
59671
|
-
} else if (type.objectFlags &
|
|
59678
|
+
} else if (type.objectFlags & 2048 /* ReverseMapped */) {
|
|
59672
59679
|
resolveReverseMappedTypeMembers(type);
|
|
59673
59680
|
} else if (type.objectFlags & 16 /* Anonymous */) {
|
|
59674
59681
|
resolveAnonymousTypeMembers(type);
|
|
59675
59682
|
} else if (type.objectFlags & 32 /* Mapped */) {
|
|
59676
59683
|
resolveMappedTypeMembers(type);
|
|
59684
|
+
} else if (type.objectFlags & 64 /* TypeAliasInstantiation */) {
|
|
59685
|
+
resolveTypeAliasInstantiationMembers(type);
|
|
59677
59686
|
} else {
|
|
59678
59687
|
Debug.fail("Unhandled object type " + Debug.formatObjectFlags(type.objectFlags));
|
|
59679
59688
|
}
|
|
@@ -60119,7 +60128,7 @@ function createTypeChecker(host) {
|
|
|
60119
60128
|
if (indexInfo) {
|
|
60120
60129
|
checkFlags |= 32 /* WritePartial */ | (indexInfo.isReadonly ? 8 /* Readonly */ : 0);
|
|
60121
60130
|
indexTypes = append(indexTypes, isTupleType(type) ? getRestTypeOfTupleType(type) || undefinedType : indexInfo.type);
|
|
60122
|
-
} else if (isObjectLiteralType2(type) && !(getObjectFlags(type) &
|
|
60131
|
+
} else if (isObjectLiteralType2(type) && !(getObjectFlags(type) & 4194304 /* ContainsSpread */)) {
|
|
60123
60132
|
checkFlags |= 32 /* WritePartial */;
|
|
60124
60133
|
indexTypes = append(indexTypes, undefinedType);
|
|
60125
60134
|
} else {
|
|
@@ -60245,22 +60254,22 @@ function createTypeChecker(host) {
|
|
|
60245
60254
|
return property && !(getCheckFlags(property) & 16 /* ReadPartial */) ? property : void 0;
|
|
60246
60255
|
}
|
|
60247
60256
|
function getReducedType(type) {
|
|
60248
|
-
if (type.flags & 1048576 /* Union */ && type.objectFlags &
|
|
60257
|
+
if (type.flags & 1048576 /* Union */ && type.objectFlags & 33554432 /* ContainsIntersections */) {
|
|
60249
60258
|
return type.resolvedReducedType || (type.resolvedReducedType = getReducedUnionType(type));
|
|
60250
60259
|
} else if (type.flags & 2097152 /* Intersection */) {
|
|
60251
|
-
if (!(type.objectFlags &
|
|
60252
|
-
type.objectFlags |=
|
|
60260
|
+
if (!(type.objectFlags & 33554432 /* IsNeverIntersectionComputed */)) {
|
|
60261
|
+
type.objectFlags |= 33554432 /* IsNeverIntersectionComputed */ | (some(getPropertiesOfUnionOrIntersectionType(type), isNeverReducedProperty) ? 67108864 /* IsNeverIntersection */ : 0);
|
|
60253
60262
|
}
|
|
60254
|
-
return type.objectFlags &
|
|
60263
|
+
return type.objectFlags & 67108864 /* IsNeverIntersection */ ? neverType : type;
|
|
60255
60264
|
}
|
|
60256
|
-
return type;
|
|
60265
|
+
return getResolvedType(type);
|
|
60257
60266
|
}
|
|
60258
60267
|
function getReducedUnionType(unionType) {
|
|
60259
60268
|
const reducedTypes = sameMap(unionType.types, getReducedType);
|
|
60260
60269
|
if (reducedTypes === unionType.types) {
|
|
60261
60270
|
return unionType;
|
|
60262
60271
|
}
|
|
60263
|
-
const reduced = getUnionType(reducedTypes);
|
|
60272
|
+
const reduced = getResolvedType(getUnionType(reducedTypes));
|
|
60264
60273
|
if (reduced.flags & 1048576 /* Union */) {
|
|
60265
60274
|
reduced.resolvedReducedType = reduced;
|
|
60266
60275
|
}
|
|
@@ -60276,14 +60285,14 @@ function createTypeChecker(host) {
|
|
|
60276
60285
|
return !prop.valueDeclaration && !!(getCheckFlags(prop) & 1024 /* ContainsPrivate */);
|
|
60277
60286
|
}
|
|
60278
60287
|
function isGenericReducibleType(type) {
|
|
60279
|
-
return !!(type.flags & 1048576 /* Union */ && type.objectFlags &
|
|
60288
|
+
return !!(type.flags & 1048576 /* Union */ && type.objectFlags & 33554432 /* ContainsIntersections */ && some(type.types, isGenericReducibleType) || type.flags & 2097152 /* Intersection */ && isReducibleIntersection(type));
|
|
60280
60289
|
}
|
|
60281
60290
|
function isReducibleIntersection(type) {
|
|
60282
60291
|
const uniqueFilled = type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper));
|
|
60283
60292
|
return getReducedType(uniqueFilled) !== uniqueFilled;
|
|
60284
60293
|
}
|
|
60285
60294
|
function elaborateNeverIntersection(errorInfo, type) {
|
|
60286
|
-
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
60295
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsNeverIntersection */) {
|
|
60287
60296
|
const neverProp = find(getPropertiesOfUnionOrIntersectionType(type), isDiscriminantWithNeverType);
|
|
60288
60297
|
if (neverProp) {
|
|
60289
60298
|
return chainDiagnosticMessages(errorInfo, Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents, typeToString(
|
|
@@ -61069,7 +61078,7 @@ function createTypeChecker(host) {
|
|
|
61069
61078
|
result |= getObjectFlags(type);
|
|
61070
61079
|
}
|
|
61071
61080
|
}
|
|
61072
|
-
return result &
|
|
61081
|
+
return result & 917504 /* PropagatingFlags */;
|
|
61073
61082
|
}
|
|
61074
61083
|
function tryCreateTypeReference(target, typeArguments) {
|
|
61075
61084
|
if (some(typeArguments) && target === emptyGenericType) {
|
|
@@ -61156,7 +61165,7 @@ function createTypeChecker(host) {
|
|
|
61156
61165
|
return errorType;
|
|
61157
61166
|
}
|
|
61158
61167
|
}
|
|
61159
|
-
if (node.kind === 183 /* TypeReference */ && isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length)) {
|
|
61168
|
+
if (node.kind === 183 /* TypeReference */ && (getAliasSymbolForTypeNode(node) || isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length))) {
|
|
61160
61169
|
return createDeferredTypeReference(
|
|
61161
61170
|
type,
|
|
61162
61171
|
node,
|
|
@@ -61169,23 +61178,6 @@ function createTypeChecker(host) {
|
|
|
61169
61178
|
}
|
|
61170
61179
|
return checkNoTypeArguments(node, symbol) ? type : errorType;
|
|
61171
61180
|
}
|
|
61172
|
-
function getTypeAliasInstantiation(symbol, typeArguments, aliasSymbol, aliasTypeArguments) {
|
|
61173
|
-
const type = getDeclaredTypeOfSymbol(symbol);
|
|
61174
|
-
if (type === intrinsicMarkerType) {
|
|
61175
|
-
const typeKind = intrinsicTypeKinds.get(symbol.escapedName);
|
|
61176
|
-
if (typeKind !== void 0 && typeArguments && typeArguments.length === 1) {
|
|
61177
|
-
return typeKind === 4 /* NoInfer */ ? getNoInferType(typeArguments[0]) : getStringMappingType(symbol, typeArguments[0]);
|
|
61178
|
-
}
|
|
61179
|
-
}
|
|
61180
|
-
const links = getSymbolLinks(symbol);
|
|
61181
|
-
const typeParameters = links.typeParameters;
|
|
61182
|
-
const id = getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
61183
|
-
let instantiation = links.instantiations.get(id);
|
|
61184
|
-
if (!instantiation) {
|
|
61185
|
-
links.instantiations.set(id, instantiation = instantiateTypeWithAlias(type, createTypeMapper(typeParameters, fillMissingTypeArguments(typeArguments, typeParameters, getMinTypeArgumentCount(typeParameters), isInJSFile(symbol.valueDeclaration))), aliasSymbol, aliasTypeArguments));
|
|
61186
|
-
}
|
|
61187
|
-
return instantiation;
|
|
61188
|
-
}
|
|
61189
61181
|
function getTypeFromTypeAliasReference(node, symbol) {
|
|
61190
61182
|
if (getCheckFlags(symbol) & 1048576 /* Unresolved */) {
|
|
61191
61183
|
const typeArguments = typeArgumentsFromTypeReferenceNode(node);
|
|
@@ -61236,10 +61228,13 @@ function createTypeChecker(host) {
|
|
|
61236
61228
|
const resolved = resolveAlias(aliasSymbol2);
|
|
61237
61229
|
if (resolved && resolved.flags & 524288 /* TypeAlias */) {
|
|
61238
61230
|
newAliasSymbol = resolved;
|
|
61239
|
-
aliasTypeArguments = typeArgumentsFromTypeReferenceNode(node)
|
|
61231
|
+
aliasTypeArguments = typeArgumentsFromTypeReferenceNode(node) ?? [];
|
|
61240
61232
|
}
|
|
61241
61233
|
}
|
|
61242
61234
|
}
|
|
61235
|
+
if (getObjectFlags(type) & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */) && node.kind === 183 /* TypeReference */ && isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length)) {
|
|
61236
|
+
return createDeferredTypeAliasInstantiation(symbol, node, newAliasSymbol, aliasTypeArguments);
|
|
61237
|
+
}
|
|
61243
61238
|
return getTypeAliasInstantiation(symbol, typeArgumentsFromTypeReferenceNode(node), newAliasSymbol, aliasTypeArguments);
|
|
61244
61239
|
}
|
|
61245
61240
|
return checkNoTypeArguments(node, symbol) ? type : errorType;
|
|
@@ -61249,6 +61244,43 @@ function createTypeChecker(host) {
|
|
|
61249
61244
|
const declaration = (_a = symbol.declarations) == null ? void 0 : _a.find(isTypeAlias);
|
|
61250
61245
|
return !!(declaration && getContainingFunction(declaration));
|
|
61251
61246
|
}
|
|
61247
|
+
function getTypeAliasInstantiation(symbol, typeArguments, aliasSymbol, aliasTypeArguments) {
|
|
61248
|
+
const type = getDeclaredTypeOfSymbol(symbol);
|
|
61249
|
+
if (type === intrinsicMarkerType) {
|
|
61250
|
+
const typeKind = intrinsicTypeKinds.get(symbol.escapedName);
|
|
61251
|
+
if (typeKind !== void 0 && typeArguments && typeArguments.length === 1) {
|
|
61252
|
+
return typeKind === 4 /* NoInfer */ ? getNoInferType(typeArguments[0]) : getStringMappingType(symbol, typeArguments[0]);
|
|
61253
|
+
}
|
|
61254
|
+
}
|
|
61255
|
+
const links = getSymbolLinks(symbol);
|
|
61256
|
+
const typeParameters = links.typeParameters;
|
|
61257
|
+
const id = getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
61258
|
+
let instantiation = links.instantiations.get(id);
|
|
61259
|
+
if (!instantiation) {
|
|
61260
|
+
links.instantiations.set(id, instantiation = instantiateTypeWithAlias(type, createTypeMapper(typeParameters, fillMissingTypeArguments(typeArguments, typeParameters, getMinTypeArgumentCount(typeParameters), isInJSFile(symbol.valueDeclaration))), aliasSymbol, aliasTypeArguments));
|
|
61261
|
+
}
|
|
61262
|
+
return instantiation;
|
|
61263
|
+
}
|
|
61264
|
+
function createDeferredTypeAliasInstantiation(typeAlias, node, aliasSymbol, aliasTypeArguments) {
|
|
61265
|
+
const type = getDeclaredTypeOfSymbol(typeAlias);
|
|
61266
|
+
const result = createObjectType(64 /* TypeAliasInstantiation */, type.symbol);
|
|
61267
|
+
result.typeAlias = typeAlias;
|
|
61268
|
+
result.node = node;
|
|
61269
|
+
result.aliasSymbol = aliasSymbol;
|
|
61270
|
+
result.aliasTypeArguments = aliasTypeArguments;
|
|
61271
|
+
return result;
|
|
61272
|
+
}
|
|
61273
|
+
function getResolvedType(type) {
|
|
61274
|
+
return type.flags & 524288 /* Object */ && type.objectFlags & 64 /* TypeAliasInstantiation */ ? getResolvedTypeAliasInstantiation(type) : type;
|
|
61275
|
+
}
|
|
61276
|
+
function getResolvedTypeAliasInstantiation(type) {
|
|
61277
|
+
if (!type.resolvedType) {
|
|
61278
|
+
const typeArguments = typeArgumentsFromTypeReferenceNode(type.node);
|
|
61279
|
+
const mappedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments;
|
|
61280
|
+
type.resolvedType = getTypeAliasInstantiation(type.typeAlias, mappedTypeArguments, type.aliasSymbol, type.aliasTypeArguments);
|
|
61281
|
+
}
|
|
61282
|
+
return type.resolvedType;
|
|
61283
|
+
}
|
|
61252
61284
|
function getTypeReferenceName(node) {
|
|
61253
61285
|
switch (node.kind) {
|
|
61254
61286
|
case 183 /* TypeReference */:
|
|
@@ -61940,7 +61972,7 @@ function createTypeChecker(host) {
|
|
|
61940
61972
|
return isNamedTupleMember(member) || isParameter(member) ? member : void 0;
|
|
61941
61973
|
}
|
|
61942
61974
|
function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) {
|
|
61943
|
-
return
|
|
61975
|
+
return isResolvedByTypeAlias(node) && (node.kind === 188 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : node.kind === 189 /* TupleType */ ? some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || some(node.typeArguments, mayResolveTypeAlias));
|
|
61944
61976
|
}
|
|
61945
61977
|
function isResolvedByTypeAlias(node) {
|
|
61946
61978
|
const parent2 = node.parent;
|
|
@@ -61995,7 +62027,7 @@ function createTypeChecker(host) {
|
|
|
61995
62027
|
const target = getArrayOrTupleTargetType(node);
|
|
61996
62028
|
if (target === emptyGenericType) {
|
|
61997
62029
|
links.resolvedType = emptyObjectType;
|
|
61998
|
-
} else if (!(node.kind === 189 /* TupleType */ && some(node.elements, (e) => !!(getTupleElementFlags(e) & 8 /* Variadic */))) && isDeferredTypeReferenceNode(node)) {
|
|
62030
|
+
} else if (!(node.kind === 189 /* TupleType */ && some(node.elements, (e) => !!(getTupleElementFlags(e) & 8 /* Variadic */))) && (getAliasSymbolForTypeNode(node) || isDeferredTypeReferenceNode(node))) {
|
|
61999
62031
|
links.resolvedType = node.kind === 189 /* TupleType */ && node.elements.length === 0 ? target : createDeferredTypeReference(
|
|
62000
62032
|
target,
|
|
62001
62033
|
node,
|
|
@@ -62215,12 +62247,12 @@ function createTypeChecker(host) {
|
|
|
62215
62247
|
includes |= flags & 473694207 /* IncludesMask */;
|
|
62216
62248
|
if (flags & 465829888 /* Instantiable */)
|
|
62217
62249
|
includes |= 33554432 /* IncludesInstantiable */;
|
|
62218
|
-
if (flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
62250
|
+
if (flags & 2097152 /* Intersection */ && getObjectFlags(type) & 134217728 /* IsConstrainedTypeVariable */)
|
|
62219
62251
|
includes |= 536870912 /* IncludesConstrainedTypeVariable */;
|
|
62220
62252
|
if (type === wildcardType)
|
|
62221
62253
|
includes |= 8388608 /* IncludesWildcard */;
|
|
62222
62254
|
if (!strictNullChecks && flags & 98304 /* Nullable */) {
|
|
62223
|
-
if (!(getObjectFlags(type) &
|
|
62255
|
+
if (!(getObjectFlags(type) & 131072 /* ContainsWideningType */))
|
|
62224
62256
|
includes |= 4194304 /* IncludesNonWideningType */;
|
|
62225
62257
|
} else {
|
|
62226
62258
|
const len = typeSet.length;
|
|
@@ -62327,7 +62359,7 @@ function createTypeChecker(host) {
|
|
|
62327
62359
|
function removeConstrainedTypeVariables(types) {
|
|
62328
62360
|
const typeVariables = [];
|
|
62329
62361
|
for (const type of types) {
|
|
62330
|
-
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
62362
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 134217728 /* IsConstrainedTypeVariable */) {
|
|
62331
62363
|
const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
62332
62364
|
pushIfUnique(typeVariables, type.types[index]);
|
|
62333
62365
|
}
|
|
@@ -62335,7 +62367,7 @@ function createTypeChecker(host) {
|
|
|
62335
62367
|
for (const typeVariable of typeVariables) {
|
|
62336
62368
|
const primitives = [];
|
|
62337
62369
|
for (const type of types) {
|
|
62338
|
-
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
62370
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 134217728 /* IsConstrainedTypeVariable */) {
|
|
62339
62371
|
const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
62340
62372
|
if (type.types[index] === typeVariable) {
|
|
62341
62373
|
insertType(primitives, type.types[1 - index]);
|
|
@@ -62348,7 +62380,7 @@ function createTypeChecker(host) {
|
|
|
62348
62380
|
while (i > 0) {
|
|
62349
62381
|
i--;
|
|
62350
62382
|
const type = types[i];
|
|
62351
|
-
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
62383
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 134217728 /* IsConstrainedTypeVariable */) {
|
|
62352
62384
|
const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
62353
62385
|
if (type.types[index] === typeVariable && containsType(primitives, type.types[1 - index])) {
|
|
62354
62386
|
orderedRemoveItemAt(types, i);
|
|
@@ -62457,7 +62489,7 @@ function createTypeChecker(host) {
|
|
|
62457
62489
|
origin = createOriginUnionOrIntersectionType(1048576 /* Union */, reducedTypes);
|
|
62458
62490
|
}
|
|
62459
62491
|
}
|
|
62460
|
-
const objectFlags = (includes & 36323331 /* NotPrimitiveUnion */ ? 0 :
|
|
62492
|
+
const objectFlags = (includes & 36323331 /* NotPrimitiveUnion */ ? 0 : 65536 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 33554432 /* ContainsIntersections */ : 0);
|
|
62461
62493
|
return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments, origin);
|
|
62462
62494
|
}
|
|
62463
62495
|
function getUnionOrIntersectionTypePredicate(signatures, kind) {
|
|
@@ -62608,14 +62640,14 @@ function createTypeChecker(host) {
|
|
|
62608
62640
|
}
|
|
62609
62641
|
function intersectUnionsOfPrimitiveTypes(types) {
|
|
62610
62642
|
let unionTypes2;
|
|
62611
|
-
const index = findIndex(types, (t) => !!(getObjectFlags(t) &
|
|
62643
|
+
const index = findIndex(types, (t) => !!(getObjectFlags(t) & 65536 /* PrimitiveUnion */));
|
|
62612
62644
|
if (index < 0) {
|
|
62613
62645
|
return false;
|
|
62614
62646
|
}
|
|
62615
62647
|
let i = index + 1;
|
|
62616
62648
|
while (i < types.length) {
|
|
62617
62649
|
const t = types[i];
|
|
62618
|
-
if (getObjectFlags(t) &
|
|
62650
|
+
if (getObjectFlags(t) & 65536 /* PrimitiveUnion */) {
|
|
62619
62651
|
(unionTypes2 || (unionTypes2 = [types[index]])).push(t);
|
|
62620
62652
|
orderedRemoveItemAt(types, i);
|
|
62621
62653
|
} else {
|
|
@@ -62636,7 +62668,7 @@ function createTypeChecker(host) {
|
|
|
62636
62668
|
}
|
|
62637
62669
|
}
|
|
62638
62670
|
}
|
|
62639
|
-
types[index] = getUnionTypeFromSortedList(result,
|
|
62671
|
+
types[index] = getUnionTypeFromSortedList(result, 65536 /* PrimitiveUnion */);
|
|
62640
62672
|
return true;
|
|
62641
62673
|
}
|
|
62642
62674
|
function createIntersectionType(types, objectFlags, aliasSymbol, aliasTypeArguments) {
|
|
@@ -62699,7 +62731,7 @@ function createTypeChecker(host) {
|
|
|
62699
62731
|
return neverType;
|
|
62700
62732
|
}
|
|
62701
62733
|
}
|
|
62702
|
-
objectFlags =
|
|
62734
|
+
objectFlags = 134217728 /* IsConstrainedTypeVariable */;
|
|
62703
62735
|
}
|
|
62704
62736
|
}
|
|
62705
62737
|
}
|
|
@@ -63052,7 +63084,7 @@ function createTypeChecker(host) {
|
|
|
63052
63084
|
if (noImplicitAny) {
|
|
63053
63085
|
return false;
|
|
63054
63086
|
}
|
|
63055
|
-
if (getObjectFlags(type) &
|
|
63087
|
+
if (getObjectFlags(type) & 8192 /* JSLiteral */) {
|
|
63056
63088
|
return true;
|
|
63057
63089
|
}
|
|
63058
63090
|
if (type.flags & 1048576 /* Union */) {
|
|
@@ -63300,28 +63332,28 @@ function createTypeChecker(host) {
|
|
|
63300
63332
|
return !!getGenericObjectFlags(type);
|
|
63301
63333
|
}
|
|
63302
63334
|
function isGenericObjectType(type) {
|
|
63303
|
-
return !!(getGenericObjectFlags(type) &
|
|
63335
|
+
return !!(getGenericObjectFlags(type) & 8388608 /* IsGenericObjectType */);
|
|
63304
63336
|
}
|
|
63305
63337
|
function isGenericIndexType(type) {
|
|
63306
|
-
return !!(getGenericObjectFlags(type) &
|
|
63338
|
+
return !!(getGenericObjectFlags(type) & 16777216 /* IsGenericIndexType */);
|
|
63307
63339
|
}
|
|
63308
63340
|
function getGenericObjectFlags(type) {
|
|
63309
63341
|
if (type.flags & 3145728 /* UnionOrIntersection */) {
|
|
63310
|
-
if (!(type.objectFlags &
|
|
63311
|
-
type.objectFlags |=
|
|
63342
|
+
if (!(type.objectFlags & 4194304 /* IsGenericTypeComputed */)) {
|
|
63343
|
+
type.objectFlags |= 4194304 /* IsGenericTypeComputed */ | reduceLeft(type.types, (flags, t) => flags | getGenericObjectFlags(t), 0);
|
|
63312
63344
|
}
|
|
63313
|
-
return type.objectFlags &
|
|
63345
|
+
return type.objectFlags & 25165824 /* IsGenericType */;
|
|
63314
63346
|
}
|
|
63315
63347
|
if (type.flags & 33554432 /* Substitution */) {
|
|
63316
|
-
if (!(type.objectFlags &
|
|
63317
|
-
type.objectFlags |=
|
|
63348
|
+
if (!(type.objectFlags & 4194304 /* IsGenericTypeComputed */)) {
|
|
63349
|
+
type.objectFlags |= 4194304 /* IsGenericTypeComputed */ | getGenericObjectFlags(type.baseType) | getGenericObjectFlags(type.constraint);
|
|
63318
63350
|
}
|
|
63319
|
-
return type.objectFlags &
|
|
63351
|
+
return type.objectFlags & 25165824 /* IsGenericType */;
|
|
63320
63352
|
}
|
|
63321
|
-
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ?
|
|
63353
|
+
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);
|
|
63322
63354
|
}
|
|
63323
63355
|
function getSimplifiedType(type, writing) {
|
|
63324
|
-
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : type;
|
|
63356
|
+
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : getResolvedType(type);
|
|
63325
63357
|
}
|
|
63326
63358
|
function distributeIndexOverObjectType(objectType, indexType, writing) {
|
|
63327
63359
|
if (objectType.flags & 1048576 /* Union */ || objectType.flags & 2097152 /* Intersection */ && !shouldDeferIndexType(objectType)) {
|
|
@@ -63821,7 +63853,7 @@ function createTypeChecker(host) {
|
|
|
63821
63853
|
}
|
|
63822
63854
|
}
|
|
63823
63855
|
const spread = createAnonymousType(type2.symbol, members, emptyArray, emptyArray, getIndexInfosOfType(type2));
|
|
63824
|
-
spread.objectFlags |=
|
|
63856
|
+
spread.objectFlags |= 256 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
|
|
63825
63857
|
return spread;
|
|
63826
63858
|
}
|
|
63827
63859
|
}
|
|
@@ -63898,7 +63930,7 @@ function createTypeChecker(host) {
|
|
|
63898
63930
|
}
|
|
63899
63931
|
}
|
|
63900
63932
|
const spread = createAnonymousType(symbol, members, emptyArray, emptyArray, sameMap(indexInfos, (info) => getIndexInfoWithReadonly(info, readonly)));
|
|
63901
|
-
spread.objectFlags |=
|
|
63933
|
+
spread.objectFlags |= 256 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */ | 4194304 /* ContainsSpread */ | objectFlags;
|
|
63902
63934
|
return spread;
|
|
63903
63935
|
}
|
|
63904
63936
|
function isSpreadableProperty(prop) {
|
|
@@ -64319,9 +64351,9 @@ function createTypeChecker(host) {
|
|
|
64319
64351
|
return result;
|
|
64320
64352
|
}
|
|
64321
64353
|
function getObjectTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
64322
|
-
const declaration = type.objectFlags & 4 /* Reference */ ? type.node : type.objectFlags &
|
|
64354
|
+
const declaration = type.objectFlags & 4 /* Reference */ ? type.node : type.objectFlags & 16777216 /* InstantiationExpressionType */ ? type.node : type.objectFlags & 64 /* TypeAliasInstantiation */ ? type.node : type.symbol.declarations[0];
|
|
64323
64355
|
const links = getNodeLinks(declaration);
|
|
64324
|
-
const target = type.objectFlags & 4 /* Reference */ ? links.resolvedType : type.objectFlags &
|
|
64356
|
+
const target = type.objectFlags & 4 /* Reference */ ? links.resolvedType : type.objectFlags & 128 /* Instantiated */ ? type.target : type;
|
|
64325
64357
|
let typeParameters = links.outerTypeParameters;
|
|
64326
64358
|
if (!typeParameters) {
|
|
64327
64359
|
let outerTypeParameters = getOuterTypeParameters(
|
|
@@ -64334,8 +64366,8 @@ function createTypeChecker(host) {
|
|
|
64334
64366
|
outerTypeParameters = addRange(outerTypeParameters, templateTagParameters);
|
|
64335
64367
|
}
|
|
64336
64368
|
typeParameters = outerTypeParameters || emptyArray;
|
|
64337
|
-
const allDeclarations = type.objectFlags & (4 /* Reference */ |
|
|
64338
|
-
typeParameters = (target.objectFlags & (4 /* Reference */ |
|
|
64369
|
+
const allDeclarations = type.objectFlags & (4 /* Reference */ | 16777216 /* InstantiationExpressionType */ | 64 /* TypeAliasInstantiation */) ? [declaration] : type.symbol.declarations;
|
|
64370
|
+
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;
|
|
64339
64371
|
links.outerTypeParameters = typeParameters;
|
|
64340
64372
|
}
|
|
64341
64373
|
if (typeParameters.length) {
|
|
@@ -64354,13 +64386,13 @@ function createTypeChecker(host) {
|
|
|
64354
64386
|
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);
|
|
64355
64387
|
target.instantiations.set(id, result);
|
|
64356
64388
|
const resultObjectFlags = getObjectFlags(result);
|
|
64357
|
-
if (result.flags & 3899393 /* ObjectFlagsType */ && !(resultObjectFlags &
|
|
64389
|
+
if (result.flags & 3899393 /* ObjectFlagsType */ && !(resultObjectFlags & 1048576 /* CouldContainTypeVariablesComputed */)) {
|
|
64358
64390
|
const resultCouldContainTypeVariables = some(typeArguments, couldContainTypeVariables);
|
|
64359
|
-
if (!(getObjectFlags(result) &
|
|
64391
|
+
if (!(getObjectFlags(result) & 1048576 /* CouldContainTypeVariablesComputed */)) {
|
|
64360
64392
|
if (resultObjectFlags & (32 /* Mapped */ | 16 /* Anonymous */ | 4 /* Reference */)) {
|
|
64361
|
-
result.objectFlags |=
|
|
64393
|
+
result.objectFlags |= 1048576 /* CouldContainTypeVariablesComputed */ | (resultCouldContainTypeVariables ? 2097152 /* CouldContainTypeVariables */ : 0);
|
|
64362
64394
|
} else {
|
|
64363
|
-
result.objectFlags |= !resultCouldContainTypeVariables ?
|
|
64395
|
+
result.objectFlags |= !resultCouldContainTypeVariables ? 1048576 /* CouldContainTypeVariablesComputed */ : 0;
|
|
64364
64396
|
}
|
|
64365
64397
|
}
|
|
64366
64398
|
}
|
|
@@ -64490,8 +64522,7 @@ function createTypeChecker(host) {
|
|
|
64490
64522
|
) : strictNullChecks && modifiers & 8 /* ExcludeOptional */ && isOptional ? getTypeWithFacts(propType, 524288 /* NEUndefined */) : propType;
|
|
64491
64523
|
}
|
|
64492
64524
|
function instantiateAnonymousType(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
64493
|
-
|
|
64494
|
-
const result = createObjectType(type.objectFlags & ~(524288 /* CouldContainTypeVariablesComputed */ | 1048576 /* CouldContainTypeVariables */) | 64 /* Instantiated */, type.symbol);
|
|
64525
|
+
const result = createObjectType(type.objectFlags & ~(1048576 /* CouldContainTypeVariablesComputed */ | 2097152 /* CouldContainTypeVariables */) | 128 /* Instantiated */, type.symbol);
|
|
64495
64526
|
if (type.objectFlags & 32 /* Mapped */) {
|
|
64496
64527
|
result.declaration = type.declaration;
|
|
64497
64528
|
const origTypeParameter = getTypeParameterFromMappedType(type);
|
|
@@ -64499,8 +64530,10 @@ function createTypeChecker(host) {
|
|
|
64499
64530
|
result.typeParameter = freshTypeParameter;
|
|
64500
64531
|
mapper = combineTypeMappers(makeUnaryTypeMapper(origTypeParameter, freshTypeParameter), mapper);
|
|
64501
64532
|
freshTypeParameter.mapper = mapper;
|
|
64502
|
-
}
|
|
64503
|
-
|
|
64533
|
+
} else if (type.objectFlags & 16777216 /* InstantiationExpressionType */) {
|
|
64534
|
+
result.node = type.node;
|
|
64535
|
+
} else if (type.objectFlags & 64 /* TypeAliasInstantiation */) {
|
|
64536
|
+
result.typeAlias = type.typeAlias;
|
|
64504
64537
|
result.node = type.node;
|
|
64505
64538
|
}
|
|
64506
64539
|
result.target = type;
|
|
@@ -64561,13 +64594,13 @@ function createTypeChecker(host) {
|
|
|
64561
64594
|
}
|
|
64562
64595
|
if (flags & 524288 /* Object */) {
|
|
64563
64596
|
const objectFlags = type.objectFlags;
|
|
64564
|
-
if (objectFlags & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */)) {
|
|
64597
|
+
if (objectFlags & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */ | 64 /* TypeAliasInstantiation */)) {
|
|
64565
64598
|
if (objectFlags & 4 /* Reference */ && !type.node) {
|
|
64566
64599
|
const resolvedTypeArguments = type.resolvedTypeArguments;
|
|
64567
64600
|
const newTypeArguments = instantiateTypes(resolvedTypeArguments, mapper);
|
|
64568
64601
|
return newTypeArguments !== resolvedTypeArguments ? createNormalizedTypeReference(type.target, newTypeArguments) : type;
|
|
64569
64602
|
}
|
|
64570
|
-
if (objectFlags &
|
|
64603
|
+
if (objectFlags & 2048 /* ReverseMapped */) {
|
|
64571
64604
|
return instantiateReverseMappedType(type, mapper);
|
|
64572
64605
|
}
|
|
64573
64606
|
return getObjectTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments);
|
|
@@ -65503,11 +65536,11 @@ function createTypeChecker(host) {
|
|
|
65503
65536
|
}
|
|
65504
65537
|
function isUnknownLikeUnionType(type) {
|
|
65505
65538
|
if (strictNullChecks && type.flags & 1048576 /* Union */) {
|
|
65506
|
-
if (!(type.objectFlags &
|
|
65539
|
+
if (!(type.objectFlags & 67108864 /* IsUnknownLikeUnionComputed */)) {
|
|
65507
65540
|
const types = type.types;
|
|
65508
|
-
type.objectFlags |=
|
|
65541
|
+
type.objectFlags |= 67108864 /* IsUnknownLikeUnionComputed */ | (types.length >= 3 && types[0].flags & 32768 /* Undefined */ && types[1].flags & 65536 /* Null */ && some(types, isEmptyAnonymousObjectType) ? 134217728 /* IsUnknownLikeUnion */ : 0);
|
|
65509
65542
|
}
|
|
65510
|
-
return !!(type.objectFlags &
|
|
65543
|
+
return !!(type.objectFlags & 134217728 /* IsUnknownLikeUnion */);
|
|
65511
65544
|
}
|
|
65512
65545
|
return false;
|
|
65513
65546
|
}
|
|
@@ -65618,7 +65651,7 @@ function createTypeChecker(host) {
|
|
|
65618
65651
|
return true;
|
|
65619
65652
|
if (s & 65536 /* Null */ && (!strictNullChecks && !(t & 3145728 /* UnionOrIntersection */) || t & 65536 /* Null */))
|
|
65620
65653
|
return true;
|
|
65621
|
-
if (s & 524288 /* Object */ && t & 67108864 /* NonPrimitive */ && !(relation === strictSubtypeRelation && isEmptyAnonymousObjectType(source) && !(getObjectFlags(source) &
|
|
65654
|
+
if (s & 524288 /* Object */ && t & 67108864 /* NonPrimitive */ && !(relation === strictSubtypeRelation && isEmptyAnonymousObjectType(source) && !(getObjectFlags(source) & 16384 /* FreshLiteral */)))
|
|
65622
65655
|
return true;
|
|
65623
65656
|
if (relation === assignableRelation || relation === comparableRelation) {
|
|
65624
65657
|
if (s & 1 /* Any */)
|
|
@@ -65677,11 +65710,11 @@ function createTypeChecker(host) {
|
|
|
65677
65710
|
return false;
|
|
65678
65711
|
}
|
|
65679
65712
|
function isIgnoredJsxProperty(source, sourceProp) {
|
|
65680
|
-
return getObjectFlags(source) &
|
|
65713
|
+
return getObjectFlags(source) & 4096 /* JsxAttributes */ && isHyphenatedJsxName(sourceProp.escapedName);
|
|
65681
65714
|
}
|
|
65682
65715
|
function getNormalizedType(type, writing) {
|
|
65683
65716
|
while (true) {
|
|
65684
|
-
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;
|
|
65717
|
+
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;
|
|
65685
65718
|
if (t === type)
|
|
65686
65719
|
return t;
|
|
65687
65720
|
type = t;
|
|
@@ -66071,7 +66104,7 @@ function createTypeChecker(host) {
|
|
|
66071
66104
|
if (relation === comparableRelation && !(target2.flags & 131072 /* Never */) && isSimpleTypeRelatedTo(target2, source2, relation) || isSimpleTypeRelatedTo(source2, target2, relation, reportErrors2 ? reportError : void 0))
|
|
66072
66105
|
return -1 /* True */;
|
|
66073
66106
|
if (source2.flags & 469499904 /* StructuredOrInstantiable */ || target2.flags & 469499904 /* StructuredOrInstantiable */) {
|
|
66074
|
-
const isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType2(source2) && getObjectFlags(source2) &
|
|
66107
|
+
const isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType2(source2) && getObjectFlags(source2) & 16384 /* FreshLiteral */);
|
|
66075
66108
|
if (isPerformingExcessPropertyChecks) {
|
|
66076
66109
|
if (hasExcessProperties(source2, target2, reportErrors2)) {
|
|
66077
66110
|
if (reportErrors2) {
|
|
@@ -66081,7 +66114,7 @@ function createTypeChecker(host) {
|
|
|
66081
66114
|
}
|
|
66082
66115
|
}
|
|
66083
66116
|
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));
|
|
66084
|
-
const isComparingJsxAttributes = !!(getObjectFlags(source2) &
|
|
66117
|
+
const isComparingJsxAttributes = !!(getObjectFlags(source2) & 4096 /* JsxAttributes */);
|
|
66085
66118
|
if (isPerformingCommonPropertyChecks && !hasCommonProperties(source2, target2, isComparingJsxAttributes)) {
|
|
66086
66119
|
if (reportErrors2) {
|
|
66087
66120
|
const sourceString = typeToString(originalSource.aliasSymbol ? originalSource : source2);
|
|
@@ -66146,7 +66179,7 @@ function createTypeChecker(host) {
|
|
|
66146
66179
|
tryElaborateErrorsForPrimitivesAndObjects(source2, target2);
|
|
66147
66180
|
} else if (source2.symbol && source2.flags & 524288 /* Object */ && globalObjectType === source2) {
|
|
66148
66181
|
reportError(Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
|
|
66149
|
-
} else if (getObjectFlags(source2) &
|
|
66182
|
+
} else if (getObjectFlags(source2) & 4096 /* JsxAttributes */ && target2.flags & 2097152 /* Intersection */) {
|
|
66150
66183
|
const targetTypes = target2.types;
|
|
66151
66184
|
const intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
|
|
66152
66185
|
const intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
|
|
@@ -66177,7 +66210,7 @@ function createTypeChecker(host) {
|
|
|
66177
66210
|
if (source2.flags & 3145728 /* UnionOrIntersection */ && target2.flags & 3145728 /* UnionOrIntersection */) {
|
|
66178
66211
|
const sourceUnionOrIntersection = source2;
|
|
66179
66212
|
const targetUnionOrIntersection = target2;
|
|
66180
|
-
if (sourceUnionOrIntersection.objectFlags & targetUnionOrIntersection.objectFlags &
|
|
66213
|
+
if (sourceUnionOrIntersection.objectFlags & targetUnionOrIntersection.objectFlags & 65536 /* PrimitiveUnion */) {
|
|
66181
66214
|
return;
|
|
66182
66215
|
}
|
|
66183
66216
|
const sourceSize = sourceUnionOrIntersection.types.length;
|
|
@@ -66211,10 +66244,10 @@ function createTypeChecker(host) {
|
|
|
66211
66244
|
}
|
|
66212
66245
|
function hasExcessProperties(source2, target2, reportErrors2) {
|
|
66213
66246
|
var _a2;
|
|
66214
|
-
if (!isExcessPropertyCheckTarget(target2) || !noImplicitAny && getObjectFlags(target2) &
|
|
66247
|
+
if (!isExcessPropertyCheckTarget(target2) || !noImplicitAny && getObjectFlags(target2) & 8192 /* JSLiteral */) {
|
|
66215
66248
|
return false;
|
|
66216
66249
|
}
|
|
66217
|
-
const isComparingJsxAttributes = !!(getObjectFlags(source2) &
|
|
66250
|
+
const isComparingJsxAttributes = !!(getObjectFlags(source2) & 4096 /* JsxAttributes */);
|
|
66218
66251
|
if ((relation === assignableRelation || relation === comparableRelation) && (isTypeSubsetOf(globalObjectType, target2) || !isComparingJsxAttributes && isEmptyObjectType(target2))) {
|
|
66219
66252
|
return false;
|
|
66220
66253
|
}
|
|
@@ -66353,7 +66386,7 @@ function createTypeChecker(host) {
|
|
|
66353
66386
|
if (containsType(targetTypes, source2)) {
|
|
66354
66387
|
return -1 /* True */;
|
|
66355
66388
|
}
|
|
66356
|
-
if (relation !== comparableRelation && getObjectFlags(target2) &
|
|
66389
|
+
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 */)) {
|
|
66357
66390
|
const alternateForm = source2 === source2.regularType ? source2.freshType : source2.regularType;
|
|
66358
66391
|
const primitive = source2.flags & 128 /* StringLiteral */ ? stringType : source2.flags & 256 /* NumberLiteral */ ? numberType : source2.flags & 2048 /* BigIntLiteral */ ? bigintType : void 0;
|
|
66359
66392
|
return primitive && containsType(targetTypes, primitive) || alternateForm && containsType(targetTypes, alternateForm) ? -1 /* True */ : 0 /* False */;
|
|
@@ -66757,7 +66790,7 @@ function createTypeChecker(host) {
|
|
|
66757
66790
|
false,
|
|
66758
66791
|
0 /* None */
|
|
66759
66792
|
);
|
|
66760
|
-
if (result2 && isObjectLiteralType2(source2) && getObjectFlags(source2) &
|
|
66793
|
+
if (result2 && isObjectLiteralType2(source2) && getObjectFlags(source2) & 16384 /* FreshLiteral */) {
|
|
66761
66794
|
result2 &= indexSignaturesRelatedTo(
|
|
66762
66795
|
source2,
|
|
66763
66796
|
target2,
|
|
@@ -66767,7 +66800,7 @@ function createTypeChecker(host) {
|
|
|
66767
66800
|
0 /* None */
|
|
66768
66801
|
);
|
|
66769
66802
|
}
|
|
66770
|
-
} else if (result2 && isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => t === target2 || !!(getObjectFlags(t) &
|
|
66803
|
+
} 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 */))) {
|
|
66771
66804
|
result2 &= propertiesRelatedTo(
|
|
66772
66805
|
source2,
|
|
66773
66806
|
target2,
|
|
@@ -67268,7 +67301,7 @@ function createTypeChecker(host) {
|
|
|
67268
67301
|
if (constraint !== source2) {
|
|
67269
67302
|
return isRelatedTo(constraint, target2, 1 /* Source */, reportErrors2);
|
|
67270
67303
|
}
|
|
67271
|
-
} else if ((relation === subtypeRelation || relation === strictSubtypeRelation) && isEmptyObjectType(target2) && getObjectFlags(target2) &
|
|
67304
|
+
} else if ((relation === subtypeRelation || relation === strictSubtypeRelation) && isEmptyObjectType(target2) && getObjectFlags(target2) & 16384 /* FreshLiteral */ && !isEmptyObjectType(source2)) {
|
|
67272
67305
|
return 0 /* False */;
|
|
67273
67306
|
}
|
|
67274
67307
|
if (sourceFlags & (524288 /* Object */ | 2097152 /* Intersection */) && targetFlags & 524288 /* Object */) {
|
|
@@ -67800,7 +67833,7 @@ function createTypeChecker(host) {
|
|
|
67800
67833
|
const incompatibleReporter = kind === 1 /* Construct */ ? reportIncompatibleConstructSignatureReturn : reportIncompatibleCallSignatureReturn;
|
|
67801
67834
|
const sourceObjectFlags = getObjectFlags(source2);
|
|
67802
67835
|
const targetObjectFlags = getObjectFlags(target2);
|
|
67803
|
-
if (sourceObjectFlags &
|
|
67836
|
+
if (sourceObjectFlags & 128 /* Instantiated */ && targetObjectFlags & 128 /* Instantiated */ && source2.symbol === target2.symbol || sourceObjectFlags & 4 /* Reference */ && targetObjectFlags & 4 /* Reference */ && source2.target === target2.target) {
|
|
67804
67837
|
Debug.assertEqual(sourceSignatures.length, targetSignatures.length);
|
|
67805
67838
|
for (let i = 0; i < targetSignatures.length; i++) {
|
|
67806
67839
|
const related = signatureRelatedTo(
|
|
@@ -68016,7 +68049,7 @@ function createTypeChecker(host) {
|
|
|
68016
68049
|
if (sourceInfo) {
|
|
68017
68050
|
return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2, intersectionState);
|
|
68018
68051
|
}
|
|
68019
|
-
if (!(intersectionState & 1 /* Source */) && (relation !== strictSubtypeRelation || getObjectFlags(source2) &
|
|
68052
|
+
if (!(intersectionState & 1 /* Source */) && (relation !== strictSubtypeRelation || getObjectFlags(source2) & 16384 /* FreshLiteral */) && isObjectTypeWithInferableIndex(source2)) {
|
|
68020
68053
|
return membersRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState);
|
|
68021
68054
|
}
|
|
68022
68055
|
if (reportErrors2) {
|
|
@@ -68290,11 +68323,11 @@ function createTypeChecker(host) {
|
|
|
68290
68323
|
}
|
|
68291
68324
|
function isDeeplyNestedType(type, stack, depth, maxDepth = 3) {
|
|
68292
68325
|
if (depth >= maxDepth) {
|
|
68293
|
-
if ((getObjectFlags(type) &
|
|
68326
|
+
if ((getObjectFlags(type) & 160 /* InstantiatedMapped */) === 160 /* InstantiatedMapped */) {
|
|
68294
68327
|
type = getMappedTargetWithSymbol(type);
|
|
68295
68328
|
}
|
|
68296
68329
|
if (type.flags & 2097152 /* Intersection */) {
|
|
68297
|
-
return some(type.types, (t) => isDeeplyNestedType(t, stack, depth, maxDepth));
|
|
68330
|
+
return some(type.types, (t) => isDeeplyNestedType(getResolvedType(t), stack, depth, maxDepth));
|
|
68298
68331
|
}
|
|
68299
68332
|
const identity2 = getRecursionIdentity(type);
|
|
68300
68333
|
let count = 0;
|
|
@@ -68316,17 +68349,17 @@ function createTypeChecker(host) {
|
|
|
68316
68349
|
}
|
|
68317
68350
|
function getMappedTargetWithSymbol(type) {
|
|
68318
68351
|
let target;
|
|
68319
|
-
while ((getObjectFlags(type) &
|
|
68352
|
+
while ((getObjectFlags(type) & 160 /* InstantiatedMapped */) === 160 /* InstantiatedMapped */ && (target = getModifiersTypeFromMappedType(type)) && (target.symbol || target.flags & 2097152 /* Intersection */ && some(target.types, (t) => !!t.symbol))) {
|
|
68320
68353
|
type = target;
|
|
68321
68354
|
}
|
|
68322
68355
|
return type;
|
|
68323
68356
|
}
|
|
68324
68357
|
function hasMatchingRecursionIdentity(type, identity2) {
|
|
68325
|
-
if ((getObjectFlags(type) &
|
|
68358
|
+
if ((getObjectFlags(type) & 160 /* InstantiatedMapped */) === 160 /* InstantiatedMapped */) {
|
|
68326
68359
|
type = getMappedTargetWithSymbol(type);
|
|
68327
68360
|
}
|
|
68328
68361
|
if (type.flags & 2097152 /* Intersection */) {
|
|
68329
|
-
return some(type.types, (t) => hasMatchingRecursionIdentity(t, identity2));
|
|
68362
|
+
return some(type.types, (t) => hasMatchingRecursionIdentity(getResolvedType(t), identity2));
|
|
68330
68363
|
}
|
|
68331
68364
|
return getRecursionIdentity(type) === identity2;
|
|
68332
68365
|
}
|
|
@@ -68509,10 +68542,10 @@ function createTypeChecker(host) {
|
|
|
68509
68542
|
if (!(getObjectFlags(type) & 4 /* Reference */) || !(getObjectFlags(type.target) & 3 /* ClassOrInterface */)) {
|
|
68510
68543
|
return void 0;
|
|
68511
68544
|
}
|
|
68512
|
-
if (getObjectFlags(type) &
|
|
68513
|
-
return getObjectFlags(type) &
|
|
68545
|
+
if (getObjectFlags(type) & 67108864 /* IdenticalBaseTypeCalculated */) {
|
|
68546
|
+
return getObjectFlags(type) & 134217728 /* IdenticalBaseTypeExists */ ? type.cachedEquivalentBaseType : void 0;
|
|
68514
68547
|
}
|
|
68515
|
-
type.objectFlags |=
|
|
68548
|
+
type.objectFlags |= 67108864 /* IdenticalBaseTypeCalculated */;
|
|
68516
68549
|
const target = type.target;
|
|
68517
68550
|
if (getObjectFlags(target) & 1 /* Class */) {
|
|
68518
68551
|
const baseTypeNode = getBaseTypeNodeOfClass(target);
|
|
@@ -68531,7 +68564,7 @@ function createTypeChecker(host) {
|
|
|
68531
68564
|
if (length(getTypeArguments(type)) > length(target.typeParameters)) {
|
|
68532
68565
|
instantiatedBase = getTypeWithThisArgument(instantiatedBase, last(getTypeArguments(type)));
|
|
68533
68566
|
}
|
|
68534
|
-
type.objectFlags |=
|
|
68567
|
+
type.objectFlags |= 134217728 /* IdenticalBaseTypeExists */;
|
|
68535
68568
|
return type.cachedEquivalentBaseType = instantiatedBase;
|
|
68536
68569
|
}
|
|
68537
68570
|
function isEmptyLiteralType(type) {
|
|
@@ -68716,7 +68749,7 @@ function createTypeChecker(host) {
|
|
|
68716
68749
|
}
|
|
68717
68750
|
function isObjectTypeWithInferableIndex(type) {
|
|
68718
68751
|
const objectFlags = getObjectFlags(type);
|
|
68719
|
-
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 &
|
|
68752
|
+
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));
|
|
68720
68753
|
}
|
|
68721
68754
|
function createSymbolWithType(source, type) {
|
|
68722
68755
|
const symbol = createSymbol(source.flags, source.escapedName, getCheckFlags(source) & 8 /* Readonly */);
|
|
@@ -68743,7 +68776,7 @@ function createTypeChecker(host) {
|
|
|
68743
68776
|
return members;
|
|
68744
68777
|
}
|
|
68745
68778
|
function getRegularTypeOfObjectLiteral(type) {
|
|
68746
|
-
if (!(isObjectLiteralType2(type) && getObjectFlags(type) &
|
|
68779
|
+
if (!(isObjectLiteralType2(type) && getObjectFlags(type) & 16384 /* FreshLiteral */)) {
|
|
68747
68780
|
return type;
|
|
68748
68781
|
}
|
|
68749
68782
|
const regularType = type.regularType;
|
|
@@ -68754,7 +68787,7 @@ function createTypeChecker(host) {
|
|
|
68754
68787
|
const members = transformTypeOfMembers(type, getRegularTypeOfObjectLiteral);
|
|
68755
68788
|
const regularNew = createAnonymousType(resolved.symbol, members, resolved.callSignatures, resolved.constructSignatures, resolved.indexInfos);
|
|
68756
68789
|
regularNew.flags = resolved.flags;
|
|
68757
|
-
regularNew.objectFlags |= resolved.objectFlags & ~
|
|
68790
|
+
regularNew.objectFlags |= resolved.objectFlags & ~16384 /* FreshLiteral */;
|
|
68758
68791
|
type.regularType = regularNew;
|
|
68759
68792
|
return regularNew;
|
|
68760
68793
|
}
|
|
@@ -68782,7 +68815,7 @@ function createTypeChecker(host) {
|
|
|
68782
68815
|
if (!context.resolvedProperties) {
|
|
68783
68816
|
const names = /* @__PURE__ */ new Map();
|
|
68784
68817
|
for (const t of getSiblingsOfContext(context)) {
|
|
68785
|
-
if (isObjectLiteralType2(t) && !(getObjectFlags(t) &
|
|
68818
|
+
if (isObjectLiteralType2(t) && !(getObjectFlags(t) & 4194304 /* ContainsSpread */)) {
|
|
68786
68819
|
for (const prop of getPropertiesOfType(t)) {
|
|
68787
68820
|
names.set(prop.escapedName, prop);
|
|
68788
68821
|
}
|
|
@@ -68829,7 +68862,7 @@ function createTypeChecker(host) {
|
|
|
68829
68862
|
}
|
|
68830
68863
|
}
|
|
68831
68864
|
const result = createAnonymousType(type.symbol, members, emptyArray, emptyArray, sameMap(getIndexInfosOfType(type), (info) => createIndexInfo(info.keyType, getWidenedType(info.type), info.isReadonly)));
|
|
68832
|
-
result.objectFlags |= getObjectFlags(type) & (
|
|
68865
|
+
result.objectFlags |= getObjectFlags(type) & (8192 /* JSLiteral */ | 524288 /* NonInferrableType */);
|
|
68833
68866
|
return result;
|
|
68834
68867
|
}
|
|
68835
68868
|
function getWidenedType(type) {
|
|
@@ -68840,7 +68873,7 @@ function createTypeChecker(host) {
|
|
|
68840
68873
|
);
|
|
68841
68874
|
}
|
|
68842
68875
|
function getWidenedTypeWithContext(type, context) {
|
|
68843
|
-
if (getObjectFlags(type) &
|
|
68876
|
+
if (getObjectFlags(type) & 393216 /* RequiresWidening */) {
|
|
68844
68877
|
if (context === void 0 && type.widened) {
|
|
68845
68878
|
return type.widened;
|
|
68846
68879
|
}
|
|
@@ -68873,7 +68906,7 @@ function createTypeChecker(host) {
|
|
|
68873
68906
|
}
|
|
68874
68907
|
function reportWideningErrorsInType(type) {
|
|
68875
68908
|
let errorReported = false;
|
|
68876
|
-
if (getObjectFlags(type) &
|
|
68909
|
+
if (getObjectFlags(type) & 131072 /* ContainsWideningType */) {
|
|
68877
68910
|
if (type.flags & 1048576 /* Union */) {
|
|
68878
68911
|
if (some(type.types, isEmptyObjectType)) {
|
|
68879
68912
|
errorReported = true;
|
|
@@ -68895,7 +68928,7 @@ function createTypeChecker(host) {
|
|
|
68895
68928
|
if (isObjectLiteralType2(type)) {
|
|
68896
68929
|
for (const p of getPropertiesOfObjectType(type)) {
|
|
68897
68930
|
const t = getTypeOfSymbol(p);
|
|
68898
|
-
if (getObjectFlags(t) &
|
|
68931
|
+
if (getObjectFlags(t) & 131072 /* ContainsWideningType */) {
|
|
68899
68932
|
if (!reportWideningErrorsInType(t)) {
|
|
68900
68933
|
error2(p.valueDeclaration, Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, symbolToString(p), typeToString(getWidenedType(t)));
|
|
68901
68934
|
}
|
|
@@ -68983,7 +69016,7 @@ function createTypeChecker(host) {
|
|
|
68983
69016
|
}
|
|
68984
69017
|
function reportErrorsFromWidening(declaration, type, wideningKind) {
|
|
68985
69018
|
addLazyDiagnostic(() => {
|
|
68986
|
-
if (noImplicitAny && getObjectFlags(type) &
|
|
69019
|
+
if (noImplicitAny && getObjectFlags(type) & 131072 /* ContainsWideningType */ && (!wideningKind || !getContextualSignatureForFunctionLikeDeclaration(declaration))) {
|
|
68987
69020
|
if (!reportWideningErrorsInType(type)) {
|
|
68988
69021
|
reportImplicitAny(declaration, type, wideningKind);
|
|
68989
69022
|
}
|
|
@@ -69120,12 +69153,12 @@ function createTypeChecker(host) {
|
|
|
69120
69153
|
}
|
|
69121
69154
|
function couldContainTypeVariables(type) {
|
|
69122
69155
|
const objectFlags = getObjectFlags(type);
|
|
69123
|
-
if (objectFlags &
|
|
69124
|
-
return !!(objectFlags &
|
|
69156
|
+
if (objectFlags & 1048576 /* CouldContainTypeVariablesComputed */) {
|
|
69157
|
+
return !!(objectFlags & 2097152 /* CouldContainTypeVariables */);
|
|
69125
69158
|
}
|
|
69126
|
-
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 */ |
|
|
69159
|
+
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));
|
|
69127
69160
|
if (type.flags & 3899393 /* ObjectFlagsType */) {
|
|
69128
|
-
type.objectFlags |=
|
|
69161
|
+
type.objectFlags |= 1048576 /* CouldContainTypeVariablesComputed */ | (result ? 2097152 /* CouldContainTypeVariables */ : 0);
|
|
69129
69162
|
}
|
|
69130
69163
|
return result;
|
|
69131
69164
|
}
|
|
@@ -69189,7 +69222,7 @@ function createTypeChecker(host) {
|
|
|
69189
69222
|
return type;
|
|
69190
69223
|
}
|
|
69191
69224
|
function isPartiallyInferableType(type) {
|
|
69192
|
-
return !(getObjectFlags(type) &
|
|
69225
|
+
return !(getObjectFlags(type) & 524288 /* NonInferrableType */) || isObjectLiteralType2(type) && some(getPropertiesOfType(type), (prop) => isPartiallyInferableType(getTypeOfSymbol(prop))) || isTupleType(type) && some(getElementTypes(type), isPartiallyInferableType);
|
|
69193
69226
|
}
|
|
69194
69227
|
function createReverseMappedType(source, target, constraint) {
|
|
69195
69228
|
if (!(getIndexInfoOfType(source, stringType) || getPropertiesOfType(source).length !== 0 && isPartiallyInferableType(source))) {
|
|
@@ -69204,7 +69237,7 @@ function createTypeChecker(host) {
|
|
|
69204
69237
|
return createTupleType(elementTypes, elementFlags, source.target.readonly, source.target.labeledElementDeclarations);
|
|
69205
69238
|
}
|
|
69206
69239
|
const reversed = createObjectType(
|
|
69207
|
-
|
|
69240
|
+
2048 /* ReverseMapped */ | 16 /* Anonymous */,
|
|
69208
69241
|
/*symbol*/
|
|
69209
69242
|
void 0
|
|
69210
69243
|
);
|
|
@@ -69425,6 +69458,8 @@ function createTypeChecker(host) {
|
|
|
69425
69458
|
propagationType = savePropagationType;
|
|
69426
69459
|
return;
|
|
69427
69460
|
}
|
|
69461
|
+
source = getResolvedType(source);
|
|
69462
|
+
target = getResolvedType(target);
|
|
69428
69463
|
if (source.aliasSymbol && source.aliasSymbol === target.aliasSymbol) {
|
|
69429
69464
|
if (source.aliasTypeArguments) {
|
|
69430
69465
|
const params = getSymbolLinks(source.aliasSymbol).typeParameters;
|
|
@@ -69475,7 +69510,7 @@ function createTypeChecker(host) {
|
|
|
69475
69510
|
}
|
|
69476
69511
|
const inference = getInferenceInfoForType(target);
|
|
69477
69512
|
if (inference) {
|
|
69478
|
-
if (getObjectFlags(source) &
|
|
69513
|
+
if (getObjectFlags(source) & 524288 /* NonInferrableType */ || source === nonInferrableAnyType) {
|
|
69479
69514
|
return;
|
|
69480
69515
|
}
|
|
69481
69516
|
if (!inference.isFixed) {
|
|
@@ -69759,7 +69794,7 @@ function createTypeChecker(host) {
|
|
|
69759
69794
|
inferWithPriority(
|
|
69760
69795
|
inferredType,
|
|
69761
69796
|
inference.typeParameter,
|
|
69762
|
-
getObjectFlags(source) &
|
|
69797
|
+
getObjectFlags(source) & 524288 /* NonInferrableType */ ? 16 /* PartialHomomorphicMappedType */ : 8 /* HomomorphicMappedType */
|
|
69763
69798
|
);
|
|
69764
69799
|
}
|
|
69765
69800
|
}
|
|
@@ -70014,10 +70049,10 @@ function createTypeChecker(host) {
|
|
|
70014
70049
|
return !!constraint && maybeTypeOfKind(constraint.flags & 16777216 /* Conditional */ ? getDefaultConstraintOfConditionalType(constraint) : constraint, 402784252 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */);
|
|
70015
70050
|
}
|
|
70016
70051
|
function isObjectLiteralType2(type) {
|
|
70017
|
-
return !!(getObjectFlags(type) &
|
|
70052
|
+
return !!(getObjectFlags(type) & 256 /* ObjectLiteral */);
|
|
70018
70053
|
}
|
|
70019
70054
|
function isObjectOrArrayLiteralType(type) {
|
|
70020
|
-
return !!(getObjectFlags(type) & (
|
|
70055
|
+
return !!(getObjectFlags(type) & (256 /* ObjectLiteral */ | 32768 /* ArrayLiteral */));
|
|
70021
70056
|
}
|
|
70022
70057
|
function unionObjectAndArrayLiteralCandidates(candidates) {
|
|
70023
70058
|
if (candidates.length > 1) {
|
|
@@ -70345,7 +70380,7 @@ function createTypeChecker(host) {
|
|
|
70345
70380
|
}
|
|
70346
70381
|
function getKeyPropertyName(unionType) {
|
|
70347
70382
|
const types = unionType.types;
|
|
70348
|
-
if (types.length < 10 || getObjectFlags(unionType) &
|
|
70383
|
+
if (types.length < 10 || getObjectFlags(unionType) & 65536 /* PrimitiveUnion */ || countWhere(types, (t) => !!(t.flags & (524288 /* Object */ | 58982400 /* InstantiableNonPrimitive */))) < 10) {
|
|
70349
70384
|
return void 0;
|
|
70350
70385
|
}
|
|
70351
70386
|
if (unionType.keyPropertyName === void 0) {
|
|
@@ -70734,7 +70769,7 @@ function createTypeChecker(host) {
|
|
|
70734
70769
|
}
|
|
70735
70770
|
return getUnionTypeFromSortedList(
|
|
70736
70771
|
filtered,
|
|
70737
|
-
type.objectFlags & (
|
|
70772
|
+
type.objectFlags & (65536 /* PrimitiveUnion */ | 33554432 /* ContainsIntersections */),
|
|
70738
70773
|
/*aliasSymbol*/
|
|
70739
70774
|
void 0,
|
|
70740
70775
|
/*aliasTypeArguments*/
|
|
@@ -70796,7 +70831,7 @@ function createTypeChecker(host) {
|
|
|
70796
70831
|
return incomplete ? { flags: 0, type: type.flags & 131072 /* Never */ ? silentNeverType : type } : type;
|
|
70797
70832
|
}
|
|
70798
70833
|
function createEvolvingArrayType(elementType) {
|
|
70799
|
-
const result = createObjectType(
|
|
70834
|
+
const result = createObjectType(512 /* EvolvingArray */);
|
|
70800
70835
|
result.elementType = elementType;
|
|
70801
70836
|
return result;
|
|
70802
70837
|
}
|
|
@@ -70816,16 +70851,16 @@ function createTypeChecker(host) {
|
|
|
70816
70851
|
return evolvingArrayType.finalArrayType || (evolvingArrayType.finalArrayType = createFinalArrayType(evolvingArrayType.elementType));
|
|
70817
70852
|
}
|
|
70818
70853
|
function finalizeEvolvingArrayType(type) {
|
|
70819
|
-
return getObjectFlags(type) &
|
|
70854
|
+
return getObjectFlags(type) & 512 /* EvolvingArray */ ? getFinalArrayType(type) : type;
|
|
70820
70855
|
}
|
|
70821
70856
|
function getElementTypeOfEvolvingArrayType(type) {
|
|
70822
|
-
return getObjectFlags(type) &
|
|
70857
|
+
return getObjectFlags(type) & 512 /* EvolvingArray */ ? type.elementType : neverType;
|
|
70823
70858
|
}
|
|
70824
70859
|
function isEvolvingArrayTypeList(types) {
|
|
70825
70860
|
let hasEvolvingArrayType = false;
|
|
70826
70861
|
for (const t of types) {
|
|
70827
70862
|
if (!(t.flags & 131072 /* Never */)) {
|
|
70828
|
-
if (!(getObjectFlags(t) &
|
|
70863
|
+
if (!(getObjectFlags(t) & 512 /* EvolvingArray */)) {
|
|
70829
70864
|
return false;
|
|
70830
70865
|
}
|
|
70831
70866
|
hasEvolvingArrayType = true;
|
|
@@ -71129,7 +71164,7 @@ function createTypeChecker(host) {
|
|
|
71129
71164
|
const sharedFlowStart = sharedFlowCount;
|
|
71130
71165
|
const evolvedType = getTypeFromFlowType(getTypeAtFlowNode(flowNode));
|
|
71131
71166
|
sharedFlowCount = sharedFlowStart;
|
|
71132
|
-
const resultType = getObjectFlags(evolvedType) &
|
|
71167
|
+
const resultType = getObjectFlags(evolvedType) & 512 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType);
|
|
71133
71168
|
if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 235 /* NonNullExpression */ && !(resultType.flags & 131072 /* Never */) && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) {
|
|
71134
71169
|
return declaredType;
|
|
71135
71170
|
}
|
|
@@ -71316,7 +71351,7 @@ function createTypeChecker(host) {
|
|
|
71316
71351
|
if (isMatchingReference(reference, getReferenceCandidate(expr))) {
|
|
71317
71352
|
const flowType = getTypeAtFlowNode(flow.antecedent);
|
|
71318
71353
|
const type = getTypeFromFlowType(flowType);
|
|
71319
|
-
if (getObjectFlags(type) &
|
|
71354
|
+
if (getObjectFlags(type) & 512 /* EvolvingArray */) {
|
|
71320
71355
|
let evolvedType2 = type;
|
|
71321
71356
|
if (node.kind === 213 /* CallExpression */) {
|
|
71322
71357
|
for (const arg of node.arguments) {
|
|
@@ -72169,7 +72204,7 @@ function createTypeChecker(host) {
|
|
|
72169
72204
|
location = location.parent;
|
|
72170
72205
|
}
|
|
72171
72206
|
if (isExpressionNode(location) && (!isAssignmentTarget(location) || isWriteAccess(location))) {
|
|
72172
|
-
const type = removeOptionalTypeMarker(
|
|
72207
|
+
const type = getResolvedType(removeOptionalTypeMarker(
|
|
72173
72208
|
isWriteAccess(location) && location.kind === 211 /* PropertyAccessExpression */ ? checkPropertyAccessExpression(
|
|
72174
72209
|
location,
|
|
72175
72210
|
/*checkMode*/
|
|
@@ -72177,7 +72212,7 @@ function createTypeChecker(host) {
|
|
|
72177
72212
|
/*writeOnly*/
|
|
72178
72213
|
true
|
|
72179
72214
|
) : getTypeOfExpression(location)
|
|
72180
|
-
);
|
|
72215
|
+
));
|
|
72181
72216
|
if (getExportSymbolOfValueSymbolIfExported(getNodeLinks(location).resolvedSymbol) === symbol) {
|
|
72182
72217
|
return type;
|
|
72183
72218
|
}
|
|
@@ -74225,7 +74260,7 @@ function createTypeChecker(host) {
|
|
|
74225
74260
|
let literalType = type.literalType;
|
|
74226
74261
|
if (!literalType) {
|
|
74227
74262
|
literalType = type.literalType = cloneTypeReference(type);
|
|
74228
|
-
literalType.objectFlags |=
|
|
74263
|
+
literalType.objectFlags |= 32768 /* ArrayLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
|
|
74229
74264
|
}
|
|
74230
74265
|
return literalType;
|
|
74231
74266
|
}
|
|
@@ -74353,7 +74388,7 @@ function createTypeChecker(host) {
|
|
|
74353
74388
|
checkTypeAssignableTo(type, getTypeFromTypeNode(enumTag.typeExpression), memberDecl);
|
|
74354
74389
|
}
|
|
74355
74390
|
}
|
|
74356
|
-
objectFlags |= getObjectFlags(type) &
|
|
74391
|
+
objectFlags |= getObjectFlags(type) & 917504 /* PropagatingFlags */;
|
|
74357
74392
|
const nameType = computedNameType && isTypeUsableAsPropertyName(computedNameType) ? computedNameType : void 0;
|
|
74358
74393
|
const prop = nameType ? createSymbol(4 /* Property */ | member.flags, getPropertyNameFromType(nameType), checkFlags | 4096 /* Late */) : createSymbol(4 /* Property */ | member.flags, member.escapedName, checkFlags);
|
|
74359
74394
|
if (nameType) {
|
|
@@ -74364,7 +74399,7 @@ function createTypeChecker(host) {
|
|
|
74364
74399
|
if (isOptional) {
|
|
74365
74400
|
prop.flags |= 16777216 /* Optional */;
|
|
74366
74401
|
}
|
|
74367
|
-
} else if (contextualTypeHasPattern && !(getObjectFlags(contextualType) &
|
|
74402
|
+
} else if (contextualTypeHasPattern && !(getObjectFlags(contextualType) & 1024 /* ObjectLiteralPatternWithComputedProperties */)) {
|
|
74368
74403
|
const impliedProp = getPropertyOfType(contextualType, member.escapedName);
|
|
74369
74404
|
if (impliedProp) {
|
|
74370
74405
|
prop.flags |= impliedProp.flags & 16777216 /* Optional */;
|
|
@@ -74476,12 +74511,12 @@ function createTypeChecker(host) {
|
|
|
74476
74511
|
if (hasComputedSymbolProperty)
|
|
74477
74512
|
indexInfos.push(getObjectLiteralIndexInfo(node, offset, propertiesArray, esSymbolType));
|
|
74478
74513
|
const result = createAnonymousType(node.symbol, propertiesTable, emptyArray, emptyArray, indexInfos);
|
|
74479
|
-
result.objectFlags |= objectFlags |
|
|
74514
|
+
result.objectFlags |= objectFlags | 256 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
|
|
74480
74515
|
if (isJSObjectLiteral) {
|
|
74481
|
-
result.objectFlags |=
|
|
74516
|
+
result.objectFlags |= 8192 /* JSLiteral */;
|
|
74482
74517
|
}
|
|
74483
74518
|
if (patternWithComputedProperties) {
|
|
74484
|
-
result.objectFlags |=
|
|
74519
|
+
result.objectFlags |= 1024 /* ObjectLiteralPatternWithComputedProperties */;
|
|
74485
74520
|
}
|
|
74486
74521
|
if (inDestructuringPattern) {
|
|
74487
74522
|
result.pattern = node;
|
|
@@ -74543,13 +74578,13 @@ function createTypeChecker(host) {
|
|
|
74543
74578
|
let hasSpreadAnyType = false;
|
|
74544
74579
|
let typeToIntersect;
|
|
74545
74580
|
let explicitlySpecifyChildrenAttribute = false;
|
|
74546
|
-
let objectFlags =
|
|
74581
|
+
let objectFlags = 4096 /* JsxAttributes */;
|
|
74547
74582
|
const jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(openingLikeElement));
|
|
74548
74583
|
for (const attributeDecl of attributes.properties) {
|
|
74549
74584
|
const member = attributeDecl.symbol;
|
|
74550
74585
|
if (isJsxAttribute(attributeDecl)) {
|
|
74551
74586
|
const exprType = checkJsxAttribute(attributeDecl, checkMode);
|
|
74552
|
-
objectFlags |= getObjectFlags(exprType) &
|
|
74587
|
+
objectFlags |= getObjectFlags(exprType) & 917504 /* PropagatingFlags */;
|
|
74553
74588
|
const attributeSymbol = createSymbol(4 /* Property */ | member.flags, member.escapedName);
|
|
74554
74589
|
attributeSymbol.declarations = member.declarations;
|
|
74555
74590
|
attributeSymbol.parent = member.parent;
|
|
@@ -74670,7 +74705,7 @@ function createTypeChecker(host) {
|
|
|
74670
74705
|
function createJsxAttributesType() {
|
|
74671
74706
|
objectFlags |= freshObjectLiteralFlag;
|
|
74672
74707
|
const result = createAnonymousType(attributes.symbol, attributesTable, emptyArray, emptyArray, emptyArray);
|
|
74673
|
-
result.objectFlags |= objectFlags |
|
|
74708
|
+
result.objectFlags |= objectFlags | 256 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
|
|
74674
74709
|
return result;
|
|
74675
74710
|
}
|
|
74676
74711
|
}
|
|
@@ -75063,7 +75098,7 @@ function createTypeChecker(host) {
|
|
|
75063
75098
|
return false;
|
|
75064
75099
|
}
|
|
75065
75100
|
function isExcessPropertyCheckTarget(type) {
|
|
75066
|
-
return !!(type.flags & 524288 /* Object */ && !(getObjectFlags(type) &
|
|
75101
|
+
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));
|
|
75067
75102
|
}
|
|
75068
75103
|
function checkJsxExpression(node, checkMode) {
|
|
75069
75104
|
checkGrammarJsxExpression(node);
|
|
@@ -77831,7 +77866,7 @@ function createTypeChecker(host) {
|
|
|
77831
77866
|
);
|
|
77832
77867
|
if ((_c = jsSymbol == null ? void 0 : jsSymbol.exports) == null ? void 0 : _c.size) {
|
|
77833
77868
|
const jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, emptyArray, emptyArray, emptyArray);
|
|
77834
|
-
jsAssignmentType.objectFlags |=
|
|
77869
|
+
jsAssignmentType.objectFlags |= 8192 /* JSLiteral */;
|
|
77835
77870
|
return getIntersectionType([returnType, jsAssignmentType]);
|
|
77836
77871
|
}
|
|
77837
77872
|
}
|
|
@@ -78177,7 +78212,7 @@ function createTypeChecker(host) {
|
|
|
78177
78212
|
hasApplicableSignature || (hasApplicableSignature = callSignatures.length !== 0 || constructSignatures.length !== 0);
|
|
78178
78213
|
if (callSignatures !== resolved.callSignatures || constructSignatures !== resolved.constructSignatures) {
|
|
78179
78214
|
const result3 = createAnonymousType(createSymbol(0 /* None */, "__instantiationExpression" /* InstantiationExpression */), resolved.members, callSignatures, constructSignatures, resolved.indexInfos);
|
|
78180
|
-
result3.objectFlags |=
|
|
78215
|
+
result3.objectFlags |= 16777216 /* InstantiationExpressionType */;
|
|
78181
78216
|
result3.node = node;
|
|
78182
78217
|
return result3;
|
|
78183
78218
|
}
|
|
@@ -79218,7 +79253,7 @@ function createTypeChecker(host) {
|
|
|
79218
79253
|
64 /* IsNonInferrable */
|
|
79219
79254
|
);
|
|
79220
79255
|
const returnOnlyType = createAnonymousType(node.symbol, emptySymbols, [returnOnlySignature], emptyArray, emptyArray);
|
|
79221
|
-
returnOnlyType.objectFlags |=
|
|
79256
|
+
returnOnlyType.objectFlags |= 524288 /* NonInferrableType */;
|
|
79222
79257
|
return links.contextFreeType = returnOnlyType;
|
|
79223
79258
|
}
|
|
79224
79259
|
}
|
|
@@ -89994,7 +90029,7 @@ function createTypeChecker(host) {
|
|
|
89994
90029
|
}
|
|
89995
90030
|
}
|
|
89996
90031
|
function findBestTypeForObjectLiteral(source, unionTarget) {
|
|
89997
|
-
if (getObjectFlags(source) &
|
|
90032
|
+
if (getObjectFlags(source) & 256 /* ObjectLiteral */ && someType(unionTarget, isArrayLikeType)) {
|
|
89998
90033
|
return find(unionTarget.types, (t) => !isArrayLikeType(t));
|
|
89999
90034
|
}
|
|
90000
90035
|
}
|
|
@@ -154307,7 +154342,7 @@ function createUndefined() {
|
|
|
154307
154342
|
return factory.createIdentifier("undefined");
|
|
154308
154343
|
}
|
|
154309
154344
|
function isObjectLiteralType(type) {
|
|
154310
|
-
return type.flags & 524288 /* Object */ && (getObjectFlags(type) &
|
|
154345
|
+
return type.flags & 524288 /* Object */ && (getObjectFlags(type) & 256 /* ObjectLiteral */ || type.symbol && tryCast(singleOrUndefined(type.symbol.declarations), isTypeLiteralNode));
|
|
154311
154346
|
}
|
|
154312
154347
|
function getUnmatchedAttributes(checker, target, source) {
|
|
154313
154348
|
const attrsType = checker.getContextualType(source.attributes);
|