@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/tsc.js
CHANGED
|
@@ -1746,8 +1746,8 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
1746
1746
|
// for use with vscode-js-debug's new customDescriptionGenerator in launch.json
|
|
1747
1747
|
__tsDebuggerDisplay: {
|
|
1748
1748
|
value() {
|
|
1749
|
-
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 &
|
|
1750
|
-
const remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~
|
|
1749
|
+
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";
|
|
1750
|
+
const remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~2623 /* ObjectTypeKindMask */ : 0;
|
|
1751
1751
|
return `${typeHeader}${this.symbol ? ` '${symbolName(this.symbol)}'` : ""}${remainingObjectFlags ? ` (${formatObjectFlags(remainingObjectFlags)})` : ""}`;
|
|
1752
1752
|
}
|
|
1753
1753
|
},
|
|
@@ -2926,7 +2926,7 @@ var tracingEnabled;
|
|
|
2926
2926
|
};
|
|
2927
2927
|
}
|
|
2928
2928
|
let reverseMappedProperties = {};
|
|
2929
|
-
if (objectFlags &
|
|
2929
|
+
if (objectFlags & 2048 /* ReverseMapped */) {
|
|
2930
2930
|
const reverseMappedType = type;
|
|
2931
2931
|
reverseMappedProperties = {
|
|
2932
2932
|
reverseMappedSourceType: (_l = reverseMappedType.source) == null ? void 0 : _l.id,
|
|
@@ -2935,7 +2935,7 @@ var tracingEnabled;
|
|
|
2935
2935
|
};
|
|
2936
2936
|
}
|
|
2937
2937
|
let evolvingArrayProperties = {};
|
|
2938
|
-
if (objectFlags &
|
|
2938
|
+
if (objectFlags & 512 /* EvolvingArray */) {
|
|
2939
2939
|
const evolvingArrayType = type;
|
|
2940
2940
|
evolvingArrayProperties = {
|
|
2941
2941
|
evolvingArrayElementType: evolvingArrayType.elementType.id,
|
|
@@ -3685,42 +3685,43 @@ var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => {
|
|
|
3685
3685
|
ObjectFlags3[ObjectFlags3["Tuple"] = 8] = "Tuple";
|
|
3686
3686
|
ObjectFlags3[ObjectFlags3["Anonymous"] = 16] = "Anonymous";
|
|
3687
3687
|
ObjectFlags3[ObjectFlags3["Mapped"] = 32] = "Mapped";
|
|
3688
|
-
ObjectFlags3[ObjectFlags3["
|
|
3689
|
-
ObjectFlags3[ObjectFlags3["
|
|
3690
|
-
ObjectFlags3[ObjectFlags3["
|
|
3691
|
-
ObjectFlags3[ObjectFlags3["
|
|
3692
|
-
ObjectFlags3[ObjectFlags3["
|
|
3693
|
-
ObjectFlags3[ObjectFlags3["
|
|
3694
|
-
ObjectFlags3[ObjectFlags3["
|
|
3695
|
-
ObjectFlags3[ObjectFlags3["
|
|
3696
|
-
ObjectFlags3[ObjectFlags3["
|
|
3697
|
-
ObjectFlags3[ObjectFlags3["
|
|
3698
|
-
ObjectFlags3[ObjectFlags3["
|
|
3699
|
-
ObjectFlags3[ObjectFlags3["
|
|
3700
|
-
ObjectFlags3[ObjectFlags3["
|
|
3701
|
-
ObjectFlags3[ObjectFlags3["
|
|
3702
|
-
ObjectFlags3[ObjectFlags3["
|
|
3688
|
+
ObjectFlags3[ObjectFlags3["TypeAliasInstantiation"] = 64] = "TypeAliasInstantiation";
|
|
3689
|
+
ObjectFlags3[ObjectFlags3["Instantiated"] = 128] = "Instantiated";
|
|
3690
|
+
ObjectFlags3[ObjectFlags3["ObjectLiteral"] = 256] = "ObjectLiteral";
|
|
3691
|
+
ObjectFlags3[ObjectFlags3["EvolvingArray"] = 512] = "EvolvingArray";
|
|
3692
|
+
ObjectFlags3[ObjectFlags3["ObjectLiteralPatternWithComputedProperties"] = 1024] = "ObjectLiteralPatternWithComputedProperties";
|
|
3693
|
+
ObjectFlags3[ObjectFlags3["ReverseMapped"] = 2048] = "ReverseMapped";
|
|
3694
|
+
ObjectFlags3[ObjectFlags3["JsxAttributes"] = 4096] = "JsxAttributes";
|
|
3695
|
+
ObjectFlags3[ObjectFlags3["JSLiteral"] = 8192] = "JSLiteral";
|
|
3696
|
+
ObjectFlags3[ObjectFlags3["FreshLiteral"] = 16384] = "FreshLiteral";
|
|
3697
|
+
ObjectFlags3[ObjectFlags3["ArrayLiteral"] = 32768] = "ArrayLiteral";
|
|
3698
|
+
ObjectFlags3[ObjectFlags3["PrimitiveUnion"] = 65536] = "PrimitiveUnion";
|
|
3699
|
+
ObjectFlags3[ObjectFlags3["ContainsWideningType"] = 131072] = "ContainsWideningType";
|
|
3700
|
+
ObjectFlags3[ObjectFlags3["ContainsObjectOrArrayLiteral"] = 262144] = "ContainsObjectOrArrayLiteral";
|
|
3701
|
+
ObjectFlags3[ObjectFlags3["NonInferrableType"] = 524288] = "NonInferrableType";
|
|
3702
|
+
ObjectFlags3[ObjectFlags3["CouldContainTypeVariablesComputed"] = 1048576] = "CouldContainTypeVariablesComputed";
|
|
3703
|
+
ObjectFlags3[ObjectFlags3["CouldContainTypeVariables"] = 2097152] = "CouldContainTypeVariables";
|
|
3703
3704
|
ObjectFlags3[ObjectFlags3["ClassOrInterface"] = 3] = "ClassOrInterface";
|
|
3704
|
-
ObjectFlags3[ObjectFlags3["RequiresWidening"] =
|
|
3705
|
-
ObjectFlags3[ObjectFlags3["PropagatingFlags"] =
|
|
3706
|
-
ObjectFlags3[ObjectFlags3["InstantiatedMapped"] =
|
|
3707
|
-
ObjectFlags3[ObjectFlags3["ObjectTypeKindMask"] =
|
|
3708
|
-
ObjectFlags3[ObjectFlags3["ContainsSpread"] =
|
|
3709
|
-
ObjectFlags3[ObjectFlags3["ObjectRestType"] =
|
|
3710
|
-
ObjectFlags3[ObjectFlags3["InstantiationExpressionType"] =
|
|
3711
|
-
ObjectFlags3[ObjectFlags3["IsClassInstanceClone"] =
|
|
3712
|
-
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeCalculated"] =
|
|
3713
|
-
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeExists"] =
|
|
3714
|
-
ObjectFlags3[ObjectFlags3["IsGenericTypeComputed"] =
|
|
3715
|
-
ObjectFlags3[ObjectFlags3["IsGenericObjectType"] =
|
|
3716
|
-
ObjectFlags3[ObjectFlags3["IsGenericIndexType"] =
|
|
3717
|
-
ObjectFlags3[ObjectFlags3["IsGenericType"] =
|
|
3718
|
-
ObjectFlags3[ObjectFlags3["ContainsIntersections"] =
|
|
3719
|
-
ObjectFlags3[ObjectFlags3["IsUnknownLikeUnionComputed"] =
|
|
3720
|
-
ObjectFlags3[ObjectFlags3["IsUnknownLikeUnion"] =
|
|
3721
|
-
ObjectFlags3[ObjectFlags3["IsNeverIntersectionComputed"] =
|
|
3722
|
-
ObjectFlags3[ObjectFlags3["IsNeverIntersection"] =
|
|
3723
|
-
ObjectFlags3[ObjectFlags3["IsConstrainedTypeVariable"] =
|
|
3705
|
+
ObjectFlags3[ObjectFlags3["RequiresWidening"] = 393216] = "RequiresWidening";
|
|
3706
|
+
ObjectFlags3[ObjectFlags3["PropagatingFlags"] = 917504] = "PropagatingFlags";
|
|
3707
|
+
ObjectFlags3[ObjectFlags3["InstantiatedMapped"] = 160] = "InstantiatedMapped";
|
|
3708
|
+
ObjectFlags3[ObjectFlags3["ObjectTypeKindMask"] = 2623] = "ObjectTypeKindMask";
|
|
3709
|
+
ObjectFlags3[ObjectFlags3["ContainsSpread"] = 4194304] = "ContainsSpread";
|
|
3710
|
+
ObjectFlags3[ObjectFlags3["ObjectRestType"] = 8388608] = "ObjectRestType";
|
|
3711
|
+
ObjectFlags3[ObjectFlags3["InstantiationExpressionType"] = 16777216] = "InstantiationExpressionType";
|
|
3712
|
+
ObjectFlags3[ObjectFlags3["IsClassInstanceClone"] = 33554432] = "IsClassInstanceClone";
|
|
3713
|
+
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeCalculated"] = 67108864] = "IdenticalBaseTypeCalculated";
|
|
3714
|
+
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeExists"] = 134217728] = "IdenticalBaseTypeExists";
|
|
3715
|
+
ObjectFlags3[ObjectFlags3["IsGenericTypeComputed"] = 4194304] = "IsGenericTypeComputed";
|
|
3716
|
+
ObjectFlags3[ObjectFlags3["IsGenericObjectType"] = 8388608] = "IsGenericObjectType";
|
|
3717
|
+
ObjectFlags3[ObjectFlags3["IsGenericIndexType"] = 16777216] = "IsGenericIndexType";
|
|
3718
|
+
ObjectFlags3[ObjectFlags3["IsGenericType"] = 25165824] = "IsGenericType";
|
|
3719
|
+
ObjectFlags3[ObjectFlags3["ContainsIntersections"] = 33554432] = "ContainsIntersections";
|
|
3720
|
+
ObjectFlags3[ObjectFlags3["IsUnknownLikeUnionComputed"] = 67108864] = "IsUnknownLikeUnionComputed";
|
|
3721
|
+
ObjectFlags3[ObjectFlags3["IsUnknownLikeUnion"] = 134217728] = "IsUnknownLikeUnion";
|
|
3722
|
+
ObjectFlags3[ObjectFlags3["IsNeverIntersectionComputed"] = 33554432] = "IsNeverIntersectionComputed";
|
|
3723
|
+
ObjectFlags3[ObjectFlags3["IsNeverIntersection"] = 67108864] = "IsNeverIntersection";
|
|
3724
|
+
ObjectFlags3[ObjectFlags3["IsConstrainedTypeVariable"] = 134217728] = "IsConstrainedTypeVariable";
|
|
3724
3725
|
return ObjectFlags3;
|
|
3725
3726
|
})(ObjectFlags || {});
|
|
3726
3727
|
var SignatureFlags = /* @__PURE__ */ ((SignatureFlags4) => {
|
|
@@ -43643,7 +43644,7 @@ function createTypeChecker(host) {
|
|
|
43643
43644
|
var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
|
|
43644
43645
|
var keyofStringsOnly = !!compilerOptions.keyofStringsOnly;
|
|
43645
43646
|
var defaultIndexFlags = keyofStringsOnly ? 1 /* StringsOnly */ : 0 /* None */;
|
|
43646
|
-
var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 :
|
|
43647
|
+
var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 16384 /* FreshLiteral */;
|
|
43647
43648
|
var exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes;
|
|
43648
43649
|
var checkBinaryExpression = createCheckBinaryExpression();
|
|
43649
43650
|
var emitResolver = createResolver();
|
|
@@ -44146,7 +44147,7 @@ function createTypeChecker(host) {
|
|
|
44146
44147
|
var errorTypes = /* @__PURE__ */ new Map();
|
|
44147
44148
|
var seenIntrinsicNames = /* @__PURE__ */ new Set();
|
|
44148
44149
|
var anyType = createIntrinsicType(1 /* Any */, "any");
|
|
44149
|
-
var autoType = createIntrinsicType(1 /* Any */, "any",
|
|
44150
|
+
var autoType = createIntrinsicType(1 /* Any */, "any", 524288 /* NonInferrableType */, "auto");
|
|
44150
44151
|
var wildcardType = createIntrinsicType(
|
|
44151
44152
|
1 /* Any */,
|
|
44152
44153
|
"any",
|
|
@@ -44163,7 +44164,7 @@ function createTypeChecker(host) {
|
|
|
44163
44164
|
);
|
|
44164
44165
|
var errorType = createIntrinsicType(1 /* Any */, "error");
|
|
44165
44166
|
var unresolvedType = createIntrinsicType(1 /* Any */, "unresolved");
|
|
44166
|
-
var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any",
|
|
44167
|
+
var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 131072 /* ContainsWideningType */, "non-inferrable");
|
|
44167
44168
|
var intrinsicMarkerType = createIntrinsicType(1 /* Any */, "intrinsic");
|
|
44168
44169
|
var unknownType = createIntrinsicType(2 /* Unknown */, "unknown");
|
|
44169
44170
|
var nonNullUnknownType = createIntrinsicType(
|
|
@@ -44174,7 +44175,7 @@ function createTypeChecker(host) {
|
|
|
44174
44175
|
"non-null"
|
|
44175
44176
|
);
|
|
44176
44177
|
var undefinedType = createIntrinsicType(32768 /* Undefined */, "undefined");
|
|
44177
|
-
var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined",
|
|
44178
|
+
var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 131072 /* ContainsWideningType */, "widening");
|
|
44178
44179
|
var missingType = createIntrinsicType(
|
|
44179
44180
|
32768 /* Undefined */,
|
|
44180
44181
|
"undefined",
|
|
@@ -44191,7 +44192,7 @@ function createTypeChecker(host) {
|
|
|
44191
44192
|
"optional"
|
|
44192
44193
|
);
|
|
44193
44194
|
var nullType = createIntrinsicType(65536 /* Null */, "null");
|
|
44194
|
-
var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null",
|
|
44195
|
+
var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null", 131072 /* ContainsWideningType */, "widening");
|
|
44195
44196
|
var stringType = createIntrinsicType(4 /* String */, "string");
|
|
44196
44197
|
var numberType = createIntrinsicType(8 /* Number */, "number");
|
|
44197
44198
|
var bigintType = createIntrinsicType(64 /* BigInt */, "bigint");
|
|
@@ -44223,7 +44224,7 @@ function createTypeChecker(host) {
|
|
|
44223
44224
|
var esSymbolType = createIntrinsicType(4096 /* ESSymbol */, "symbol");
|
|
44224
44225
|
var voidType = createIntrinsicType(16384 /* Void */, "void");
|
|
44225
44226
|
var neverType = createIntrinsicType(131072 /* Never */, "never");
|
|
44226
|
-
var silentNeverType = createIntrinsicType(131072 /* Never */, "never",
|
|
44227
|
+
var silentNeverType = createIntrinsicType(131072 /* Never */, "never", 524288 /* NonInferrableType */, "silent");
|
|
44227
44228
|
var implicitNeverType = createIntrinsicType(
|
|
44228
44229
|
131072 /* Never */,
|
|
44229
44230
|
"never",
|
|
@@ -44290,7 +44291,7 @@ function createTypeChecker(host) {
|
|
|
44290
44291
|
emptyArray,
|
|
44291
44292
|
emptyArray
|
|
44292
44293
|
);
|
|
44293
|
-
emptyJsxObjectType.objectFlags |=
|
|
44294
|
+
emptyJsxObjectType.objectFlags |= 4096 /* JsxAttributes */;
|
|
44294
44295
|
var emptyTypeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */);
|
|
44295
44296
|
emptyTypeLiteralSymbol.members = createSymbolTable();
|
|
44296
44297
|
var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, emptyArray, emptyArray, emptyArray);
|
|
@@ -44320,7 +44321,7 @@ function createTypeChecker(host) {
|
|
|
44320
44321
|
emptyArray,
|
|
44321
44322
|
emptyArray
|
|
44322
44323
|
);
|
|
44323
|
-
anyFunctionType.objectFlags |=
|
|
44324
|
+
anyFunctionType.objectFlags |= 524288 /* NonInferrableType */;
|
|
44324
44325
|
var noConstraintType = createAnonymousType(
|
|
44325
44326
|
/*symbol*/
|
|
44326
44327
|
void 0,
|
|
@@ -47558,7 +47559,7 @@ function createTypeChecker(host) {
|
|
|
47558
47559
|
const type = createType(kind);
|
|
47559
47560
|
type.intrinsicName = intrinsicName;
|
|
47560
47561
|
type.debugIntrinsicName = debugIntrinsicName;
|
|
47561
|
-
type.objectFlags = objectFlags |
|
|
47562
|
+
type.objectFlags = objectFlags | 1048576 /* CouldContainTypeVariablesComputed */ | 4194304 /* IsGenericTypeComputed */ | 67108864 /* IsUnknownLikeUnionComputed */ | 33554432 /* IsNeverIntersectionComputed */;
|
|
47562
47563
|
return type;
|
|
47563
47564
|
}
|
|
47564
47565
|
function checkIntrinsicName(name, debug) {
|
|
@@ -48147,7 +48148,7 @@ function createTypeChecker(host) {
|
|
|
48147
48148
|
return flags & 848330095 /* NodeBuilderFlagsMask */;
|
|
48148
48149
|
}
|
|
48149
48150
|
function isClassInstanceSide(type) {
|
|
48150
|
-
return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || !!(type.flags & 524288 /* Object */) && !!(getObjectFlags(type) &
|
|
48151
|
+
return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || !!(type.flags & 524288 /* Object */) && !!(getObjectFlags(type) & 33554432 /* IsClassInstanceClone */));
|
|
48151
48152
|
}
|
|
48152
48153
|
function createNodeBuilder() {
|
|
48153
48154
|
return {
|
|
@@ -48236,9 +48237,7 @@ function createTypeChecker(host) {
|
|
|
48236
48237
|
context.approximateLength += 3;
|
|
48237
48238
|
return factory.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
48238
48239
|
}
|
|
48239
|
-
|
|
48240
|
-
type = getReducedType(type);
|
|
48241
|
-
}
|
|
48240
|
+
type = context.flags & 536870912 /* NoTypeReduction */ ? getResolvedType(type) : getReducedType(type);
|
|
48242
48241
|
if (type.flags & 1 /* Any */) {
|
|
48243
48242
|
if (type.aliasSymbol) {
|
|
48244
48243
|
return factory.createTypeReferenceNode(symbolToEntityNameNode(type.aliasSymbol), mapToTypeNodes(type.aliasTypeArguments, context));
|
|
@@ -48610,7 +48609,7 @@ function createTypeChecker(host) {
|
|
|
48610
48609
|
const typeId = type2.id;
|
|
48611
48610
|
const symbol = type2.symbol;
|
|
48612
48611
|
if (symbol) {
|
|
48613
|
-
const isInstantiationExpressionType = !!(getObjectFlags(type2) &
|
|
48612
|
+
const isInstantiationExpressionType = !!(getObjectFlags(type2) & 16777216 /* InstantiationExpressionType */);
|
|
48614
48613
|
if (isInstantiationExpressionType) {
|
|
48615
48614
|
const instantiationExpressionType = type2;
|
|
48616
48615
|
const existing = instantiationExpressionType.node;
|
|
@@ -48948,7 +48947,7 @@ function createTypeChecker(host) {
|
|
|
48948
48947
|
typeElements.push(signatureToSignatureDeclarationHelper(signature, 180 /* ConstructSignature */, context));
|
|
48949
48948
|
}
|
|
48950
48949
|
for (const info of resolvedType.indexInfos) {
|
|
48951
|
-
typeElements.push(indexInfoToIndexSignatureDeclarationHelper(info, context, resolvedType.objectFlags &
|
|
48950
|
+
typeElements.push(indexInfoToIndexSignatureDeclarationHelper(info, context, resolvedType.objectFlags & 2048 /* ReverseMapped */ ? createElidedInformationPlaceholder(context) : void 0));
|
|
48952
48951
|
}
|
|
48953
48952
|
const properties = resolvedType.properties;
|
|
48954
48953
|
if (!properties) {
|
|
@@ -52192,7 +52191,7 @@ function createTypeChecker(host) {
|
|
|
52192
52191
|
));
|
|
52193
52192
|
}
|
|
52194
52193
|
const result = createAnonymousType(symbol, members, emptyArray, emptyArray, getIndexInfosOfType(source));
|
|
52195
|
-
result.objectFlags |=
|
|
52194
|
+
result.objectFlags |= 8388608 /* ObjectRestType */;
|
|
52196
52195
|
return result;
|
|
52197
52196
|
}
|
|
52198
52197
|
function isGenericTypeWithUndefinedConstraint(type) {
|
|
@@ -52622,7 +52621,7 @@ function createTypeChecker(host) {
|
|
|
52622
52621
|
mergeSymbolTable(exports2, s.exports);
|
|
52623
52622
|
}
|
|
52624
52623
|
const type = createAnonymousType(symbol, exports2, emptyArray, emptyArray, emptyArray);
|
|
52625
|
-
type.objectFlags |=
|
|
52624
|
+
type.objectFlags |= 8192 /* JSLiteral */;
|
|
52626
52625
|
return type;
|
|
52627
52626
|
}
|
|
52628
52627
|
function getAnnotatedTypeForAssignmentDeclaration(declaredType, expression, symbol, declaration) {
|
|
@@ -52743,9 +52742,9 @@ function createTypeChecker(host) {
|
|
|
52743
52742
|
result.aliasTypeArguments = length(args) ? args : void 0;
|
|
52744
52743
|
}
|
|
52745
52744
|
}
|
|
52746
|
-
result.objectFlags |= getObjectFlags(type) &
|
|
52745
|
+
result.objectFlags |= getObjectFlags(type) & 8192 /* JSLiteral */;
|
|
52747
52746
|
if (result.symbol && result.symbol.flags & 32 /* Class */ && type === getDeclaredTypeOfClassOrInterface(result.symbol)) {
|
|
52748
|
-
result.objectFlags |=
|
|
52747
|
+
result.objectFlags |= 33554432 /* IsClassInstanceClone */;
|
|
52749
52748
|
}
|
|
52750
52749
|
return result;
|
|
52751
52750
|
}
|
|
@@ -52798,7 +52797,7 @@ function createTypeChecker(host) {
|
|
|
52798
52797
|
function getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors2) {
|
|
52799
52798
|
const members = createSymbolTable();
|
|
52800
52799
|
let stringIndexInfo;
|
|
52801
|
-
let objectFlags =
|
|
52800
|
+
let objectFlags = 256 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
|
|
52802
52801
|
forEach(pattern.elements, (e) => {
|
|
52803
52802
|
const name = e.propertyName || e.name;
|
|
52804
52803
|
if (e.dotDotDotToken) {
|
|
@@ -52812,7 +52811,7 @@ function createTypeChecker(host) {
|
|
|
52812
52811
|
}
|
|
52813
52812
|
const exprType = getLiteralTypeFromPropertyName(name);
|
|
52814
52813
|
if (!isTypeUsableAsPropertyName(exprType)) {
|
|
52815
|
-
objectFlags |=
|
|
52814
|
+
objectFlags |= 1024 /* ObjectLiteralPatternWithComputedProperties */;
|
|
52816
52815
|
return;
|
|
52817
52816
|
}
|
|
52818
52817
|
const text = getPropertyNameFromType(exprType);
|
|
@@ -52833,7 +52832,7 @@ function createTypeChecker(host) {
|
|
|
52833
52832
|
result.objectFlags |= objectFlags;
|
|
52834
52833
|
if (includePatternInType) {
|
|
52835
52834
|
result.pattern = pattern;
|
|
52836
|
-
result.objectFlags |=
|
|
52835
|
+
result.objectFlags |= 262144 /* ContainsObjectOrArrayLiteral */;
|
|
52837
52836
|
}
|
|
52838
52837
|
return result;
|
|
52839
52838
|
}
|
|
@@ -52851,7 +52850,7 @@ function createTypeChecker(host) {
|
|
|
52851
52850
|
if (includePatternInType) {
|
|
52852
52851
|
result = cloneTypeReference(result);
|
|
52853
52852
|
result.pattern = pattern;
|
|
52854
|
-
result.objectFlags |=
|
|
52853
|
+
result.objectFlags |= 262144 /* ContainsObjectOrArrayLiteral */;
|
|
52855
52854
|
}
|
|
52856
52855
|
return result;
|
|
52857
52856
|
}
|
|
@@ -52879,7 +52878,7 @@ function createTypeChecker(host) {
|
|
|
52879
52878
|
members.set(member.escapedName, member);
|
|
52880
52879
|
});
|
|
52881
52880
|
const type = createAnonymousType(symbol, members, emptyArray, emptyArray, emptyArray);
|
|
52882
|
-
type.objectFlags |=
|
|
52881
|
+
type.objectFlags |= 256 /* ObjectLiteral */ | 524288 /* NonInferrableType */;
|
|
52883
52882
|
links.resolvedType = type;
|
|
52884
52883
|
}
|
|
52885
52884
|
return links.resolvedType;
|
|
@@ -54667,6 +54666,14 @@ function createTypeChecker(host) {
|
|
|
54667
54666
|
type.constructSignatures = constructSignatures;
|
|
54668
54667
|
}
|
|
54669
54668
|
}
|
|
54669
|
+
function resolveTypeAliasInstantiationMembers(type) {
|
|
54670
|
+
const resolved = resolveStructuredTypeMembers(getResolvedTypeAliasInstantiation(type));
|
|
54671
|
+
type.members = resolved.members;
|
|
54672
|
+
type.properties = resolved.properties;
|
|
54673
|
+
type.callSignatures = resolved.callSignatures;
|
|
54674
|
+
type.constructSignatures = resolved.constructSignatures;
|
|
54675
|
+
type.indexInfos = resolved.indexInfos;
|
|
54676
|
+
}
|
|
54670
54677
|
function replaceIndexedAccess(instantiable, type, replacement) {
|
|
54671
54678
|
return instantiateType(instantiable, createTypeMapper([type.indexType, type.objectType], [getNumberLiteralType(0), createTupleType([replacement])]));
|
|
54672
54679
|
}
|
|
@@ -54933,12 +54940,14 @@ function createTypeChecker(host) {
|
|
|
54933
54940
|
resolveTypeReferenceMembers(type);
|
|
54934
54941
|
} else if (type.objectFlags & 3 /* ClassOrInterface */) {
|
|
54935
54942
|
resolveClassOrInterfaceMembers(type);
|
|
54936
|
-
} else if (type.objectFlags &
|
|
54943
|
+
} else if (type.objectFlags & 2048 /* ReverseMapped */) {
|
|
54937
54944
|
resolveReverseMappedTypeMembers(type);
|
|
54938
54945
|
} else if (type.objectFlags & 16 /* Anonymous */) {
|
|
54939
54946
|
resolveAnonymousTypeMembers(type);
|
|
54940
54947
|
} else if (type.objectFlags & 32 /* Mapped */) {
|
|
54941
54948
|
resolveMappedTypeMembers(type);
|
|
54949
|
+
} else if (type.objectFlags & 64 /* TypeAliasInstantiation */) {
|
|
54950
|
+
resolveTypeAliasInstantiationMembers(type);
|
|
54942
54951
|
} else {
|
|
54943
54952
|
Debug.fail("Unhandled object type " + Debug.formatObjectFlags(type.objectFlags));
|
|
54944
54953
|
}
|
|
@@ -55384,7 +55393,7 @@ function createTypeChecker(host) {
|
|
|
55384
55393
|
if (indexInfo) {
|
|
55385
55394
|
checkFlags |= 32 /* WritePartial */ | (indexInfo.isReadonly ? 8 /* Readonly */ : 0);
|
|
55386
55395
|
indexTypes = append(indexTypes, isTupleType(type) ? getRestTypeOfTupleType(type) || undefinedType : indexInfo.type);
|
|
55387
|
-
} else if (isObjectLiteralType(type) && !(getObjectFlags(type) &
|
|
55396
|
+
} else if (isObjectLiteralType(type) && !(getObjectFlags(type) & 4194304 /* ContainsSpread */)) {
|
|
55388
55397
|
checkFlags |= 32 /* WritePartial */;
|
|
55389
55398
|
indexTypes = append(indexTypes, undefinedType);
|
|
55390
55399
|
} else {
|
|
@@ -55510,22 +55519,22 @@ function createTypeChecker(host) {
|
|
|
55510
55519
|
return property && !(getCheckFlags(property) & 16 /* ReadPartial */) ? property : void 0;
|
|
55511
55520
|
}
|
|
55512
55521
|
function getReducedType(type) {
|
|
55513
|
-
if (type.flags & 1048576 /* Union */ && type.objectFlags &
|
|
55522
|
+
if (type.flags & 1048576 /* Union */ && type.objectFlags & 33554432 /* ContainsIntersections */) {
|
|
55514
55523
|
return type.resolvedReducedType || (type.resolvedReducedType = getReducedUnionType(type));
|
|
55515
55524
|
} else if (type.flags & 2097152 /* Intersection */) {
|
|
55516
|
-
if (!(type.objectFlags &
|
|
55517
|
-
type.objectFlags |=
|
|
55525
|
+
if (!(type.objectFlags & 33554432 /* IsNeverIntersectionComputed */)) {
|
|
55526
|
+
type.objectFlags |= 33554432 /* IsNeverIntersectionComputed */ | (some(getPropertiesOfUnionOrIntersectionType(type), isNeverReducedProperty) ? 67108864 /* IsNeverIntersection */ : 0);
|
|
55518
55527
|
}
|
|
55519
|
-
return type.objectFlags &
|
|
55528
|
+
return type.objectFlags & 67108864 /* IsNeverIntersection */ ? neverType : type;
|
|
55520
55529
|
}
|
|
55521
|
-
return type;
|
|
55530
|
+
return getResolvedType(type);
|
|
55522
55531
|
}
|
|
55523
55532
|
function getReducedUnionType(unionType) {
|
|
55524
55533
|
const reducedTypes = sameMap(unionType.types, getReducedType);
|
|
55525
55534
|
if (reducedTypes === unionType.types) {
|
|
55526
55535
|
return unionType;
|
|
55527
55536
|
}
|
|
55528
|
-
const reduced = getUnionType(reducedTypes);
|
|
55537
|
+
const reduced = getResolvedType(getUnionType(reducedTypes));
|
|
55529
55538
|
if (reduced.flags & 1048576 /* Union */) {
|
|
55530
55539
|
reduced.resolvedReducedType = reduced;
|
|
55531
55540
|
}
|
|
@@ -55541,14 +55550,14 @@ function createTypeChecker(host) {
|
|
|
55541
55550
|
return !prop.valueDeclaration && !!(getCheckFlags(prop) & 1024 /* ContainsPrivate */);
|
|
55542
55551
|
}
|
|
55543
55552
|
function isGenericReducibleType(type) {
|
|
55544
|
-
return !!(type.flags & 1048576 /* Union */ && type.objectFlags &
|
|
55553
|
+
return !!(type.flags & 1048576 /* Union */ && type.objectFlags & 33554432 /* ContainsIntersections */ && some(type.types, isGenericReducibleType) || type.flags & 2097152 /* Intersection */ && isReducibleIntersection(type));
|
|
55545
55554
|
}
|
|
55546
55555
|
function isReducibleIntersection(type) {
|
|
55547
55556
|
const uniqueFilled = type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper));
|
|
55548
55557
|
return getReducedType(uniqueFilled) !== uniqueFilled;
|
|
55549
55558
|
}
|
|
55550
55559
|
function elaborateNeverIntersection(errorInfo, type) {
|
|
55551
|
-
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
55560
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsNeverIntersection */) {
|
|
55552
55561
|
const neverProp = find(getPropertiesOfUnionOrIntersectionType(type), isDiscriminantWithNeverType);
|
|
55553
55562
|
if (neverProp) {
|
|
55554
55563
|
return chainDiagnosticMessages(errorInfo, Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents, typeToString(
|
|
@@ -56334,7 +56343,7 @@ function createTypeChecker(host) {
|
|
|
56334
56343
|
result |= getObjectFlags(type);
|
|
56335
56344
|
}
|
|
56336
56345
|
}
|
|
56337
|
-
return result &
|
|
56346
|
+
return result & 917504 /* PropagatingFlags */;
|
|
56338
56347
|
}
|
|
56339
56348
|
function tryCreateTypeReference(target, typeArguments) {
|
|
56340
56349
|
if (some(typeArguments) && target === emptyGenericType) {
|
|
@@ -56421,7 +56430,7 @@ function createTypeChecker(host) {
|
|
|
56421
56430
|
return errorType;
|
|
56422
56431
|
}
|
|
56423
56432
|
}
|
|
56424
|
-
if (node.kind === 183 /* TypeReference */ && isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length)) {
|
|
56433
|
+
if (node.kind === 183 /* TypeReference */ && (getAliasSymbolForTypeNode(node) || isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length))) {
|
|
56425
56434
|
return createDeferredTypeReference(
|
|
56426
56435
|
type,
|
|
56427
56436
|
node,
|
|
@@ -56434,23 +56443,6 @@ function createTypeChecker(host) {
|
|
|
56434
56443
|
}
|
|
56435
56444
|
return checkNoTypeArguments(node, symbol) ? type : errorType;
|
|
56436
56445
|
}
|
|
56437
|
-
function getTypeAliasInstantiation(symbol, typeArguments, aliasSymbol, aliasTypeArguments) {
|
|
56438
|
-
const type = getDeclaredTypeOfSymbol(symbol);
|
|
56439
|
-
if (type === intrinsicMarkerType) {
|
|
56440
|
-
const typeKind = intrinsicTypeKinds.get(symbol.escapedName);
|
|
56441
|
-
if (typeKind !== void 0 && typeArguments && typeArguments.length === 1) {
|
|
56442
|
-
return typeKind === 4 /* NoInfer */ ? getNoInferType(typeArguments[0]) : getStringMappingType(symbol, typeArguments[0]);
|
|
56443
|
-
}
|
|
56444
|
-
}
|
|
56445
|
-
const links = getSymbolLinks(symbol);
|
|
56446
|
-
const typeParameters = links.typeParameters;
|
|
56447
|
-
const id = getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
56448
|
-
let instantiation = links.instantiations.get(id);
|
|
56449
|
-
if (!instantiation) {
|
|
56450
|
-
links.instantiations.set(id, instantiation = instantiateTypeWithAlias(type, createTypeMapper(typeParameters, fillMissingTypeArguments(typeArguments, typeParameters, getMinTypeArgumentCount(typeParameters), isInJSFile(symbol.valueDeclaration))), aliasSymbol, aliasTypeArguments));
|
|
56451
|
-
}
|
|
56452
|
-
return instantiation;
|
|
56453
|
-
}
|
|
56454
56446
|
function getTypeFromTypeAliasReference(node, symbol) {
|
|
56455
56447
|
if (getCheckFlags(symbol) & 1048576 /* Unresolved */) {
|
|
56456
56448
|
const typeArguments = typeArgumentsFromTypeReferenceNode(node);
|
|
@@ -56501,10 +56493,13 @@ function createTypeChecker(host) {
|
|
|
56501
56493
|
const resolved = resolveAlias(aliasSymbol2);
|
|
56502
56494
|
if (resolved && resolved.flags & 524288 /* TypeAlias */) {
|
|
56503
56495
|
newAliasSymbol = resolved;
|
|
56504
|
-
aliasTypeArguments = typeArgumentsFromTypeReferenceNode(node)
|
|
56496
|
+
aliasTypeArguments = typeArgumentsFromTypeReferenceNode(node) ?? [];
|
|
56505
56497
|
}
|
|
56506
56498
|
}
|
|
56507
56499
|
}
|
|
56500
|
+
if (getObjectFlags(type) & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */) && node.kind === 183 /* TypeReference */ && isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length)) {
|
|
56501
|
+
return createDeferredTypeAliasInstantiation(symbol, node, newAliasSymbol, aliasTypeArguments);
|
|
56502
|
+
}
|
|
56508
56503
|
return getTypeAliasInstantiation(symbol, typeArgumentsFromTypeReferenceNode(node), newAliasSymbol, aliasTypeArguments);
|
|
56509
56504
|
}
|
|
56510
56505
|
return checkNoTypeArguments(node, symbol) ? type : errorType;
|
|
@@ -56514,6 +56509,43 @@ function createTypeChecker(host) {
|
|
|
56514
56509
|
const declaration = (_a = symbol.declarations) == null ? void 0 : _a.find(isTypeAlias);
|
|
56515
56510
|
return !!(declaration && getContainingFunction(declaration));
|
|
56516
56511
|
}
|
|
56512
|
+
function getTypeAliasInstantiation(symbol, typeArguments, aliasSymbol, aliasTypeArguments) {
|
|
56513
|
+
const type = getDeclaredTypeOfSymbol(symbol);
|
|
56514
|
+
if (type === intrinsicMarkerType) {
|
|
56515
|
+
const typeKind = intrinsicTypeKinds.get(symbol.escapedName);
|
|
56516
|
+
if (typeKind !== void 0 && typeArguments && typeArguments.length === 1) {
|
|
56517
|
+
return typeKind === 4 /* NoInfer */ ? getNoInferType(typeArguments[0]) : getStringMappingType(symbol, typeArguments[0]);
|
|
56518
|
+
}
|
|
56519
|
+
}
|
|
56520
|
+
const links = getSymbolLinks(symbol);
|
|
56521
|
+
const typeParameters = links.typeParameters;
|
|
56522
|
+
const id = getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
56523
|
+
let instantiation = links.instantiations.get(id);
|
|
56524
|
+
if (!instantiation) {
|
|
56525
|
+
links.instantiations.set(id, instantiation = instantiateTypeWithAlias(type, createTypeMapper(typeParameters, fillMissingTypeArguments(typeArguments, typeParameters, getMinTypeArgumentCount(typeParameters), isInJSFile(symbol.valueDeclaration))), aliasSymbol, aliasTypeArguments));
|
|
56526
|
+
}
|
|
56527
|
+
return instantiation;
|
|
56528
|
+
}
|
|
56529
|
+
function createDeferredTypeAliasInstantiation(typeAlias, node, aliasSymbol, aliasTypeArguments) {
|
|
56530
|
+
const type = getDeclaredTypeOfSymbol(typeAlias);
|
|
56531
|
+
const result = createObjectType(64 /* TypeAliasInstantiation */, type.symbol);
|
|
56532
|
+
result.typeAlias = typeAlias;
|
|
56533
|
+
result.node = node;
|
|
56534
|
+
result.aliasSymbol = aliasSymbol;
|
|
56535
|
+
result.aliasTypeArguments = aliasTypeArguments;
|
|
56536
|
+
return result;
|
|
56537
|
+
}
|
|
56538
|
+
function getResolvedType(type) {
|
|
56539
|
+
return type.flags & 524288 /* Object */ && type.objectFlags & 64 /* TypeAliasInstantiation */ ? getResolvedTypeAliasInstantiation(type) : type;
|
|
56540
|
+
}
|
|
56541
|
+
function getResolvedTypeAliasInstantiation(type) {
|
|
56542
|
+
if (!type.resolvedType) {
|
|
56543
|
+
const typeArguments = typeArgumentsFromTypeReferenceNode(type.node);
|
|
56544
|
+
const mappedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments;
|
|
56545
|
+
type.resolvedType = getTypeAliasInstantiation(type.typeAlias, mappedTypeArguments, type.aliasSymbol, type.aliasTypeArguments);
|
|
56546
|
+
}
|
|
56547
|
+
return type.resolvedType;
|
|
56548
|
+
}
|
|
56517
56549
|
function getTypeReferenceName(node) {
|
|
56518
56550
|
switch (node.kind) {
|
|
56519
56551
|
case 183 /* TypeReference */:
|
|
@@ -57205,7 +57237,7 @@ function createTypeChecker(host) {
|
|
|
57205
57237
|
return isNamedTupleMember(member) || isParameter(member) ? member : void 0;
|
|
57206
57238
|
}
|
|
57207
57239
|
function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) {
|
|
57208
|
-
return
|
|
57240
|
+
return isResolvedByTypeAlias(node) && (node.kind === 188 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : node.kind === 189 /* TupleType */ ? some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || some(node.typeArguments, mayResolveTypeAlias));
|
|
57209
57241
|
}
|
|
57210
57242
|
function isResolvedByTypeAlias(node) {
|
|
57211
57243
|
const parent = node.parent;
|
|
@@ -57260,7 +57292,7 @@ function createTypeChecker(host) {
|
|
|
57260
57292
|
const target = getArrayOrTupleTargetType(node);
|
|
57261
57293
|
if (target === emptyGenericType) {
|
|
57262
57294
|
links.resolvedType = emptyObjectType;
|
|
57263
|
-
} else if (!(node.kind === 189 /* TupleType */ && some(node.elements, (e) => !!(getTupleElementFlags(e) & 8 /* Variadic */))) && isDeferredTypeReferenceNode(node)) {
|
|
57295
|
+
} else if (!(node.kind === 189 /* TupleType */ && some(node.elements, (e) => !!(getTupleElementFlags(e) & 8 /* Variadic */))) && (getAliasSymbolForTypeNode(node) || isDeferredTypeReferenceNode(node))) {
|
|
57264
57296
|
links.resolvedType = node.kind === 189 /* TupleType */ && node.elements.length === 0 ? target : createDeferredTypeReference(
|
|
57265
57297
|
target,
|
|
57266
57298
|
node,
|
|
@@ -57480,12 +57512,12 @@ function createTypeChecker(host) {
|
|
|
57480
57512
|
includes |= flags & 473694207 /* IncludesMask */;
|
|
57481
57513
|
if (flags & 465829888 /* Instantiable */)
|
|
57482
57514
|
includes |= 33554432 /* IncludesInstantiable */;
|
|
57483
|
-
if (flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
57515
|
+
if (flags & 2097152 /* Intersection */ && getObjectFlags(type) & 134217728 /* IsConstrainedTypeVariable */)
|
|
57484
57516
|
includes |= 536870912 /* IncludesConstrainedTypeVariable */;
|
|
57485
57517
|
if (type === wildcardType)
|
|
57486
57518
|
includes |= 8388608 /* IncludesWildcard */;
|
|
57487
57519
|
if (!strictNullChecks && flags & 98304 /* Nullable */) {
|
|
57488
|
-
if (!(getObjectFlags(type) &
|
|
57520
|
+
if (!(getObjectFlags(type) & 131072 /* ContainsWideningType */))
|
|
57489
57521
|
includes |= 4194304 /* IncludesNonWideningType */;
|
|
57490
57522
|
} else {
|
|
57491
57523
|
const len = typeSet.length;
|
|
@@ -57592,7 +57624,7 @@ function createTypeChecker(host) {
|
|
|
57592
57624
|
function removeConstrainedTypeVariables(types) {
|
|
57593
57625
|
const typeVariables = [];
|
|
57594
57626
|
for (const type of types) {
|
|
57595
|
-
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
57627
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 134217728 /* IsConstrainedTypeVariable */) {
|
|
57596
57628
|
const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
57597
57629
|
pushIfUnique(typeVariables, type.types[index]);
|
|
57598
57630
|
}
|
|
@@ -57600,7 +57632,7 @@ function createTypeChecker(host) {
|
|
|
57600
57632
|
for (const typeVariable of typeVariables) {
|
|
57601
57633
|
const primitives = [];
|
|
57602
57634
|
for (const type of types) {
|
|
57603
|
-
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
57635
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 134217728 /* IsConstrainedTypeVariable */) {
|
|
57604
57636
|
const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
57605
57637
|
if (type.types[index] === typeVariable) {
|
|
57606
57638
|
insertType(primitives, type.types[1 - index]);
|
|
@@ -57613,7 +57645,7 @@ function createTypeChecker(host) {
|
|
|
57613
57645
|
while (i > 0) {
|
|
57614
57646
|
i--;
|
|
57615
57647
|
const type = types[i];
|
|
57616
|
-
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
57648
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 134217728 /* IsConstrainedTypeVariable */) {
|
|
57617
57649
|
const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
57618
57650
|
if (type.types[index] === typeVariable && containsType(primitives, type.types[1 - index])) {
|
|
57619
57651
|
orderedRemoveItemAt(types, i);
|
|
@@ -57722,7 +57754,7 @@ function createTypeChecker(host) {
|
|
|
57722
57754
|
origin = createOriginUnionOrIntersectionType(1048576 /* Union */, reducedTypes);
|
|
57723
57755
|
}
|
|
57724
57756
|
}
|
|
57725
|
-
const objectFlags = (includes & 36323331 /* NotPrimitiveUnion */ ? 0 :
|
|
57757
|
+
const objectFlags = (includes & 36323331 /* NotPrimitiveUnion */ ? 0 : 65536 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 33554432 /* ContainsIntersections */ : 0);
|
|
57726
57758
|
return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments, origin);
|
|
57727
57759
|
}
|
|
57728
57760
|
function getUnionOrIntersectionTypePredicate(signatures, kind) {
|
|
@@ -57873,14 +57905,14 @@ function createTypeChecker(host) {
|
|
|
57873
57905
|
}
|
|
57874
57906
|
function intersectUnionsOfPrimitiveTypes(types) {
|
|
57875
57907
|
let unionTypes2;
|
|
57876
|
-
const index = findIndex(types, (t) => !!(getObjectFlags(t) &
|
|
57908
|
+
const index = findIndex(types, (t) => !!(getObjectFlags(t) & 65536 /* PrimitiveUnion */));
|
|
57877
57909
|
if (index < 0) {
|
|
57878
57910
|
return false;
|
|
57879
57911
|
}
|
|
57880
57912
|
let i = index + 1;
|
|
57881
57913
|
while (i < types.length) {
|
|
57882
57914
|
const t = types[i];
|
|
57883
|
-
if (getObjectFlags(t) &
|
|
57915
|
+
if (getObjectFlags(t) & 65536 /* PrimitiveUnion */) {
|
|
57884
57916
|
(unionTypes2 || (unionTypes2 = [types[index]])).push(t);
|
|
57885
57917
|
orderedRemoveItemAt(types, i);
|
|
57886
57918
|
} else {
|
|
@@ -57901,7 +57933,7 @@ function createTypeChecker(host) {
|
|
|
57901
57933
|
}
|
|
57902
57934
|
}
|
|
57903
57935
|
}
|
|
57904
|
-
types[index] = getUnionTypeFromSortedList(result,
|
|
57936
|
+
types[index] = getUnionTypeFromSortedList(result, 65536 /* PrimitiveUnion */);
|
|
57905
57937
|
return true;
|
|
57906
57938
|
}
|
|
57907
57939
|
function createIntersectionType(types, objectFlags, aliasSymbol, aliasTypeArguments) {
|
|
@@ -57964,7 +57996,7 @@ function createTypeChecker(host) {
|
|
|
57964
57996
|
return neverType;
|
|
57965
57997
|
}
|
|
57966
57998
|
}
|
|
57967
|
-
objectFlags =
|
|
57999
|
+
objectFlags = 134217728 /* IsConstrainedTypeVariable */;
|
|
57968
58000
|
}
|
|
57969
58001
|
}
|
|
57970
58002
|
}
|
|
@@ -58317,7 +58349,7 @@ function createTypeChecker(host) {
|
|
|
58317
58349
|
if (noImplicitAny) {
|
|
58318
58350
|
return false;
|
|
58319
58351
|
}
|
|
58320
|
-
if (getObjectFlags(type) &
|
|
58352
|
+
if (getObjectFlags(type) & 8192 /* JSLiteral */) {
|
|
58321
58353
|
return true;
|
|
58322
58354
|
}
|
|
58323
58355
|
if (type.flags & 1048576 /* Union */) {
|
|
@@ -58565,28 +58597,28 @@ function createTypeChecker(host) {
|
|
|
58565
58597
|
return !!getGenericObjectFlags(type);
|
|
58566
58598
|
}
|
|
58567
58599
|
function isGenericObjectType(type) {
|
|
58568
|
-
return !!(getGenericObjectFlags(type) &
|
|
58600
|
+
return !!(getGenericObjectFlags(type) & 8388608 /* IsGenericObjectType */);
|
|
58569
58601
|
}
|
|
58570
58602
|
function isGenericIndexType(type) {
|
|
58571
|
-
return !!(getGenericObjectFlags(type) &
|
|
58603
|
+
return !!(getGenericObjectFlags(type) & 16777216 /* IsGenericIndexType */);
|
|
58572
58604
|
}
|
|
58573
58605
|
function getGenericObjectFlags(type) {
|
|
58574
58606
|
if (type.flags & 3145728 /* UnionOrIntersection */) {
|
|
58575
|
-
if (!(type.objectFlags &
|
|
58576
|
-
type.objectFlags |=
|
|
58607
|
+
if (!(type.objectFlags & 4194304 /* IsGenericTypeComputed */)) {
|
|
58608
|
+
type.objectFlags |= 4194304 /* IsGenericTypeComputed */ | reduceLeft(type.types, (flags, t) => flags | getGenericObjectFlags(t), 0);
|
|
58577
58609
|
}
|
|
58578
|
-
return type.objectFlags &
|
|
58610
|
+
return type.objectFlags & 25165824 /* IsGenericType */;
|
|
58579
58611
|
}
|
|
58580
58612
|
if (type.flags & 33554432 /* Substitution */) {
|
|
58581
|
-
if (!(type.objectFlags &
|
|
58582
|
-
type.objectFlags |=
|
|
58613
|
+
if (!(type.objectFlags & 4194304 /* IsGenericTypeComputed */)) {
|
|
58614
|
+
type.objectFlags |= 4194304 /* IsGenericTypeComputed */ | getGenericObjectFlags(type.baseType) | getGenericObjectFlags(type.constraint);
|
|
58583
58615
|
}
|
|
58584
|
-
return type.objectFlags &
|
|
58616
|
+
return type.objectFlags & 25165824 /* IsGenericType */;
|
|
58585
58617
|
}
|
|
58586
|
-
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ?
|
|
58618
|
+
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);
|
|
58587
58619
|
}
|
|
58588
58620
|
function getSimplifiedType(type, writing) {
|
|
58589
|
-
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : type;
|
|
58621
|
+
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : getResolvedType(type);
|
|
58590
58622
|
}
|
|
58591
58623
|
function distributeIndexOverObjectType(objectType, indexType, writing) {
|
|
58592
58624
|
if (objectType.flags & 1048576 /* Union */ || objectType.flags & 2097152 /* Intersection */ && !shouldDeferIndexType(objectType)) {
|
|
@@ -59086,7 +59118,7 @@ function createTypeChecker(host) {
|
|
|
59086
59118
|
}
|
|
59087
59119
|
}
|
|
59088
59120
|
const spread = createAnonymousType(type2.symbol, members, emptyArray, emptyArray, getIndexInfosOfType(type2));
|
|
59089
|
-
spread.objectFlags |=
|
|
59121
|
+
spread.objectFlags |= 256 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
|
|
59090
59122
|
return spread;
|
|
59091
59123
|
}
|
|
59092
59124
|
}
|
|
@@ -59163,7 +59195,7 @@ function createTypeChecker(host) {
|
|
|
59163
59195
|
}
|
|
59164
59196
|
}
|
|
59165
59197
|
const spread = createAnonymousType(symbol, members, emptyArray, emptyArray, sameMap(indexInfos, (info) => getIndexInfoWithReadonly(info, readonly)));
|
|
59166
|
-
spread.objectFlags |=
|
|
59198
|
+
spread.objectFlags |= 256 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */ | 4194304 /* ContainsSpread */ | objectFlags;
|
|
59167
59199
|
return spread;
|
|
59168
59200
|
}
|
|
59169
59201
|
function isSpreadableProperty(prop) {
|
|
@@ -59584,9 +59616,9 @@ function createTypeChecker(host) {
|
|
|
59584
59616
|
return result;
|
|
59585
59617
|
}
|
|
59586
59618
|
function getObjectTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
59587
|
-
const declaration = type.objectFlags & 4 /* Reference */ ? type.node : type.objectFlags &
|
|
59619
|
+
const declaration = type.objectFlags & 4 /* Reference */ ? type.node : type.objectFlags & 16777216 /* InstantiationExpressionType */ ? type.node : type.objectFlags & 64 /* TypeAliasInstantiation */ ? type.node : type.symbol.declarations[0];
|
|
59588
59620
|
const links = getNodeLinks(declaration);
|
|
59589
|
-
const target = type.objectFlags & 4 /* Reference */ ? links.resolvedType : type.objectFlags &
|
|
59621
|
+
const target = type.objectFlags & 4 /* Reference */ ? links.resolvedType : type.objectFlags & 128 /* Instantiated */ ? type.target : type;
|
|
59590
59622
|
let typeParameters = links.outerTypeParameters;
|
|
59591
59623
|
if (!typeParameters) {
|
|
59592
59624
|
let outerTypeParameters = getOuterTypeParameters(
|
|
@@ -59599,8 +59631,8 @@ function createTypeChecker(host) {
|
|
|
59599
59631
|
outerTypeParameters = addRange(outerTypeParameters, templateTagParameters);
|
|
59600
59632
|
}
|
|
59601
59633
|
typeParameters = outerTypeParameters || emptyArray;
|
|
59602
|
-
const allDeclarations = type.objectFlags & (4 /* Reference */ |
|
|
59603
|
-
typeParameters = (target.objectFlags & (4 /* Reference */ |
|
|
59634
|
+
const allDeclarations = type.objectFlags & (4 /* Reference */ | 16777216 /* InstantiationExpressionType */ | 64 /* TypeAliasInstantiation */) ? [declaration] : type.symbol.declarations;
|
|
59635
|
+
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;
|
|
59604
59636
|
links.outerTypeParameters = typeParameters;
|
|
59605
59637
|
}
|
|
59606
59638
|
if (typeParameters.length) {
|
|
@@ -59619,13 +59651,13 @@ function createTypeChecker(host) {
|
|
|
59619
59651
|
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);
|
|
59620
59652
|
target.instantiations.set(id, result);
|
|
59621
59653
|
const resultObjectFlags = getObjectFlags(result);
|
|
59622
|
-
if (result.flags & 3899393 /* ObjectFlagsType */ && !(resultObjectFlags &
|
|
59654
|
+
if (result.flags & 3899393 /* ObjectFlagsType */ && !(resultObjectFlags & 1048576 /* CouldContainTypeVariablesComputed */)) {
|
|
59623
59655
|
const resultCouldContainTypeVariables = some(typeArguments, couldContainTypeVariables);
|
|
59624
|
-
if (!(getObjectFlags(result) &
|
|
59656
|
+
if (!(getObjectFlags(result) & 1048576 /* CouldContainTypeVariablesComputed */)) {
|
|
59625
59657
|
if (resultObjectFlags & (32 /* Mapped */ | 16 /* Anonymous */ | 4 /* Reference */)) {
|
|
59626
|
-
result.objectFlags |=
|
|
59658
|
+
result.objectFlags |= 1048576 /* CouldContainTypeVariablesComputed */ | (resultCouldContainTypeVariables ? 2097152 /* CouldContainTypeVariables */ : 0);
|
|
59627
59659
|
} else {
|
|
59628
|
-
result.objectFlags |= !resultCouldContainTypeVariables ?
|
|
59660
|
+
result.objectFlags |= !resultCouldContainTypeVariables ? 1048576 /* CouldContainTypeVariablesComputed */ : 0;
|
|
59629
59661
|
}
|
|
59630
59662
|
}
|
|
59631
59663
|
}
|
|
@@ -59755,8 +59787,7 @@ function createTypeChecker(host) {
|
|
|
59755
59787
|
) : strictNullChecks && modifiers & 8 /* ExcludeOptional */ && isOptional ? getTypeWithFacts(propType, 524288 /* NEUndefined */) : propType;
|
|
59756
59788
|
}
|
|
59757
59789
|
function instantiateAnonymousType(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
59758
|
-
|
|
59759
|
-
const result = createObjectType(type.objectFlags & ~(524288 /* CouldContainTypeVariablesComputed */ | 1048576 /* CouldContainTypeVariables */) | 64 /* Instantiated */, type.symbol);
|
|
59790
|
+
const result = createObjectType(type.objectFlags & ~(1048576 /* CouldContainTypeVariablesComputed */ | 2097152 /* CouldContainTypeVariables */) | 128 /* Instantiated */, type.symbol);
|
|
59760
59791
|
if (type.objectFlags & 32 /* Mapped */) {
|
|
59761
59792
|
result.declaration = type.declaration;
|
|
59762
59793
|
const origTypeParameter = getTypeParameterFromMappedType(type);
|
|
@@ -59764,8 +59795,10 @@ function createTypeChecker(host) {
|
|
|
59764
59795
|
result.typeParameter = freshTypeParameter;
|
|
59765
59796
|
mapper = combineTypeMappers(makeUnaryTypeMapper(origTypeParameter, freshTypeParameter), mapper);
|
|
59766
59797
|
freshTypeParameter.mapper = mapper;
|
|
59767
|
-
}
|
|
59768
|
-
|
|
59798
|
+
} else if (type.objectFlags & 16777216 /* InstantiationExpressionType */) {
|
|
59799
|
+
result.node = type.node;
|
|
59800
|
+
} else if (type.objectFlags & 64 /* TypeAliasInstantiation */) {
|
|
59801
|
+
result.typeAlias = type.typeAlias;
|
|
59769
59802
|
result.node = type.node;
|
|
59770
59803
|
}
|
|
59771
59804
|
result.target = type;
|
|
@@ -59826,13 +59859,13 @@ function createTypeChecker(host) {
|
|
|
59826
59859
|
}
|
|
59827
59860
|
if (flags & 524288 /* Object */) {
|
|
59828
59861
|
const objectFlags = type.objectFlags;
|
|
59829
|
-
if (objectFlags & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */)) {
|
|
59862
|
+
if (objectFlags & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */ | 64 /* TypeAliasInstantiation */)) {
|
|
59830
59863
|
if (objectFlags & 4 /* Reference */ && !type.node) {
|
|
59831
59864
|
const resolvedTypeArguments = type.resolvedTypeArguments;
|
|
59832
59865
|
const newTypeArguments = instantiateTypes(resolvedTypeArguments, mapper);
|
|
59833
59866
|
return newTypeArguments !== resolvedTypeArguments ? createNormalizedTypeReference(type.target, newTypeArguments) : type;
|
|
59834
59867
|
}
|
|
59835
|
-
if (objectFlags &
|
|
59868
|
+
if (objectFlags & 2048 /* ReverseMapped */) {
|
|
59836
59869
|
return instantiateReverseMappedType(type, mapper);
|
|
59837
59870
|
}
|
|
59838
59871
|
return getObjectTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments);
|
|
@@ -60768,11 +60801,11 @@ function createTypeChecker(host) {
|
|
|
60768
60801
|
}
|
|
60769
60802
|
function isUnknownLikeUnionType(type) {
|
|
60770
60803
|
if (strictNullChecks && type.flags & 1048576 /* Union */) {
|
|
60771
|
-
if (!(type.objectFlags &
|
|
60804
|
+
if (!(type.objectFlags & 67108864 /* IsUnknownLikeUnionComputed */)) {
|
|
60772
60805
|
const types = type.types;
|
|
60773
|
-
type.objectFlags |=
|
|
60806
|
+
type.objectFlags |= 67108864 /* IsUnknownLikeUnionComputed */ | (types.length >= 3 && types[0].flags & 32768 /* Undefined */ && types[1].flags & 65536 /* Null */ && some(types, isEmptyAnonymousObjectType) ? 134217728 /* IsUnknownLikeUnion */ : 0);
|
|
60774
60807
|
}
|
|
60775
|
-
return !!(type.objectFlags &
|
|
60808
|
+
return !!(type.objectFlags & 134217728 /* IsUnknownLikeUnion */);
|
|
60776
60809
|
}
|
|
60777
60810
|
return false;
|
|
60778
60811
|
}
|
|
@@ -60883,7 +60916,7 @@ function createTypeChecker(host) {
|
|
|
60883
60916
|
return true;
|
|
60884
60917
|
if (s & 65536 /* Null */ && (!strictNullChecks && !(t & 3145728 /* UnionOrIntersection */) || t & 65536 /* Null */))
|
|
60885
60918
|
return true;
|
|
60886
|
-
if (s & 524288 /* Object */ && t & 67108864 /* NonPrimitive */ && !(relation === strictSubtypeRelation && isEmptyAnonymousObjectType(source) && !(getObjectFlags(source) &
|
|
60919
|
+
if (s & 524288 /* Object */ && t & 67108864 /* NonPrimitive */ && !(relation === strictSubtypeRelation && isEmptyAnonymousObjectType(source) && !(getObjectFlags(source) & 16384 /* FreshLiteral */)))
|
|
60887
60920
|
return true;
|
|
60888
60921
|
if (relation === assignableRelation || relation === comparableRelation) {
|
|
60889
60922
|
if (s & 1 /* Any */)
|
|
@@ -60942,11 +60975,11 @@ function createTypeChecker(host) {
|
|
|
60942
60975
|
return false;
|
|
60943
60976
|
}
|
|
60944
60977
|
function isIgnoredJsxProperty(source, sourceProp) {
|
|
60945
|
-
return getObjectFlags(source) &
|
|
60978
|
+
return getObjectFlags(source) & 4096 /* JsxAttributes */ && isHyphenatedJsxName(sourceProp.escapedName);
|
|
60946
60979
|
}
|
|
60947
60980
|
function getNormalizedType(type, writing) {
|
|
60948
60981
|
while (true) {
|
|
60949
|
-
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;
|
|
60982
|
+
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;
|
|
60950
60983
|
if (t === type)
|
|
60951
60984
|
return t;
|
|
60952
60985
|
type = t;
|
|
@@ -61336,7 +61369,7 @@ function createTypeChecker(host) {
|
|
|
61336
61369
|
if (relation === comparableRelation && !(target2.flags & 131072 /* Never */) && isSimpleTypeRelatedTo(target2, source2, relation) || isSimpleTypeRelatedTo(source2, target2, relation, reportErrors2 ? reportError : void 0))
|
|
61337
61370
|
return -1 /* True */;
|
|
61338
61371
|
if (source2.flags & 469499904 /* StructuredOrInstantiable */ || target2.flags & 469499904 /* StructuredOrInstantiable */) {
|
|
61339
|
-
const isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType(source2) && getObjectFlags(source2) &
|
|
61372
|
+
const isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType(source2) && getObjectFlags(source2) & 16384 /* FreshLiteral */);
|
|
61340
61373
|
if (isPerformingExcessPropertyChecks) {
|
|
61341
61374
|
if (hasExcessProperties(source2, target2, reportErrors2)) {
|
|
61342
61375
|
if (reportErrors2) {
|
|
@@ -61346,7 +61379,7 @@ function createTypeChecker(host) {
|
|
|
61346
61379
|
}
|
|
61347
61380
|
}
|
|
61348
61381
|
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));
|
|
61349
|
-
const isComparingJsxAttributes = !!(getObjectFlags(source2) &
|
|
61382
|
+
const isComparingJsxAttributes = !!(getObjectFlags(source2) & 4096 /* JsxAttributes */);
|
|
61350
61383
|
if (isPerformingCommonPropertyChecks && !hasCommonProperties(source2, target2, isComparingJsxAttributes)) {
|
|
61351
61384
|
if (reportErrors2) {
|
|
61352
61385
|
const sourceString = typeToString(originalSource.aliasSymbol ? originalSource : source2);
|
|
@@ -61411,7 +61444,7 @@ function createTypeChecker(host) {
|
|
|
61411
61444
|
tryElaborateErrorsForPrimitivesAndObjects(source2, target2);
|
|
61412
61445
|
} else if (source2.symbol && source2.flags & 524288 /* Object */ && globalObjectType === source2) {
|
|
61413
61446
|
reportError(Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
|
|
61414
|
-
} else if (getObjectFlags(source2) &
|
|
61447
|
+
} else if (getObjectFlags(source2) & 4096 /* JsxAttributes */ && target2.flags & 2097152 /* Intersection */) {
|
|
61415
61448
|
const targetTypes = target2.types;
|
|
61416
61449
|
const intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
|
|
61417
61450
|
const intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
|
|
@@ -61442,7 +61475,7 @@ function createTypeChecker(host) {
|
|
|
61442
61475
|
if (source2.flags & 3145728 /* UnionOrIntersection */ && target2.flags & 3145728 /* UnionOrIntersection */) {
|
|
61443
61476
|
const sourceUnionOrIntersection = source2;
|
|
61444
61477
|
const targetUnionOrIntersection = target2;
|
|
61445
|
-
if (sourceUnionOrIntersection.objectFlags & targetUnionOrIntersection.objectFlags &
|
|
61478
|
+
if (sourceUnionOrIntersection.objectFlags & targetUnionOrIntersection.objectFlags & 65536 /* PrimitiveUnion */) {
|
|
61446
61479
|
return;
|
|
61447
61480
|
}
|
|
61448
61481
|
const sourceSize = sourceUnionOrIntersection.types.length;
|
|
@@ -61476,10 +61509,10 @@ function createTypeChecker(host) {
|
|
|
61476
61509
|
}
|
|
61477
61510
|
function hasExcessProperties(source2, target2, reportErrors2) {
|
|
61478
61511
|
var _a2;
|
|
61479
|
-
if (!isExcessPropertyCheckTarget(target2) || !noImplicitAny && getObjectFlags(target2) &
|
|
61512
|
+
if (!isExcessPropertyCheckTarget(target2) || !noImplicitAny && getObjectFlags(target2) & 8192 /* JSLiteral */) {
|
|
61480
61513
|
return false;
|
|
61481
61514
|
}
|
|
61482
|
-
const isComparingJsxAttributes = !!(getObjectFlags(source2) &
|
|
61515
|
+
const isComparingJsxAttributes = !!(getObjectFlags(source2) & 4096 /* JsxAttributes */);
|
|
61483
61516
|
if ((relation === assignableRelation || relation === comparableRelation) && (isTypeSubsetOf(globalObjectType, target2) || !isComparingJsxAttributes && isEmptyObjectType(target2))) {
|
|
61484
61517
|
return false;
|
|
61485
61518
|
}
|
|
@@ -61618,7 +61651,7 @@ function createTypeChecker(host) {
|
|
|
61618
61651
|
if (containsType(targetTypes, source2)) {
|
|
61619
61652
|
return -1 /* True */;
|
|
61620
61653
|
}
|
|
61621
|
-
if (relation !== comparableRelation && getObjectFlags(target2) &
|
|
61654
|
+
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 */)) {
|
|
61622
61655
|
const alternateForm = source2 === source2.regularType ? source2.freshType : source2.regularType;
|
|
61623
61656
|
const primitive = source2.flags & 128 /* StringLiteral */ ? stringType : source2.flags & 256 /* NumberLiteral */ ? numberType : source2.flags & 2048 /* BigIntLiteral */ ? bigintType : void 0;
|
|
61624
61657
|
return primitive && containsType(targetTypes, primitive) || alternateForm && containsType(targetTypes, alternateForm) ? -1 /* True */ : 0 /* False */;
|
|
@@ -62022,7 +62055,7 @@ function createTypeChecker(host) {
|
|
|
62022
62055
|
false,
|
|
62023
62056
|
0 /* None */
|
|
62024
62057
|
);
|
|
62025
|
-
if (result2 && isObjectLiteralType(source2) && getObjectFlags(source2) &
|
|
62058
|
+
if (result2 && isObjectLiteralType(source2) && getObjectFlags(source2) & 16384 /* FreshLiteral */) {
|
|
62026
62059
|
result2 &= indexSignaturesRelatedTo(
|
|
62027
62060
|
source2,
|
|
62028
62061
|
target2,
|
|
@@ -62032,7 +62065,7 @@ function createTypeChecker(host) {
|
|
|
62032
62065
|
0 /* None */
|
|
62033
62066
|
);
|
|
62034
62067
|
}
|
|
62035
|
-
} else if (result2 && isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => t === target2 || !!(getObjectFlags(t) &
|
|
62068
|
+
} 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 */))) {
|
|
62036
62069
|
result2 &= propertiesRelatedTo(
|
|
62037
62070
|
source2,
|
|
62038
62071
|
target2,
|
|
@@ -62533,7 +62566,7 @@ function createTypeChecker(host) {
|
|
|
62533
62566
|
if (constraint !== source2) {
|
|
62534
62567
|
return isRelatedTo(constraint, target2, 1 /* Source */, reportErrors2);
|
|
62535
62568
|
}
|
|
62536
|
-
} else if ((relation === subtypeRelation || relation === strictSubtypeRelation) && isEmptyObjectType(target2) && getObjectFlags(target2) &
|
|
62569
|
+
} else if ((relation === subtypeRelation || relation === strictSubtypeRelation) && isEmptyObjectType(target2) && getObjectFlags(target2) & 16384 /* FreshLiteral */ && !isEmptyObjectType(source2)) {
|
|
62537
62570
|
return 0 /* False */;
|
|
62538
62571
|
}
|
|
62539
62572
|
if (sourceFlags & (524288 /* Object */ | 2097152 /* Intersection */) && targetFlags & 524288 /* Object */) {
|
|
@@ -63065,7 +63098,7 @@ function createTypeChecker(host) {
|
|
|
63065
63098
|
const incompatibleReporter = kind === 1 /* Construct */ ? reportIncompatibleConstructSignatureReturn : reportIncompatibleCallSignatureReturn;
|
|
63066
63099
|
const sourceObjectFlags = getObjectFlags(source2);
|
|
63067
63100
|
const targetObjectFlags = getObjectFlags(target2);
|
|
63068
|
-
if (sourceObjectFlags &
|
|
63101
|
+
if (sourceObjectFlags & 128 /* Instantiated */ && targetObjectFlags & 128 /* Instantiated */ && source2.symbol === target2.symbol || sourceObjectFlags & 4 /* Reference */ && targetObjectFlags & 4 /* Reference */ && source2.target === target2.target) {
|
|
63069
63102
|
Debug.assertEqual(sourceSignatures.length, targetSignatures.length);
|
|
63070
63103
|
for (let i = 0; i < targetSignatures.length; i++) {
|
|
63071
63104
|
const related = signatureRelatedTo(
|
|
@@ -63281,7 +63314,7 @@ function createTypeChecker(host) {
|
|
|
63281
63314
|
if (sourceInfo) {
|
|
63282
63315
|
return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2, intersectionState);
|
|
63283
63316
|
}
|
|
63284
|
-
if (!(intersectionState & 1 /* Source */) && (relation !== strictSubtypeRelation || getObjectFlags(source2) &
|
|
63317
|
+
if (!(intersectionState & 1 /* Source */) && (relation !== strictSubtypeRelation || getObjectFlags(source2) & 16384 /* FreshLiteral */) && isObjectTypeWithInferableIndex(source2)) {
|
|
63285
63318
|
return membersRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState);
|
|
63286
63319
|
}
|
|
63287
63320
|
if (reportErrors2) {
|
|
@@ -63555,11 +63588,11 @@ function createTypeChecker(host) {
|
|
|
63555
63588
|
}
|
|
63556
63589
|
function isDeeplyNestedType(type, stack, depth, maxDepth = 3) {
|
|
63557
63590
|
if (depth >= maxDepth) {
|
|
63558
|
-
if ((getObjectFlags(type) &
|
|
63591
|
+
if ((getObjectFlags(type) & 160 /* InstantiatedMapped */) === 160 /* InstantiatedMapped */) {
|
|
63559
63592
|
type = getMappedTargetWithSymbol(type);
|
|
63560
63593
|
}
|
|
63561
63594
|
if (type.flags & 2097152 /* Intersection */) {
|
|
63562
|
-
return some(type.types, (t) => isDeeplyNestedType(t, stack, depth, maxDepth));
|
|
63595
|
+
return some(type.types, (t) => isDeeplyNestedType(getResolvedType(t), stack, depth, maxDepth));
|
|
63563
63596
|
}
|
|
63564
63597
|
const identity2 = getRecursionIdentity(type);
|
|
63565
63598
|
let count = 0;
|
|
@@ -63581,17 +63614,17 @@ function createTypeChecker(host) {
|
|
|
63581
63614
|
}
|
|
63582
63615
|
function getMappedTargetWithSymbol(type) {
|
|
63583
63616
|
let target;
|
|
63584
|
-
while ((getObjectFlags(type) &
|
|
63617
|
+
while ((getObjectFlags(type) & 160 /* InstantiatedMapped */) === 160 /* InstantiatedMapped */ && (target = getModifiersTypeFromMappedType(type)) && (target.symbol || target.flags & 2097152 /* Intersection */ && some(target.types, (t) => !!t.symbol))) {
|
|
63585
63618
|
type = target;
|
|
63586
63619
|
}
|
|
63587
63620
|
return type;
|
|
63588
63621
|
}
|
|
63589
63622
|
function hasMatchingRecursionIdentity(type, identity2) {
|
|
63590
|
-
if ((getObjectFlags(type) &
|
|
63623
|
+
if ((getObjectFlags(type) & 160 /* InstantiatedMapped */) === 160 /* InstantiatedMapped */) {
|
|
63591
63624
|
type = getMappedTargetWithSymbol(type);
|
|
63592
63625
|
}
|
|
63593
63626
|
if (type.flags & 2097152 /* Intersection */) {
|
|
63594
|
-
return some(type.types, (t) => hasMatchingRecursionIdentity(t, identity2));
|
|
63627
|
+
return some(type.types, (t) => hasMatchingRecursionIdentity(getResolvedType(t), identity2));
|
|
63595
63628
|
}
|
|
63596
63629
|
return getRecursionIdentity(type) === identity2;
|
|
63597
63630
|
}
|
|
@@ -63774,10 +63807,10 @@ function createTypeChecker(host) {
|
|
|
63774
63807
|
if (!(getObjectFlags(type) & 4 /* Reference */) || !(getObjectFlags(type.target) & 3 /* ClassOrInterface */)) {
|
|
63775
63808
|
return void 0;
|
|
63776
63809
|
}
|
|
63777
|
-
if (getObjectFlags(type) &
|
|
63778
|
-
return getObjectFlags(type) &
|
|
63810
|
+
if (getObjectFlags(type) & 67108864 /* IdenticalBaseTypeCalculated */) {
|
|
63811
|
+
return getObjectFlags(type) & 134217728 /* IdenticalBaseTypeExists */ ? type.cachedEquivalentBaseType : void 0;
|
|
63779
63812
|
}
|
|
63780
|
-
type.objectFlags |=
|
|
63813
|
+
type.objectFlags |= 67108864 /* IdenticalBaseTypeCalculated */;
|
|
63781
63814
|
const target = type.target;
|
|
63782
63815
|
if (getObjectFlags(target) & 1 /* Class */) {
|
|
63783
63816
|
const baseTypeNode = getBaseTypeNodeOfClass(target);
|
|
@@ -63796,7 +63829,7 @@ function createTypeChecker(host) {
|
|
|
63796
63829
|
if (length(getTypeArguments(type)) > length(target.typeParameters)) {
|
|
63797
63830
|
instantiatedBase = getTypeWithThisArgument(instantiatedBase, last(getTypeArguments(type)));
|
|
63798
63831
|
}
|
|
63799
|
-
type.objectFlags |=
|
|
63832
|
+
type.objectFlags |= 134217728 /* IdenticalBaseTypeExists */;
|
|
63800
63833
|
return type.cachedEquivalentBaseType = instantiatedBase;
|
|
63801
63834
|
}
|
|
63802
63835
|
function isEmptyLiteralType(type) {
|
|
@@ -63981,7 +64014,7 @@ function createTypeChecker(host) {
|
|
|
63981
64014
|
}
|
|
63982
64015
|
function isObjectTypeWithInferableIndex(type) {
|
|
63983
64016
|
const objectFlags = getObjectFlags(type);
|
|
63984
|
-
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 &
|
|
64017
|
+
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));
|
|
63985
64018
|
}
|
|
63986
64019
|
function createSymbolWithType(source, type) {
|
|
63987
64020
|
const symbol = createSymbol(source.flags, source.escapedName, getCheckFlags(source) & 8 /* Readonly */);
|
|
@@ -64008,7 +64041,7 @@ function createTypeChecker(host) {
|
|
|
64008
64041
|
return members;
|
|
64009
64042
|
}
|
|
64010
64043
|
function getRegularTypeOfObjectLiteral(type) {
|
|
64011
|
-
if (!(isObjectLiteralType(type) && getObjectFlags(type) &
|
|
64044
|
+
if (!(isObjectLiteralType(type) && getObjectFlags(type) & 16384 /* FreshLiteral */)) {
|
|
64012
64045
|
return type;
|
|
64013
64046
|
}
|
|
64014
64047
|
const regularType = type.regularType;
|
|
@@ -64019,7 +64052,7 @@ function createTypeChecker(host) {
|
|
|
64019
64052
|
const members = transformTypeOfMembers(type, getRegularTypeOfObjectLiteral);
|
|
64020
64053
|
const regularNew = createAnonymousType(resolved.symbol, members, resolved.callSignatures, resolved.constructSignatures, resolved.indexInfos);
|
|
64021
64054
|
regularNew.flags = resolved.flags;
|
|
64022
|
-
regularNew.objectFlags |= resolved.objectFlags & ~
|
|
64055
|
+
regularNew.objectFlags |= resolved.objectFlags & ~16384 /* FreshLiteral */;
|
|
64023
64056
|
type.regularType = regularNew;
|
|
64024
64057
|
return regularNew;
|
|
64025
64058
|
}
|
|
@@ -64047,7 +64080,7 @@ function createTypeChecker(host) {
|
|
|
64047
64080
|
if (!context.resolvedProperties) {
|
|
64048
64081
|
const names = /* @__PURE__ */ new Map();
|
|
64049
64082
|
for (const t of getSiblingsOfContext(context)) {
|
|
64050
|
-
if (isObjectLiteralType(t) && !(getObjectFlags(t) &
|
|
64083
|
+
if (isObjectLiteralType(t) && !(getObjectFlags(t) & 4194304 /* ContainsSpread */)) {
|
|
64051
64084
|
for (const prop of getPropertiesOfType(t)) {
|
|
64052
64085
|
names.set(prop.escapedName, prop);
|
|
64053
64086
|
}
|
|
@@ -64094,7 +64127,7 @@ function createTypeChecker(host) {
|
|
|
64094
64127
|
}
|
|
64095
64128
|
}
|
|
64096
64129
|
const result = createAnonymousType(type.symbol, members, emptyArray, emptyArray, sameMap(getIndexInfosOfType(type), (info) => createIndexInfo(info.keyType, getWidenedType(info.type), info.isReadonly)));
|
|
64097
|
-
result.objectFlags |= getObjectFlags(type) & (
|
|
64130
|
+
result.objectFlags |= getObjectFlags(type) & (8192 /* JSLiteral */ | 524288 /* NonInferrableType */);
|
|
64098
64131
|
return result;
|
|
64099
64132
|
}
|
|
64100
64133
|
function getWidenedType(type) {
|
|
@@ -64105,7 +64138,7 @@ function createTypeChecker(host) {
|
|
|
64105
64138
|
);
|
|
64106
64139
|
}
|
|
64107
64140
|
function getWidenedTypeWithContext(type, context) {
|
|
64108
|
-
if (getObjectFlags(type) &
|
|
64141
|
+
if (getObjectFlags(type) & 393216 /* RequiresWidening */) {
|
|
64109
64142
|
if (context === void 0 && type.widened) {
|
|
64110
64143
|
return type.widened;
|
|
64111
64144
|
}
|
|
@@ -64138,7 +64171,7 @@ function createTypeChecker(host) {
|
|
|
64138
64171
|
}
|
|
64139
64172
|
function reportWideningErrorsInType(type) {
|
|
64140
64173
|
let errorReported = false;
|
|
64141
|
-
if (getObjectFlags(type) &
|
|
64174
|
+
if (getObjectFlags(type) & 131072 /* ContainsWideningType */) {
|
|
64142
64175
|
if (type.flags & 1048576 /* Union */) {
|
|
64143
64176
|
if (some(type.types, isEmptyObjectType)) {
|
|
64144
64177
|
errorReported = true;
|
|
@@ -64160,7 +64193,7 @@ function createTypeChecker(host) {
|
|
|
64160
64193
|
if (isObjectLiteralType(type)) {
|
|
64161
64194
|
for (const p of getPropertiesOfObjectType(type)) {
|
|
64162
64195
|
const t = getTypeOfSymbol(p);
|
|
64163
|
-
if (getObjectFlags(t) &
|
|
64196
|
+
if (getObjectFlags(t) & 131072 /* ContainsWideningType */) {
|
|
64164
64197
|
if (!reportWideningErrorsInType(t)) {
|
|
64165
64198
|
error(p.valueDeclaration, Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, symbolToString(p), typeToString(getWidenedType(t)));
|
|
64166
64199
|
}
|
|
@@ -64248,7 +64281,7 @@ function createTypeChecker(host) {
|
|
|
64248
64281
|
}
|
|
64249
64282
|
function reportErrorsFromWidening(declaration, type, wideningKind) {
|
|
64250
64283
|
addLazyDiagnostic(() => {
|
|
64251
|
-
if (noImplicitAny && getObjectFlags(type) &
|
|
64284
|
+
if (noImplicitAny && getObjectFlags(type) & 131072 /* ContainsWideningType */ && (!wideningKind || !getContextualSignatureForFunctionLikeDeclaration(declaration))) {
|
|
64252
64285
|
if (!reportWideningErrorsInType(type)) {
|
|
64253
64286
|
reportImplicitAny(declaration, type, wideningKind);
|
|
64254
64287
|
}
|
|
@@ -64385,12 +64418,12 @@ function createTypeChecker(host) {
|
|
|
64385
64418
|
}
|
|
64386
64419
|
function couldContainTypeVariables(type) {
|
|
64387
64420
|
const objectFlags = getObjectFlags(type);
|
|
64388
|
-
if (objectFlags &
|
|
64389
|
-
return !!(objectFlags &
|
|
64421
|
+
if (objectFlags & 1048576 /* CouldContainTypeVariablesComputed */) {
|
|
64422
|
+
return !!(objectFlags & 2097152 /* CouldContainTypeVariables */);
|
|
64390
64423
|
}
|
|
64391
|
-
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 */ |
|
|
64424
|
+
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));
|
|
64392
64425
|
if (type.flags & 3899393 /* ObjectFlagsType */) {
|
|
64393
|
-
type.objectFlags |=
|
|
64426
|
+
type.objectFlags |= 1048576 /* CouldContainTypeVariablesComputed */ | (result ? 2097152 /* CouldContainTypeVariables */ : 0);
|
|
64394
64427
|
}
|
|
64395
64428
|
return result;
|
|
64396
64429
|
}
|
|
@@ -64454,7 +64487,7 @@ function createTypeChecker(host) {
|
|
|
64454
64487
|
return type;
|
|
64455
64488
|
}
|
|
64456
64489
|
function isPartiallyInferableType(type) {
|
|
64457
|
-
return !(getObjectFlags(type) &
|
|
64490
|
+
return !(getObjectFlags(type) & 524288 /* NonInferrableType */) || isObjectLiteralType(type) && some(getPropertiesOfType(type), (prop) => isPartiallyInferableType(getTypeOfSymbol(prop))) || isTupleType(type) && some(getElementTypes(type), isPartiallyInferableType);
|
|
64458
64491
|
}
|
|
64459
64492
|
function createReverseMappedType(source, target, constraint) {
|
|
64460
64493
|
if (!(getIndexInfoOfType(source, stringType) || getPropertiesOfType(source).length !== 0 && isPartiallyInferableType(source))) {
|
|
@@ -64469,7 +64502,7 @@ function createTypeChecker(host) {
|
|
|
64469
64502
|
return createTupleType(elementTypes, elementFlags, source.target.readonly, source.target.labeledElementDeclarations);
|
|
64470
64503
|
}
|
|
64471
64504
|
const reversed = createObjectType(
|
|
64472
|
-
|
|
64505
|
+
2048 /* ReverseMapped */ | 16 /* Anonymous */,
|
|
64473
64506
|
/*symbol*/
|
|
64474
64507
|
void 0
|
|
64475
64508
|
);
|
|
@@ -64690,6 +64723,8 @@ function createTypeChecker(host) {
|
|
|
64690
64723
|
propagationType = savePropagationType;
|
|
64691
64724
|
return;
|
|
64692
64725
|
}
|
|
64726
|
+
source = getResolvedType(source);
|
|
64727
|
+
target = getResolvedType(target);
|
|
64693
64728
|
if (source.aliasSymbol && source.aliasSymbol === target.aliasSymbol) {
|
|
64694
64729
|
if (source.aliasTypeArguments) {
|
|
64695
64730
|
const params = getSymbolLinks(source.aliasSymbol).typeParameters;
|
|
@@ -64740,7 +64775,7 @@ function createTypeChecker(host) {
|
|
|
64740
64775
|
}
|
|
64741
64776
|
const inference = getInferenceInfoForType(target);
|
|
64742
64777
|
if (inference) {
|
|
64743
|
-
if (getObjectFlags(source) &
|
|
64778
|
+
if (getObjectFlags(source) & 524288 /* NonInferrableType */ || source === nonInferrableAnyType) {
|
|
64744
64779
|
return;
|
|
64745
64780
|
}
|
|
64746
64781
|
if (!inference.isFixed) {
|
|
@@ -65024,7 +65059,7 @@ function createTypeChecker(host) {
|
|
|
65024
65059
|
inferWithPriority(
|
|
65025
65060
|
inferredType,
|
|
65026
65061
|
inference.typeParameter,
|
|
65027
|
-
getObjectFlags(source) &
|
|
65062
|
+
getObjectFlags(source) & 524288 /* NonInferrableType */ ? 16 /* PartialHomomorphicMappedType */ : 8 /* HomomorphicMappedType */
|
|
65028
65063
|
);
|
|
65029
65064
|
}
|
|
65030
65065
|
}
|
|
@@ -65279,10 +65314,10 @@ function createTypeChecker(host) {
|
|
|
65279
65314
|
return !!constraint && maybeTypeOfKind(constraint.flags & 16777216 /* Conditional */ ? getDefaultConstraintOfConditionalType(constraint) : constraint, 402784252 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */);
|
|
65280
65315
|
}
|
|
65281
65316
|
function isObjectLiteralType(type) {
|
|
65282
|
-
return !!(getObjectFlags(type) &
|
|
65317
|
+
return !!(getObjectFlags(type) & 256 /* ObjectLiteral */);
|
|
65283
65318
|
}
|
|
65284
65319
|
function isObjectOrArrayLiteralType(type) {
|
|
65285
|
-
return !!(getObjectFlags(type) & (
|
|
65320
|
+
return !!(getObjectFlags(type) & (256 /* ObjectLiteral */ | 32768 /* ArrayLiteral */));
|
|
65286
65321
|
}
|
|
65287
65322
|
function unionObjectAndArrayLiteralCandidates(candidates) {
|
|
65288
65323
|
if (candidates.length > 1) {
|
|
@@ -65610,7 +65645,7 @@ function createTypeChecker(host) {
|
|
|
65610
65645
|
}
|
|
65611
65646
|
function getKeyPropertyName(unionType) {
|
|
65612
65647
|
const types = unionType.types;
|
|
65613
|
-
if (types.length < 10 || getObjectFlags(unionType) &
|
|
65648
|
+
if (types.length < 10 || getObjectFlags(unionType) & 65536 /* PrimitiveUnion */ || countWhere(types, (t) => !!(t.flags & (524288 /* Object */ | 58982400 /* InstantiableNonPrimitive */))) < 10) {
|
|
65614
65649
|
return void 0;
|
|
65615
65650
|
}
|
|
65616
65651
|
if (unionType.keyPropertyName === void 0) {
|
|
@@ -65999,7 +66034,7 @@ function createTypeChecker(host) {
|
|
|
65999
66034
|
}
|
|
66000
66035
|
return getUnionTypeFromSortedList(
|
|
66001
66036
|
filtered,
|
|
66002
|
-
type.objectFlags & (
|
|
66037
|
+
type.objectFlags & (65536 /* PrimitiveUnion */ | 33554432 /* ContainsIntersections */),
|
|
66003
66038
|
/*aliasSymbol*/
|
|
66004
66039
|
void 0,
|
|
66005
66040
|
/*aliasTypeArguments*/
|
|
@@ -66061,7 +66096,7 @@ function createTypeChecker(host) {
|
|
|
66061
66096
|
return incomplete ? { flags: 0, type: type.flags & 131072 /* Never */ ? silentNeverType : type } : type;
|
|
66062
66097
|
}
|
|
66063
66098
|
function createEvolvingArrayType(elementType) {
|
|
66064
|
-
const result = createObjectType(
|
|
66099
|
+
const result = createObjectType(512 /* EvolvingArray */);
|
|
66065
66100
|
result.elementType = elementType;
|
|
66066
66101
|
return result;
|
|
66067
66102
|
}
|
|
@@ -66081,16 +66116,16 @@ function createTypeChecker(host) {
|
|
|
66081
66116
|
return evolvingArrayType.finalArrayType || (evolvingArrayType.finalArrayType = createFinalArrayType(evolvingArrayType.elementType));
|
|
66082
66117
|
}
|
|
66083
66118
|
function finalizeEvolvingArrayType(type) {
|
|
66084
|
-
return getObjectFlags(type) &
|
|
66119
|
+
return getObjectFlags(type) & 512 /* EvolvingArray */ ? getFinalArrayType(type) : type;
|
|
66085
66120
|
}
|
|
66086
66121
|
function getElementTypeOfEvolvingArrayType(type) {
|
|
66087
|
-
return getObjectFlags(type) &
|
|
66122
|
+
return getObjectFlags(type) & 512 /* EvolvingArray */ ? type.elementType : neverType;
|
|
66088
66123
|
}
|
|
66089
66124
|
function isEvolvingArrayTypeList(types) {
|
|
66090
66125
|
let hasEvolvingArrayType = false;
|
|
66091
66126
|
for (const t of types) {
|
|
66092
66127
|
if (!(t.flags & 131072 /* Never */)) {
|
|
66093
|
-
if (!(getObjectFlags(t) &
|
|
66128
|
+
if (!(getObjectFlags(t) & 512 /* EvolvingArray */)) {
|
|
66094
66129
|
return false;
|
|
66095
66130
|
}
|
|
66096
66131
|
hasEvolvingArrayType = true;
|
|
@@ -66394,7 +66429,7 @@ function createTypeChecker(host) {
|
|
|
66394
66429
|
const sharedFlowStart = sharedFlowCount;
|
|
66395
66430
|
const evolvedType = getTypeFromFlowType(getTypeAtFlowNode(flowNode));
|
|
66396
66431
|
sharedFlowCount = sharedFlowStart;
|
|
66397
|
-
const resultType = getObjectFlags(evolvedType) &
|
|
66432
|
+
const resultType = getObjectFlags(evolvedType) & 512 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType);
|
|
66398
66433
|
if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 235 /* NonNullExpression */ && !(resultType.flags & 131072 /* Never */) && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) {
|
|
66399
66434
|
return declaredType;
|
|
66400
66435
|
}
|
|
@@ -66581,7 +66616,7 @@ function createTypeChecker(host) {
|
|
|
66581
66616
|
if (isMatchingReference(reference, getReferenceCandidate(expr))) {
|
|
66582
66617
|
const flowType = getTypeAtFlowNode(flow.antecedent);
|
|
66583
66618
|
const type = getTypeFromFlowType(flowType);
|
|
66584
|
-
if (getObjectFlags(type) &
|
|
66619
|
+
if (getObjectFlags(type) & 512 /* EvolvingArray */) {
|
|
66585
66620
|
let evolvedType2 = type;
|
|
66586
66621
|
if (node.kind === 213 /* CallExpression */) {
|
|
66587
66622
|
for (const arg of node.arguments) {
|
|
@@ -67434,7 +67469,7 @@ function createTypeChecker(host) {
|
|
|
67434
67469
|
location = location.parent;
|
|
67435
67470
|
}
|
|
67436
67471
|
if (isExpressionNode(location) && (!isAssignmentTarget(location) || isWriteAccess(location))) {
|
|
67437
|
-
const type = removeOptionalTypeMarker(
|
|
67472
|
+
const type = getResolvedType(removeOptionalTypeMarker(
|
|
67438
67473
|
isWriteAccess(location) && location.kind === 211 /* PropertyAccessExpression */ ? checkPropertyAccessExpression(
|
|
67439
67474
|
location,
|
|
67440
67475
|
/*checkMode*/
|
|
@@ -67442,7 +67477,7 @@ function createTypeChecker(host) {
|
|
|
67442
67477
|
/*writeOnly*/
|
|
67443
67478
|
true
|
|
67444
67479
|
) : getTypeOfExpression(location)
|
|
67445
|
-
);
|
|
67480
|
+
));
|
|
67446
67481
|
if (getExportSymbolOfValueSymbolIfExported(getNodeLinks(location).resolvedSymbol) === symbol) {
|
|
67447
67482
|
return type;
|
|
67448
67483
|
}
|
|
@@ -69490,7 +69525,7 @@ function createTypeChecker(host) {
|
|
|
69490
69525
|
let literalType = type.literalType;
|
|
69491
69526
|
if (!literalType) {
|
|
69492
69527
|
literalType = type.literalType = cloneTypeReference(type);
|
|
69493
|
-
literalType.objectFlags |=
|
|
69528
|
+
literalType.objectFlags |= 32768 /* ArrayLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
|
|
69494
69529
|
}
|
|
69495
69530
|
return literalType;
|
|
69496
69531
|
}
|
|
@@ -69618,7 +69653,7 @@ function createTypeChecker(host) {
|
|
|
69618
69653
|
checkTypeAssignableTo(type, getTypeFromTypeNode(enumTag.typeExpression), memberDecl);
|
|
69619
69654
|
}
|
|
69620
69655
|
}
|
|
69621
|
-
objectFlags |= getObjectFlags(type) &
|
|
69656
|
+
objectFlags |= getObjectFlags(type) & 917504 /* PropagatingFlags */;
|
|
69622
69657
|
const nameType = computedNameType && isTypeUsableAsPropertyName(computedNameType) ? computedNameType : void 0;
|
|
69623
69658
|
const prop = nameType ? createSymbol(4 /* Property */ | member.flags, getPropertyNameFromType(nameType), checkFlags | 4096 /* Late */) : createSymbol(4 /* Property */ | member.flags, member.escapedName, checkFlags);
|
|
69624
69659
|
if (nameType) {
|
|
@@ -69629,7 +69664,7 @@ function createTypeChecker(host) {
|
|
|
69629
69664
|
if (isOptional) {
|
|
69630
69665
|
prop.flags |= 16777216 /* Optional */;
|
|
69631
69666
|
}
|
|
69632
|
-
} else if (contextualTypeHasPattern && !(getObjectFlags(contextualType) &
|
|
69667
|
+
} else if (contextualTypeHasPattern && !(getObjectFlags(contextualType) & 1024 /* ObjectLiteralPatternWithComputedProperties */)) {
|
|
69633
69668
|
const impliedProp = getPropertyOfType(contextualType, member.escapedName);
|
|
69634
69669
|
if (impliedProp) {
|
|
69635
69670
|
prop.flags |= impliedProp.flags & 16777216 /* Optional */;
|
|
@@ -69741,12 +69776,12 @@ function createTypeChecker(host) {
|
|
|
69741
69776
|
if (hasComputedSymbolProperty)
|
|
69742
69777
|
indexInfos.push(getObjectLiteralIndexInfo(node, offset, propertiesArray, esSymbolType));
|
|
69743
69778
|
const result = createAnonymousType(node.symbol, propertiesTable, emptyArray, emptyArray, indexInfos);
|
|
69744
|
-
result.objectFlags |= objectFlags |
|
|
69779
|
+
result.objectFlags |= objectFlags | 256 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
|
|
69745
69780
|
if (isJSObjectLiteral) {
|
|
69746
|
-
result.objectFlags |=
|
|
69781
|
+
result.objectFlags |= 8192 /* JSLiteral */;
|
|
69747
69782
|
}
|
|
69748
69783
|
if (patternWithComputedProperties) {
|
|
69749
|
-
result.objectFlags |=
|
|
69784
|
+
result.objectFlags |= 1024 /* ObjectLiteralPatternWithComputedProperties */;
|
|
69750
69785
|
}
|
|
69751
69786
|
if (inDestructuringPattern) {
|
|
69752
69787
|
result.pattern = node;
|
|
@@ -69808,13 +69843,13 @@ function createTypeChecker(host) {
|
|
|
69808
69843
|
let hasSpreadAnyType = false;
|
|
69809
69844
|
let typeToIntersect;
|
|
69810
69845
|
let explicitlySpecifyChildrenAttribute = false;
|
|
69811
|
-
let objectFlags =
|
|
69846
|
+
let objectFlags = 4096 /* JsxAttributes */;
|
|
69812
69847
|
const jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(openingLikeElement));
|
|
69813
69848
|
for (const attributeDecl of attributes.properties) {
|
|
69814
69849
|
const member = attributeDecl.symbol;
|
|
69815
69850
|
if (isJsxAttribute(attributeDecl)) {
|
|
69816
69851
|
const exprType = checkJsxAttribute(attributeDecl, checkMode);
|
|
69817
|
-
objectFlags |= getObjectFlags(exprType) &
|
|
69852
|
+
objectFlags |= getObjectFlags(exprType) & 917504 /* PropagatingFlags */;
|
|
69818
69853
|
const attributeSymbol = createSymbol(4 /* Property */ | member.flags, member.escapedName);
|
|
69819
69854
|
attributeSymbol.declarations = member.declarations;
|
|
69820
69855
|
attributeSymbol.parent = member.parent;
|
|
@@ -69935,7 +69970,7 @@ function createTypeChecker(host) {
|
|
|
69935
69970
|
function createJsxAttributesType() {
|
|
69936
69971
|
objectFlags |= freshObjectLiteralFlag;
|
|
69937
69972
|
const result = createAnonymousType(attributes.symbol, attributesTable, emptyArray, emptyArray, emptyArray);
|
|
69938
|
-
result.objectFlags |= objectFlags |
|
|
69973
|
+
result.objectFlags |= objectFlags | 256 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
|
|
69939
69974
|
return result;
|
|
69940
69975
|
}
|
|
69941
69976
|
}
|
|
@@ -70328,7 +70363,7 @@ function createTypeChecker(host) {
|
|
|
70328
70363
|
return false;
|
|
70329
70364
|
}
|
|
70330
70365
|
function isExcessPropertyCheckTarget(type) {
|
|
70331
|
-
return !!(type.flags & 524288 /* Object */ && !(getObjectFlags(type) &
|
|
70366
|
+
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));
|
|
70332
70367
|
}
|
|
70333
70368
|
function checkJsxExpression(node, checkMode) {
|
|
70334
70369
|
checkGrammarJsxExpression(node);
|
|
@@ -73096,7 +73131,7 @@ function createTypeChecker(host) {
|
|
|
73096
73131
|
);
|
|
73097
73132
|
if ((_c = jsSymbol == null ? void 0 : jsSymbol.exports) == null ? void 0 : _c.size) {
|
|
73098
73133
|
const jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, emptyArray, emptyArray, emptyArray);
|
|
73099
|
-
jsAssignmentType.objectFlags |=
|
|
73134
|
+
jsAssignmentType.objectFlags |= 8192 /* JSLiteral */;
|
|
73100
73135
|
return getIntersectionType([returnType, jsAssignmentType]);
|
|
73101
73136
|
}
|
|
73102
73137
|
}
|
|
@@ -73442,7 +73477,7 @@ function createTypeChecker(host) {
|
|
|
73442
73477
|
hasApplicableSignature || (hasApplicableSignature = callSignatures.length !== 0 || constructSignatures.length !== 0);
|
|
73443
73478
|
if (callSignatures !== resolved.callSignatures || constructSignatures !== resolved.constructSignatures) {
|
|
73444
73479
|
const result3 = createAnonymousType(createSymbol(0 /* None */, "__instantiationExpression" /* InstantiationExpression */), resolved.members, callSignatures, constructSignatures, resolved.indexInfos);
|
|
73445
|
-
result3.objectFlags |=
|
|
73480
|
+
result3.objectFlags |= 16777216 /* InstantiationExpressionType */;
|
|
73446
73481
|
result3.node = node;
|
|
73447
73482
|
return result3;
|
|
73448
73483
|
}
|
|
@@ -74483,7 +74518,7 @@ function createTypeChecker(host) {
|
|
|
74483
74518
|
64 /* IsNonInferrable */
|
|
74484
74519
|
);
|
|
74485
74520
|
const returnOnlyType = createAnonymousType(node.symbol, emptySymbols, [returnOnlySignature], emptyArray, emptyArray);
|
|
74486
|
-
returnOnlyType.objectFlags |=
|
|
74521
|
+
returnOnlyType.objectFlags |= 524288 /* NonInferrableType */;
|
|
74487
74522
|
return links.contextFreeType = returnOnlyType;
|
|
74488
74523
|
}
|
|
74489
74524
|
}
|
|
@@ -85259,7 +85294,7 @@ function createTypeChecker(host) {
|
|
|
85259
85294
|
}
|
|
85260
85295
|
}
|
|
85261
85296
|
function findBestTypeForObjectLiteral(source, unionTarget) {
|
|
85262
|
-
if (getObjectFlags(source) &
|
|
85297
|
+
if (getObjectFlags(source) & 256 /* ObjectLiteral */ && someType(unionTarget, isArrayLikeType)) {
|
|
85263
85298
|
return find(unionTarget.types, (t) => !isArrayLikeType(t));
|
|
85264
85299
|
}
|
|
85265
85300
|
}
|