@typescript-deploys/pr-build 5.1.0-pr-52968-5 → 5.1.0-pr-53258-7
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/lib.es5.d.ts +0 -5
- package/lib/tsc.js +94 -139
- package/lib/tsserver.js +112 -139
- package/lib/tsserverlibrary.d.ts +4 -9
- package/lib/tsserverlibrary.js +114 -142
- package/lib/typescript.d.ts +4 -9
- package/lib/typescript.js +113 -142
- package/lib/typingsInstaller.js +7 -7
- package/package.json +3 -3
package/lib/tsserverlibrary.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.1";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20230314`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -3545,7 +3545,7 @@ ${lanes.join("\n")}
|
|
|
3545
3545
|
const name = DiagnosticCategory[d.category];
|
|
3546
3546
|
return lowerCase ? name.toLowerCase() : name;
|
|
3547
3547
|
}
|
|
3548
|
-
var SyntaxKind, NodeFlags, ModifierFlags, JsxFlags, RelationComparisonResult, GeneratedIdentifierFlags, TokenFlags, FlowFlags, CommentDirectiveType, OperationCanceledException, FileIncludeKind, FilePreprocessingDiagnosticsKind, EmitOnly, StructureIsReused, ExitStatus, MemberOverrideStatus, UnionReduction, ContextFlags, NodeBuilderFlags, TypeFormatFlags, SymbolFormatFlags, SymbolAccessibility, SyntheticSymbolKind, TypePredicateKind, TypeReferenceSerializationKind, SymbolFlags, EnumKind, CheckFlags, InternalSymbolName, NodeCheckFlags, TypeFlags, ObjectFlags, VarianceFlags, ElementFlags, AccessFlags, JsxReferenceKind, SignatureKind, SignatureFlags, IndexKind, TypeMapKind, InferencePriority, InferenceFlags, Ternary, AssignmentDeclarationKind, DiagnosticCategory, ModuleResolutionKind, ModuleDetectionKind, WatchFileKind, WatchDirectoryKind, PollingWatchKind, ModuleKind, JsxEmit, ImportsNotUsedAsValues, NewLineKind, ScriptKind, ScriptTarget, LanguageVariant, WatchDirectoryFlags, CharacterCodes, Extension, TransformFlags, SnippetKind, EmitFlags, InternalEmitFlags, ExternalEmitHelpers, EmitHint, OuterExpressionKinds, LexicalEnvironmentFlags, BundleFileSectionKind, ListFormat, PragmaKindFlags, commentPragmas;
|
|
3548
|
+
var SyntaxKind, NodeFlags, ModifierFlags, JsxFlags, RelationComparisonResult, GeneratedIdentifierFlags, TokenFlags, FlowFlags, CommentDirectiveType, OperationCanceledException, FileIncludeKind, FilePreprocessingDiagnosticsKind, EmitOnly, StructureIsReused, ExitStatus, MemberOverrideStatus, UnionReduction, ContextFlags, NodeBuilderFlags, TypeFormatFlags, SymbolFormatFlags, SymbolAccessibility, SyntheticSymbolKind, TypePredicateKind, TypeReferenceSerializationKind, SymbolFlags, EnumKind, CheckFlags, InternalSymbolName, NodeCheckFlags, TypeFlags, ObjectFlags, VarianceFlags, ElementFlags, AccessFlags, IndexFlags, JsxReferenceKind, SignatureKind, SignatureFlags, IndexKind, TypeMapKind, InferencePriority, InferenceFlags, Ternary, AssignmentDeclarationKind, DiagnosticCategory, ModuleResolutionKind, ModuleDetectionKind, WatchFileKind, WatchDirectoryKind, PollingWatchKind, ModuleKind, JsxEmit, ImportsNotUsedAsValues, NewLineKind, ScriptKind, ScriptTarget, LanguageVariant, WatchDirectoryFlags, CharacterCodes, Extension, TransformFlags, SnippetKind, EmitFlags, InternalEmitFlags, ExternalEmitHelpers, EmitHint, OuterExpressionKinds, LexicalEnvironmentFlags, BundleFileSectionKind, ListFormat, PragmaKindFlags, commentPragmas;
|
|
3549
3549
|
var init_types = __esm({
|
|
3550
3550
|
"src/compiler/types.ts"() {
|
|
3551
3551
|
"use strict";
|
|
@@ -4435,7 +4435,6 @@ ${lanes.join("\n")}
|
|
|
4435
4435
|
TypeFlags2[TypeFlags2["NonPrimitive"] = 67108864] = "NonPrimitive";
|
|
4436
4436
|
TypeFlags2[TypeFlags2["TemplateLiteral"] = 134217728] = "TemplateLiteral";
|
|
4437
4437
|
TypeFlags2[TypeFlags2["StringMapping"] = 268435456] = "StringMapping";
|
|
4438
|
-
TypeFlags2[TypeFlags2["NoInfer"] = 536870912] = "NoInfer";
|
|
4439
4438
|
TypeFlags2[TypeFlags2["AnyOrUnknown"] = 3] = "AnyOrUnknown";
|
|
4440
4439
|
TypeFlags2[TypeFlags2["Nullable"] = 98304] = "Nullable";
|
|
4441
4440
|
TypeFlags2[TypeFlags2["Literal"] = 2944] = "Literal";
|
|
@@ -4459,14 +4458,14 @@ ${lanes.join("\n")}
|
|
|
4459
4458
|
TypeFlags2[TypeFlags2["UnionOrIntersection"] = 3145728] = "UnionOrIntersection";
|
|
4460
4459
|
TypeFlags2[TypeFlags2["StructuredType"] = 3670016] = "StructuredType";
|
|
4461
4460
|
TypeFlags2[TypeFlags2["TypeVariable"] = 8650752] = "TypeVariable";
|
|
4462
|
-
TypeFlags2[TypeFlags2["InstantiableNonPrimitive"] =
|
|
4461
|
+
TypeFlags2[TypeFlags2["InstantiableNonPrimitive"] = 58982400] = "InstantiableNonPrimitive";
|
|
4463
4462
|
TypeFlags2[TypeFlags2["InstantiablePrimitive"] = 406847488] = "InstantiablePrimitive";
|
|
4464
|
-
TypeFlags2[TypeFlags2["Instantiable"] =
|
|
4465
|
-
TypeFlags2[TypeFlags2["StructuredOrInstantiable"] =
|
|
4463
|
+
TypeFlags2[TypeFlags2["Instantiable"] = 465829888] = "Instantiable";
|
|
4464
|
+
TypeFlags2[TypeFlags2["StructuredOrInstantiable"] = 469499904] = "StructuredOrInstantiable";
|
|
4466
4465
|
TypeFlags2[TypeFlags2["ObjectFlagsType"] = 3899393] = "ObjectFlagsType";
|
|
4467
4466
|
TypeFlags2[TypeFlags2["Simplifiable"] = 25165824] = "Simplifiable";
|
|
4468
4467
|
TypeFlags2[TypeFlags2["Singleton"] = 67358815] = "Singleton";
|
|
4469
|
-
TypeFlags2[TypeFlags2["Narrowable"] =
|
|
4468
|
+
TypeFlags2[TypeFlags2["Narrowable"] = 536624127] = "Narrowable";
|
|
4470
4469
|
TypeFlags2[TypeFlags2["IncludesMask"] = 473694207] = "IncludesMask";
|
|
4471
4470
|
TypeFlags2[TypeFlags2["IncludesMissingType"] = 262144 /* TypeParameter */] = "IncludesMissingType";
|
|
4472
4471
|
TypeFlags2[TypeFlags2["IncludesNonWideningType"] = 4194304 /* Index */] = "IncludesNonWideningType";
|
|
@@ -4557,6 +4556,13 @@ ${lanes.join("\n")}
|
|
|
4557
4556
|
AccessFlags2[AccessFlags2["Persistent"] = 1 /* IncludeUndefined */] = "Persistent";
|
|
4558
4557
|
return AccessFlags2;
|
|
4559
4558
|
})(AccessFlags || {});
|
|
4559
|
+
IndexFlags = /* @__PURE__ */ ((IndexFlags2) => {
|
|
4560
|
+
IndexFlags2[IndexFlags2["None"] = 0] = "None";
|
|
4561
|
+
IndexFlags2[IndexFlags2["StringsOnly"] = 1] = "StringsOnly";
|
|
4562
|
+
IndexFlags2[IndexFlags2["NoIndexSignatures"] = 2] = "NoIndexSignatures";
|
|
4563
|
+
IndexFlags2[IndexFlags2["NoReducibleCheck"] = 4] = "NoReducibleCheck";
|
|
4564
|
+
return IndexFlags2;
|
|
4565
|
+
})(IndexFlags || {});
|
|
4560
4566
|
JsxReferenceKind = /* @__PURE__ */ ((JsxReferenceKind2) => {
|
|
4561
4567
|
JsxReferenceKind2[JsxReferenceKind2["Component"] = 0] = "Component";
|
|
4562
4568
|
JsxReferenceKind2[JsxReferenceKind2["Function"] = 1] = "Function";
|
|
@@ -7216,6 +7222,7 @@ ${lanes.join("\n")}
|
|
|
7216
7222
|
Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5: diag(1250, 1 /* Error */, "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_1250", "Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'."),
|
|
7217
7223
|
Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_definitions_are_automatically_in_strict_mode: diag(1251, 1 /* Error */, "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_d_1251", "Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Class definitions are automatically in strict mode."),
|
|
7218
7224
|
Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_are_automatically_in_strict_mode: diag(1252, 1 /* Error */, "Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_1252", "Function declarations are not allowed inside blocks in strict mode when targeting 'ES3' or 'ES5'. Modules are automatically in strict mode."),
|
|
7225
|
+
Abstract_properties_can_only_appear_within_an_abstract_class: diag(1253, 1 /* Error */, "Abstract_properties_can_only_appear_within_an_abstract_class_1253", "Abstract properties can only appear within an abstract class."),
|
|
7219
7226
|
A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_reference: diag(1254, 1 /* Error */, "A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_refere_1254", "A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference."),
|
|
7220
7227
|
A_definite_assignment_assertion_is_not_permitted_in_this_context: diag(1255, 1 /* Error */, "A_definite_assignment_assertion_is_not_permitted_in_this_context_1255", "A definite assignment assertion '!' is not permitted in this context."),
|
|
7221
7228
|
A_required_element_cannot_follow_an_optional_element: diag(1257, 1 /* Error */, "A_required_element_cannot_follow_an_optional_element_1257", "A required element cannot follow an optional element."),
|
|
@@ -45083,6 +45090,7 @@ ${lanes.join("\n")}
|
|
|
45083
45090
|
var noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis");
|
|
45084
45091
|
var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
|
|
45085
45092
|
var keyofStringsOnly = !!compilerOptions.keyofStringsOnly;
|
|
45093
|
+
var defaultIndexFlags = keyofStringsOnly ? 1 /* StringsOnly */ : 0 /* None */;
|
|
45086
45094
|
var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8192 /* FreshLiteral */;
|
|
45087
45095
|
var exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes;
|
|
45088
45096
|
var checkBinaryExpression = createCheckBinaryExpression();
|
|
@@ -45530,7 +45538,7 @@ ${lanes.join("\n")}
|
|
|
45530
45538
|
var enumLiteralTypes = /* @__PURE__ */ new Map();
|
|
45531
45539
|
var indexedAccessTypes = /* @__PURE__ */ new Map();
|
|
45532
45540
|
var templateLiteralTypes = /* @__PURE__ */ new Map();
|
|
45533
|
-
var
|
|
45541
|
+
var stringMappingTypes = /* @__PURE__ */ new Map();
|
|
45534
45542
|
var substitutionTypes = /* @__PURE__ */ new Map();
|
|
45535
45543
|
var subtypeReductionCache = /* @__PURE__ */ new Map();
|
|
45536
45544
|
var decoratorContextOverrideTypeCache = /* @__PURE__ */ new Map();
|
|
@@ -49664,10 +49672,6 @@ ${lanes.join("\n")}
|
|
|
49664
49672
|
const typeNode = typeToTypeNodeHelper(type.type, context);
|
|
49665
49673
|
return symbolToTypeNode(type.symbol, context, 788968 /* Type */, [typeNode]);
|
|
49666
49674
|
}
|
|
49667
|
-
if (type.flags & 536870912 /* NoInfer */) {
|
|
49668
|
-
const typeNode = typeToTypeNodeHelper(type.type, context);
|
|
49669
|
-
return symbolToTypeNode(type.symbol, context, 788968 /* Type */, [typeNode]);
|
|
49670
|
-
}
|
|
49671
49675
|
if (type.flags & 8388608 /* IndexedAccess */) {
|
|
49672
49676
|
const objectTypeNode = typeToTypeNodeHelper(type.objectType, context);
|
|
49673
49677
|
const indexTypeNode = typeToTypeNodeHelper(type.indexType, context);
|
|
@@ -53126,10 +53130,10 @@ ${lanes.join("\n")}
|
|
|
53126
53130
|
return result;
|
|
53127
53131
|
}
|
|
53128
53132
|
function isGenericTypeWithUndefinedConstraint(type) {
|
|
53129
|
-
return !!(type.flags &
|
|
53133
|
+
return !!(type.flags & 465829888 /* Instantiable */) && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 32768 /* Undefined */);
|
|
53130
53134
|
}
|
|
53131
53135
|
function getNonUndefinedType(type) {
|
|
53132
|
-
const typeOrConstraint = someType(type, isGenericTypeWithUndefinedConstraint) ? mapType(type, (t) => t.flags &
|
|
53136
|
+
const typeOrConstraint = someType(type, isGenericTypeWithUndefinedConstraint) ? mapType(type, (t) => t.flags & 465829888 /* Instantiable */ ? getBaseConstraintOrType(t) : t) : type;
|
|
53133
53137
|
return getTypeWithFacts(typeOrConstraint, 524288 /* NEUndefined */);
|
|
53134
53138
|
}
|
|
53135
53139
|
function getFlowTypeOfDestructuring(node, declaredType) {
|
|
@@ -55948,7 +55952,7 @@ ${lanes.join("\n")}
|
|
|
55948
55952
|
let constraints;
|
|
55949
55953
|
let hasDisjointDomainType = false;
|
|
55950
55954
|
for (const t of types) {
|
|
55951
|
-
if (t.flags &
|
|
55955
|
+
if (t.flags & 465829888 /* Instantiable */) {
|
|
55952
55956
|
let constraint = getConstraintOfType(t);
|
|
55953
55957
|
while (constraint && constraint.flags & (262144 /* TypeParameter */ | 4194304 /* Index */ | 16777216 /* Conditional */)) {
|
|
55954
55958
|
constraint = getConstraintOfType(constraint);
|
|
@@ -55980,7 +55984,7 @@ ${lanes.join("\n")}
|
|
|
55980
55984
|
return void 0;
|
|
55981
55985
|
}
|
|
55982
55986
|
function getBaseConstraintOfType(type) {
|
|
55983
|
-
if (type.flags & (
|
|
55987
|
+
if (type.flags & (58982400 /* InstantiableNonPrimitive */ | 3145728 /* UnionOrIntersection */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */)) {
|
|
55984
55988
|
const constraint = getResolvedBaseConstraint(type);
|
|
55985
55989
|
return constraint !== noConstraintType && constraint !== circularConstraintType ? constraint : void 0;
|
|
55986
55990
|
}
|
|
@@ -56071,9 +56075,6 @@ ${lanes.join("\n")}
|
|
|
56071
56075
|
const constraint = getBaseConstraint(t.type);
|
|
56072
56076
|
return constraint && constraint !== t.type ? getStringMappingType(t.symbol, constraint) : stringType;
|
|
56073
56077
|
}
|
|
56074
|
-
if (t.flags & 536870912 /* NoInfer */) {
|
|
56075
|
-
return getBaseConstraint(t.type);
|
|
56076
|
-
}
|
|
56077
56078
|
if (t.flags & 8388608 /* IndexedAccess */) {
|
|
56078
56079
|
if (isMappedTypeGenericIndexedAccess(t)) {
|
|
56079
56080
|
return getBaseConstraint(substituteIndexedMappedType(t.objectType, t.indexType));
|
|
@@ -56147,7 +56148,7 @@ ${lanes.join("\n")}
|
|
|
56147
56148
|
return !!(type.flags & 8388608 /* IndexedAccess */ && getObjectFlags(objectType = type.objectType) & 32 /* Mapped */ && !isGenericMappedType(objectType) && isGenericIndexType(type.indexType) && !(getMappedTypeModifiers(objectType) & 8 /* ExcludeOptional */) && !objectType.declaration.nameType);
|
|
56148
56149
|
}
|
|
56149
56150
|
function getApparentType(type) {
|
|
56150
|
-
const t = !(type.flags &
|
|
56151
|
+
const t = !(type.flags & 465829888 /* Instantiable */) ? type : getBaseConstraintOfType(type) || unknownType;
|
|
56151
56152
|
return getObjectFlags(t) & 32 /* Mapped */ ? getApparentTypeOfMappedType(t) : t.flags & 2097152 /* Intersection */ ? getApparentTypeOfIntersectionType(t) : t.flags & 402653316 /* StringLike */ ? globalStringType : t.flags & 296 /* NumberLike */ ? globalNumberType : t.flags & 2112 /* BigIntLike */ ? getGlobalBigIntType() : t.flags & 528 /* BooleanLike */ ? globalBooleanType : t.flags & 12288 /* ESSymbolLike */ ? getGlobalESSymbolType() : t.flags & 67108864 /* NonPrimitive */ ? emptyObjectType : t.flags & 4194304 /* Index */ ? keyofConstraintType : t.flags & 2 /* Unknown */ && !strictNullChecks ? emptyObjectType : t;
|
|
56152
56153
|
}
|
|
56153
56154
|
function getReducedApparentType(type) {
|
|
@@ -56358,6 +56359,13 @@ ${lanes.join("\n")}
|
|
|
56358
56359
|
function isConflictingPrivateProperty(prop) {
|
|
56359
56360
|
return !prop.valueDeclaration && !!(getCheckFlags(prop) & 1024 /* ContainsPrivate */);
|
|
56360
56361
|
}
|
|
56362
|
+
function isGenericReducibleType(type) {
|
|
56363
|
+
return !!(type.flags & 1048576 /* Union */ && type.objectFlags & 16777216 /* ContainsIntersections */ && some(type.types, isGenericReducibleType) || type.flags & 2097152 /* Intersection */ && isReducibleIntersection(type));
|
|
56364
|
+
}
|
|
56365
|
+
function isReducibleIntersection(type) {
|
|
56366
|
+
const uniqueFilled = type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper));
|
|
56367
|
+
return getReducedType(uniqueFilled) !== uniqueFilled;
|
|
56368
|
+
}
|
|
56361
56369
|
function elaborateNeverIntersection(errorInfo, type) {
|
|
56362
56370
|
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 33554432 /* IsNeverIntersection */) {
|
|
56363
56371
|
const neverProp = find(getPropertiesOfUnionOrIntersectionType(type), isDiscriminantWithNeverType);
|
|
@@ -57226,11 +57234,8 @@ ${lanes.join("\n")}
|
|
|
57226
57234
|
}
|
|
57227
57235
|
function getTypeAliasInstantiation(symbol, typeArguments, aliasSymbol, aliasTypeArguments) {
|
|
57228
57236
|
const type = getDeclaredTypeOfSymbol(symbol);
|
|
57229
|
-
if (type === intrinsicMarkerType && typeArguments && typeArguments.length === 1) {
|
|
57230
|
-
|
|
57231
|
-
return getStringMappingType(symbol, typeArguments[0]);
|
|
57232
|
-
}
|
|
57233
|
-
return getNoInferType(symbol, typeArguments[0]);
|
|
57237
|
+
if (type === intrinsicMarkerType && intrinsicTypeKinds.has(symbol.escapedName) && typeArguments && typeArguments.length === 1) {
|
|
57238
|
+
return getStringMappingType(symbol, typeArguments[0]);
|
|
57234
57239
|
}
|
|
57235
57240
|
const links = getSymbolLinks(symbol);
|
|
57236
57241
|
const typeParameters = links.typeParameters;
|
|
@@ -58134,7 +58139,7 @@ ${lanes.join("\n")}
|
|
|
58134
58139
|
const type = elementTypes[i];
|
|
58135
58140
|
const flags = target.elementFlags[i];
|
|
58136
58141
|
if (flags & 8 /* Variadic */) {
|
|
58137
|
-
if (type.flags &
|
|
58142
|
+
if (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type)) {
|
|
58138
58143
|
addElement(type, 8 /* Variadic */, (_a2 = target.labeledElementDeclarations) == null ? void 0 : _a2[i]);
|
|
58139
58144
|
} else if (isTupleType(type)) {
|
|
58140
58145
|
const elements = getTypeArguments(type);
|
|
@@ -58243,7 +58248,7 @@ ${lanes.join("\n")}
|
|
|
58243
58248
|
}
|
|
58244
58249
|
if (!(flags & 131072 /* Never */)) {
|
|
58245
58250
|
includes |= flags & 473694207 /* IncludesMask */;
|
|
58246
|
-
if (flags &
|
|
58251
|
+
if (flags & 465829888 /* Instantiable */)
|
|
58247
58252
|
includes |= 33554432 /* IncludesInstantiable */;
|
|
58248
58253
|
if (type === wildcardType)
|
|
58249
58254
|
includes |= 8388608 /* IncludesWildcard */;
|
|
@@ -58283,8 +58288,8 @@ ${lanes.join("\n")}
|
|
|
58283
58288
|
while (i > 0) {
|
|
58284
58289
|
i--;
|
|
58285
58290
|
const source = types[i];
|
|
58286
|
-
if (hasEmptyObject || source.flags &
|
|
58287
|
-
const keyProperty = source.flags & (524288 /* Object */ | 2097152 /* Intersection */ |
|
|
58291
|
+
if (hasEmptyObject || source.flags & 469499904 /* StructuredOrInstantiable */) {
|
|
58292
|
+
const keyProperty = source.flags & (524288 /* Object */ | 2097152 /* Intersection */ | 58982400 /* InstantiableNonPrimitive */) ? find(getPropertiesOfType(source), (p) => isUnitType(getTypeOfSymbol(p))) : void 0;
|
|
58288
58293
|
const keyPropertyType = keyProperty && getRegularTypeOfLiteralType(getTypeOfSymbol(keyProperty));
|
|
58289
58294
|
for (const target of types) {
|
|
58290
58295
|
if (source !== target) {
|
|
@@ -58297,7 +58302,7 @@ ${lanes.join("\n")}
|
|
|
58297
58302
|
}
|
|
58298
58303
|
}
|
|
58299
58304
|
count++;
|
|
58300
|
-
if (keyProperty && target.flags & (524288 /* Object */ | 2097152 /* Intersection */ |
|
|
58305
|
+
if (keyProperty && target.flags & (524288 /* Object */ | 2097152 /* Intersection */ | 58982400 /* InstantiableNonPrimitive */)) {
|
|
58301
58306
|
const t = getTypeOfPropertyOfType(target, keyProperty.escapedName);
|
|
58302
58307
|
if (t && isUnitType(t) && getRegularTypeOfLiteralType(t) !== keyPropertyType) {
|
|
58303
58308
|
continue;
|
|
@@ -58730,10 +58735,10 @@ ${lanes.join("\n")}
|
|
|
58730
58735
|
}
|
|
58731
58736
|
return links.resolvedType;
|
|
58732
58737
|
}
|
|
58733
|
-
function createIndexType(type,
|
|
58738
|
+
function createIndexType(type, indexFlags) {
|
|
58734
58739
|
const result = createType(4194304 /* Index */);
|
|
58735
58740
|
result.type = type;
|
|
58736
|
-
result.
|
|
58741
|
+
result.indexFlags = indexFlags;
|
|
58737
58742
|
return result;
|
|
58738
58743
|
}
|
|
58739
58744
|
function createOriginIndexType(type) {
|
|
@@ -58741,31 +58746,23 @@ ${lanes.join("\n")}
|
|
|
58741
58746
|
result.type = type;
|
|
58742
58747
|
return result;
|
|
58743
58748
|
}
|
|
58744
|
-
function getIndexTypeForGenericType(type,
|
|
58745
|
-
return
|
|
58746
|
-
type,
|
|
58747
|
-
/*stringsOnly*/
|
|
58748
|
-
true
|
|
58749
|
-
)) : type.resolvedIndexType || (type.resolvedIndexType = createIndexType(
|
|
58750
|
-
type,
|
|
58751
|
-
/*stringsOnly*/
|
|
58752
|
-
false
|
|
58753
|
-
));
|
|
58749
|
+
function getIndexTypeForGenericType(type, indexFlags) {
|
|
58750
|
+
return indexFlags & 1 /* StringsOnly */ ? type.resolvedStringIndexType || (type.resolvedStringIndexType = createIndexType(type, 1 /* StringsOnly */)) : type.resolvedIndexType || (type.resolvedIndexType = createIndexType(type, 0 /* None */));
|
|
58754
58751
|
}
|
|
58755
|
-
function getIndexTypeForMappedType(type,
|
|
58752
|
+
function getIndexTypeForMappedType(type, indexFlags) {
|
|
58756
58753
|
const typeParameter = getTypeParameterFromMappedType(type);
|
|
58757
58754
|
const constraintType = getConstraintTypeFromMappedType(type);
|
|
58758
58755
|
const nameType = getNameTypeFromMappedType(type.target || type);
|
|
58759
|
-
if (!nameType && !
|
|
58756
|
+
if (!nameType && !(indexFlags & 2 /* NoIndexSignatures */)) {
|
|
58760
58757
|
return constraintType;
|
|
58761
58758
|
}
|
|
58762
58759
|
const keyTypes = [];
|
|
58763
58760
|
if (isMappedTypeWithKeyofConstraintDeclaration(type)) {
|
|
58764
58761
|
if (!isGenericIndexType(constraintType)) {
|
|
58765
58762
|
const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
|
|
58766
|
-
forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, 8576 /* StringOrNumberLiteralOrUnique */,
|
|
58763
|
+
forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, 8576 /* StringOrNumberLiteralOrUnique */, !!(indexFlags & 1 /* StringsOnly */), addMemberForKeyType);
|
|
58767
58764
|
} else {
|
|
58768
|
-
return getIndexTypeForGenericType(type,
|
|
58765
|
+
return getIndexTypeForGenericType(type, indexFlags);
|
|
58769
58766
|
}
|
|
58770
58767
|
} else {
|
|
58771
58768
|
forEachType(getLowerBoundOfKeyType(constraintType), addMemberForKeyType);
|
|
@@ -58773,7 +58770,7 @@ ${lanes.join("\n")}
|
|
|
58773
58770
|
if (isGenericIndexType(constraintType)) {
|
|
58774
58771
|
forEachType(constraintType, addMemberForKeyType);
|
|
58775
58772
|
}
|
|
58776
|
-
const result =
|
|
58773
|
+
const result = indexFlags & 2 /* NoIndexSignatures */ ? filterType(getUnionType(keyTypes), (t) => !(t.flags & (1 /* Any */ | 4 /* String */))) : getUnionType(keyTypes);
|
|
58777
58774
|
if (result.flags & 1048576 /* Union */ && constraintType.flags & 1048576 /* Union */ && getTypeListId(result.types) === getTypeListId(constraintType.types)) {
|
|
58778
58775
|
return constraintType;
|
|
58779
58776
|
}
|
|
@@ -58826,19 +58823,15 @@ ${lanes.join("\n")}
|
|
|
58826
58823
|
origin
|
|
58827
58824
|
);
|
|
58828
58825
|
}
|
|
58829
|
-
function
|
|
58830
|
-
|
|
58831
|
-
return getReducedType(uniqueFilled) !== uniqueFilled;
|
|
58832
|
-
}
|
|
58833
|
-
function shouldDeferIndexType(type) {
|
|
58834
|
-
return !!(type.flags & 595853312 /* InstantiableNonPrimitive */ || isGenericTupleType(type) || isGenericMappedType(type) && !hasDistributiveNameType(type) || type.flags & 1048576 /* Union */ && some(type.types, isPossiblyReducibleByInstantiation) || type.flags & 2097152 /* Intersection */ && maybeTypeOfKind(type, 1002700800 /* Instantiable */) && some(type.types, isEmptyAnonymousObjectType));
|
|
58826
|
+
function shouldDeferIndexType(type, indexFlags = 0 /* None */) {
|
|
58827
|
+
return !!(type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericTupleType(type) || isGenericMappedType(type) && !hasDistributiveNameType(type) || type.flags & 1048576 /* Union */ && !(indexFlags & 4 /* NoReducibleCheck */) && isGenericReducibleType(type) || type.flags & 2097152 /* Intersection */ && maybeTypeOfKind(type, 465829888 /* Instantiable */) && some(type.types, isEmptyAnonymousObjectType));
|
|
58835
58828
|
}
|
|
58836
|
-
function getIndexType(type,
|
|
58829
|
+
function getIndexType(type, indexFlags = defaultIndexFlags) {
|
|
58837
58830
|
type = getReducedType(type);
|
|
58838
|
-
return shouldDeferIndexType(type) ? getIndexTypeForGenericType(type,
|
|
58831
|
+
return shouldDeferIndexType(type, indexFlags) ? getIndexTypeForGenericType(type, indexFlags) : type.flags & 1048576 /* Union */ ? getIntersectionType(map(type.types, (t) => getIndexType(t, indexFlags))) : type.flags & 2097152 /* Intersection */ ? getUnionType(map(type.types, (t) => getIndexType(t, indexFlags))) : getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, indexFlags) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : type.flags & (1 /* Any */ | 131072 /* Never */) ? keyofConstraintType : getLiteralTypeFromProperties(
|
|
58839
58832
|
type,
|
|
58840
|
-
(
|
|
58841
|
-
|
|
58833
|
+
(indexFlags & 2 /* NoIndexSignatures */ ? 128 /* StringLiteral */ : 402653316 /* StringLike */) | (indexFlags & 1 /* StringsOnly */ ? 0 : 296 /* NumberLike */ | 12288 /* ESSymbolLike */),
|
|
58834
|
+
indexFlags === defaultIndexFlags
|
|
58842
58835
|
);
|
|
58843
58836
|
}
|
|
58844
58837
|
function getExtractStringType(type) {
|
|
@@ -58963,19 +58956,8 @@ ${lanes.join("\n")}
|
|
|
58963
58956
|
)
|
|
58964
58957
|
);
|
|
58965
58958
|
}
|
|
58966
|
-
function getNoInferType(symbol, type) {
|
|
58967
|
-
if (!isGenericType(type)) {
|
|
58968
|
-
return type;
|
|
58969
|
-
}
|
|
58970
|
-
const id = `${getSymbolId(symbol)},${getTypeId(type)}`;
|
|
58971
|
-
let result = intrinsicWrapperTypes.get(id);
|
|
58972
|
-
if (!result) {
|
|
58973
|
-
intrinsicWrapperTypes.set(id, result = createNoInferType(symbol, type));
|
|
58974
|
-
}
|
|
58975
|
-
return result;
|
|
58976
|
-
}
|
|
58977
58959
|
function applyStringMapping(symbol, str) {
|
|
58978
|
-
switch (
|
|
58960
|
+
switch (intrinsicTypeKinds.get(symbol.escapedName)) {
|
|
58979
58961
|
case 0 /* Uppercase */:
|
|
58980
58962
|
return str.toUpperCase();
|
|
58981
58963
|
case 1 /* Lowercase */:
|
|
@@ -58988,7 +58970,7 @@ ${lanes.join("\n")}
|
|
|
58988
58970
|
return str;
|
|
58989
58971
|
}
|
|
58990
58972
|
function applyTemplateStringMapping(symbol, texts, types) {
|
|
58991
|
-
switch (
|
|
58973
|
+
switch (intrinsicTypeKinds.get(symbol.escapedName)) {
|
|
58992
58974
|
case 0 /* Uppercase */:
|
|
58993
58975
|
return [texts.map((t) => t.toUpperCase()), types.map((t) => getStringMappingType(symbol, t))];
|
|
58994
58976
|
case 1 /* Lowercase */:
|
|
@@ -59002,9 +58984,9 @@ ${lanes.join("\n")}
|
|
|
59002
58984
|
}
|
|
59003
58985
|
function getStringMappingTypeForGenericType(symbol, type) {
|
|
59004
58986
|
const id = `${getSymbolId(symbol)},${getTypeId(type)}`;
|
|
59005
|
-
let result =
|
|
58987
|
+
let result = stringMappingTypes.get(id);
|
|
59006
58988
|
if (!result) {
|
|
59007
|
-
|
|
58989
|
+
stringMappingTypes.set(id, result = createStringMappingType(symbol, type));
|
|
59008
58990
|
}
|
|
59009
58991
|
return result;
|
|
59010
58992
|
}
|
|
@@ -59013,11 +58995,6 @@ ${lanes.join("\n")}
|
|
|
59013
58995
|
result.type = type;
|
|
59014
58996
|
return result;
|
|
59015
58997
|
}
|
|
59016
|
-
function createNoInferType(symbol, type) {
|
|
59017
|
-
const result = createTypeWithSymbol(536870912 /* NoInfer */, symbol);
|
|
59018
|
-
result.type = type;
|
|
59019
|
-
return result;
|
|
59020
|
-
}
|
|
59021
58998
|
function createIndexedAccessType(objectType, indexType, accessFlags, aliasSymbol, aliasTypeArguments) {
|
|
59022
58999
|
const type = createType(8388608 /* IndexedAccess */);
|
|
59023
59000
|
type.objectType = objectType;
|
|
@@ -59040,7 +59017,7 @@ ${lanes.join("\n")}
|
|
|
59040
59017
|
if (type.flags & 2097152 /* Intersection */) {
|
|
59041
59018
|
return some(type.types, isJSLiteralType);
|
|
59042
59019
|
}
|
|
59043
|
-
if (type.flags &
|
|
59020
|
+
if (type.flags & 465829888 /* Instantiable */) {
|
|
59044
59021
|
const constraint = getResolvedBaseConstraint(type);
|
|
59045
59022
|
return constraint !== type && isJSLiteralType(constraint);
|
|
59046
59023
|
}
|
|
@@ -59292,7 +59269,7 @@ ${lanes.join("\n")}
|
|
|
59292
59269
|
}
|
|
59293
59270
|
return type.objectFlags & 12582912 /* IsGenericType */;
|
|
59294
59271
|
}
|
|
59295
|
-
return (type.flags &
|
|
59272
|
+
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
|
|
59296
59273
|
}
|
|
59297
59274
|
function getSimplifiedType(type, writing) {
|
|
59298
59275
|
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : type;
|
|
@@ -59321,7 +59298,7 @@ ${lanes.join("\n")}
|
|
|
59321
59298
|
if (distributedOverIndex) {
|
|
59322
59299
|
return type[cache] = distributedOverIndex;
|
|
59323
59300
|
}
|
|
59324
|
-
if (!(indexType.flags &
|
|
59301
|
+
if (!(indexType.flags & 465829888 /* Instantiable */)) {
|
|
59325
59302
|
const distributedOverObject = distributeIndexOverObjectType(objectType, indexType, writing);
|
|
59326
59303
|
if (distributedOverObject) {
|
|
59327
59304
|
return type[cache] = distributedOverObject;
|
|
@@ -59394,12 +59371,13 @@ ${lanes.join("\n")}
|
|
|
59394
59371
|
if (objectType === wildcardType || indexType === wildcardType) {
|
|
59395
59372
|
return wildcardType;
|
|
59396
59373
|
}
|
|
59374
|
+
objectType = getReducedType(objectType);
|
|
59397
59375
|
if (isStringIndexSignatureOnlyType(objectType) && !(indexType.flags & 98304 /* Nullable */) && isTypeAssignableToKind(indexType, 4 /* String */ | 8 /* Number */)) {
|
|
59398
59376
|
indexType = stringType;
|
|
59399
59377
|
}
|
|
59400
59378
|
if (compilerOptions.noUncheckedIndexedAccess && accessFlags & 32 /* ExpressionPosition */)
|
|
59401
59379
|
accessFlags |= 1 /* IncludeUndefined */;
|
|
59402
|
-
if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 197 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target.fixedLength) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, objectType.target.fixedLength)))) {
|
|
59380
|
+
if (isGenericIndexType(indexType) || (accessNode && accessNode.kind !== 197 /* IndexedAccessType */ ? isGenericTupleType(objectType) && !indexTypeLessThan(indexType, objectType.target.fixedLength) : isGenericObjectType(objectType) && !(isTupleType(objectType) && indexTypeLessThan(indexType, objectType.target.fixedLength)) || isGenericReducibleType(objectType))) {
|
|
59403
59381
|
if (objectType.flags & 3 /* AnyOrUnknown */) {
|
|
59404
59382
|
return objectType;
|
|
59405
59383
|
}
|
|
@@ -60372,7 +60350,7 @@ ${lanes.join("\n")}
|
|
|
60372
60350
|
const mappedTypeVariable = instantiateType(typeVariable, mapper);
|
|
60373
60351
|
if (typeVariable !== mappedTypeVariable) {
|
|
60374
60352
|
return mapTypeWithAlias(getReducedType(mappedTypeVariable), (t) => {
|
|
60375
|
-
if (t.flags & (3 /* AnyOrUnknown */ |
|
|
60353
|
+
if (t.flags & (3 /* AnyOrUnknown */ | 58982400 /* InstantiableNonPrimitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && t !== wildcardType && !isErrorType(t)) {
|
|
60376
60354
|
if (!type.declaration.nameType) {
|
|
60377
60355
|
let constraint;
|
|
60378
60356
|
if (isArrayType(t) || t.flags & 1 /* Any */ && findResolutionCycleStartIndex(typeVariable, 4 /* ImmediateBaseConstraint */) < 0 && (constraint = getConstraintOfTypeParameter(typeVariable)) && everyType(constraint, isArrayOrTupleType)) {
|
|
@@ -60537,9 +60515,6 @@ ${lanes.join("\n")}
|
|
|
60537
60515
|
if (flags & 268435456 /* StringMapping */) {
|
|
60538
60516
|
return getStringMappingType(type.symbol, instantiateType(type.type, mapper));
|
|
60539
60517
|
}
|
|
60540
|
-
if (flags & 536870912 /* NoInfer */) {
|
|
60541
|
-
return getNoInferType(type.symbol, instantiateType(type.type, mapper));
|
|
60542
|
-
}
|
|
60543
60518
|
if (flags & 8388608 /* IndexedAccess */) {
|
|
60544
60519
|
const newAliasSymbol = aliasSymbol || type.aliasSymbol;
|
|
60545
60520
|
const newAliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(type.aliasTypeArguments, mapper);
|
|
@@ -60588,9 +60563,6 @@ ${lanes.join("\n")}
|
|
|
60588
60563
|
}
|
|
60589
60564
|
return type;
|
|
60590
60565
|
}
|
|
60591
|
-
function getUniqueLiteralFilledInstantiation(type) {
|
|
60592
|
-
return type.flags & (402784252 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper));
|
|
60593
|
-
}
|
|
60594
60566
|
function getPermissiveInstantiation(type) {
|
|
60595
60567
|
return type.flags & (402784252 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type : type.permissiveInstantiation || (type.permissiveInstantiation = instantiateType(type, permissiveMapper));
|
|
60596
60568
|
}
|
|
@@ -60689,7 +60661,7 @@ ${lanes.join("\n")}
|
|
|
60689
60661
|
return isTypeRelatedTo(source, target, assignableRelation);
|
|
60690
60662
|
}
|
|
60691
60663
|
function isTypeDerivedFrom(source, target) {
|
|
60692
|
-
return source.flags & 1048576 /* Union */ ? every(source.types, (t) => isTypeDerivedFrom(t, target)) : target.flags & 1048576 /* Union */ ? some(target.types, (t) => isTypeDerivedFrom(source, t)) : source.flags & 2097152 /* Intersection */ ? some(source.types, (t) => isTypeDerivedFrom(t, target)) : source.flags &
|
|
60664
|
+
return source.flags & 1048576 /* Union */ ? every(source.types, (t) => isTypeDerivedFrom(t, target)) : target.flags & 1048576 /* Union */ ? some(target.types, (t) => isTypeDerivedFrom(source, t)) : source.flags & 2097152 /* Intersection */ ? some(source.types, (t) => isTypeDerivedFrom(t, target)) : source.flags & 58982400 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || unknownType, target) : isEmptyAnonymousObjectType(target) ? !!(source.flags & (524288 /* Object */ | 67108864 /* NonPrimitive */)) : target === globalObjectType ? !!(source.flags & (524288 /* Object */ | 67108864 /* NonPrimitive */)) && !isEmptyAnonymousObjectType(source) : target === globalFunctionType ? !!(source.flags & 524288 /* Object */) && isFunctionObjectType(source) : hasBaseType(source, getTargetType(target)) || isArrayType(target) && !isReadonlyArrayType(target) && isTypeDerivedFrom(source, globalReadonlyArrayType);
|
|
60693
60665
|
}
|
|
60694
60666
|
function isTypeComparableTo(source, target) {
|
|
60695
60667
|
return isTypeRelatedTo(source, target, comparableRelation);
|
|
@@ -61302,7 +61274,12 @@ ${lanes.join("\n")}
|
|
|
61302
61274
|
const paramCount = sourceRestType || targetRestType ? Math.min(sourceCount, targetCount) : Math.max(sourceCount, targetCount);
|
|
61303
61275
|
const restIndex = sourceRestType || targetRestType ? paramCount - 1 : -1;
|
|
61304
61276
|
for (let i = 0; i < paramCount; i++) {
|
|
61305
|
-
const sourceType = i === restIndex ? getRestTypeAtPosition(
|
|
61277
|
+
const sourceType = i === restIndex ? getRestTypeAtPosition(
|
|
61278
|
+
source,
|
|
61279
|
+
i,
|
|
61280
|
+
/*readonly*/
|
|
61281
|
+
true
|
|
61282
|
+
) : tryGetTypeAtPosition(source, i);
|
|
61306
61283
|
const targetType = i === restIndex ? getRestTypeAtPosition(target, i) : tryGetTypeAtPosition(target, i);
|
|
61307
61284
|
if (sourceType && targetType) {
|
|
61308
61285
|
const sourceSig = checkMode & 3 /* Callback */ ? void 0 : getSingleCallSignature(getNonNullableType(sourceType));
|
|
@@ -61552,7 +61529,7 @@ ${lanes.join("\n")}
|
|
|
61552
61529
|
return !!(related & 1 /* Succeeded */);
|
|
61553
61530
|
}
|
|
61554
61531
|
}
|
|
61555
|
-
if (source.flags &
|
|
61532
|
+
if (source.flags & 469499904 /* StructuredOrInstantiable */ || target.flags & 469499904 /* StructuredOrInstantiable */) {
|
|
61556
61533
|
return checkTypeRelatedTo(
|
|
61557
61534
|
source,
|
|
61558
61535
|
target,
|
|
@@ -61568,7 +61545,7 @@ ${lanes.join("\n")}
|
|
|
61568
61545
|
}
|
|
61569
61546
|
function getNormalizedType(type, writing) {
|
|
61570
61547
|
while (true) {
|
|
61571
|
-
const t = isFreshLiteralType(type) ? type.regularType : 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
|
|
61548
|
+
const t = isFreshLiteralType(type) ? type.regularType : 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;
|
|
61572
61549
|
if (t === type)
|
|
61573
61550
|
return t;
|
|
61574
61551
|
type = t;
|
|
@@ -61926,7 +61903,7 @@ ${lanes.join("\n")}
|
|
|
61926
61903
|
}
|
|
61927
61904
|
if (relation === comparableRelation && !(target2.flags & 131072 /* Never */) && isSimpleTypeRelatedTo(target2, source2, relation) || isSimpleTypeRelatedTo(source2, target2, relation, reportErrors2 ? reportError : void 0))
|
|
61928
61905
|
return -1 /* True */;
|
|
61929
|
-
if (source2.flags &
|
|
61906
|
+
if (source2.flags & 469499904 /* StructuredOrInstantiable */ || target2.flags & 469499904 /* StructuredOrInstantiable */) {
|
|
61930
61907
|
const isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType2(source2) && getObjectFlags(source2) & 8192 /* FreshLiteral */);
|
|
61931
61908
|
if (isPerformingExcessPropertyChecks) {
|
|
61932
61909
|
if (hasExcessProperties(source2, target2, reportErrors2)) {
|
|
@@ -61965,7 +61942,7 @@ ${lanes.join("\n")}
|
|
|
61965
61942
|
return 0 /* False */;
|
|
61966
61943
|
}
|
|
61967
61944
|
traceUnionsOrIntersectionsTooLarge(source2, target2);
|
|
61968
|
-
const skipCaching = source2.flags & 1048576 /* Union */ && source2.types.length < 4 && !(target2.flags & 1048576 /* Union */) || target2.flags & 1048576 /* Union */ && target2.types.length < 4 && !(source2.flags &
|
|
61945
|
+
const skipCaching = source2.flags & 1048576 /* Union */ && source2.types.length < 4 && !(target2.flags & 1048576 /* Union */) || target2.flags & 1048576 /* Union */ && target2.types.length < 4 && !(source2.flags & 469499904 /* StructuredOrInstantiable */);
|
|
61969
61946
|
const result2 = skipCaching ? unionOrIntersectionRelatedTo(source2, target2, reportErrors2, intersectionState) : recursiveTypeRelatedTo(source2, target2, reportErrors2, intersectionState, recursionFlags);
|
|
61970
61947
|
if (result2) {
|
|
61971
61948
|
return result2;
|
|
@@ -62153,7 +62130,7 @@ ${lanes.join("\n")}
|
|
|
62153
62130
|
return typeRelatedToEachType(source2, target2, reportErrors2, 2 /* Target */);
|
|
62154
62131
|
}
|
|
62155
62132
|
if (relation === comparableRelation && target2.flags & 402784252 /* Primitive */) {
|
|
62156
|
-
const constraints = sameMap(source2.types, (t) => t.flags &
|
|
62133
|
+
const constraints = sameMap(source2.types, (t) => t.flags & 465829888 /* Instantiable */ ? getBaseConstraintOfType(t) || unknownType : t);
|
|
62157
62134
|
if (constraints !== source2.types) {
|
|
62158
62135
|
source2 = getIntersectionType(constraints);
|
|
62159
62136
|
if (source2.flags & 131072 /* Never */) {
|
|
@@ -62704,7 +62681,7 @@ ${lanes.join("\n")}
|
|
|
62704
62681
|
if (result2 = unionOrIntersectionRelatedTo(source2, target2, reportErrors2, intersectionState)) {
|
|
62705
62682
|
return result2;
|
|
62706
62683
|
}
|
|
62707
|
-
if (!(sourceFlags &
|
|
62684
|
+
if (!(sourceFlags & 465829888 /* Instantiable */ || sourceFlags & 524288 /* Object */ && targetFlags & 1048576 /* Union */ || sourceFlags & 2097152 /* Intersection */ && targetFlags & (524288 /* Object */ | 1048576 /* Union */ | 465829888 /* Instantiable */))) {
|
|
62708
62685
|
return 0 /* False */;
|
|
62709
62686
|
}
|
|
62710
62687
|
}
|
|
@@ -62773,7 +62750,7 @@ ${lanes.join("\n")}
|
|
|
62773
62750
|
} else {
|
|
62774
62751
|
const constraint = getSimplifiedTypeOrConstraint(targetType);
|
|
62775
62752
|
if (constraint) {
|
|
62776
|
-
if (isRelatedTo(source2, getIndexType(constraint, target2.
|
|
62753
|
+
if (isRelatedTo(source2, getIndexType(constraint, target2.indexFlags | 4 /* NoReducibleCheck */), 2 /* Target */, reportErrors2) === -1 /* True */) {
|
|
62777
62754
|
return -1 /* True */;
|
|
62778
62755
|
}
|
|
62779
62756
|
} else if (isGenericMappedType(targetType)) {
|
|
@@ -62854,13 +62831,7 @@ ${lanes.join("\n")}
|
|
|
62854
62831
|
}
|
|
62855
62832
|
if (!isGenericMappedType(source2)) {
|
|
62856
62833
|
const targetKeys = keysRemapped ? getNameTypeFromMappedType(target2) : getConstraintTypeFromMappedType(target2);
|
|
62857
|
-
const sourceKeys = getIndexType(
|
|
62858
|
-
source2,
|
|
62859
|
-
/*stringsOnly*/
|
|
62860
|
-
void 0,
|
|
62861
|
-
/*noIndexSignatures*/
|
|
62862
|
-
true
|
|
62863
|
-
);
|
|
62834
|
+
const sourceKeys = getIndexType(source2, 2 /* NoIndexSignatures */);
|
|
62864
62835
|
const includeOptional = modifiers & 4 /* IncludeOptional */;
|
|
62865
62836
|
const filteredByApplicability = includeOptional ? intersectTypes(targetKeys, sourceKeys) : void 0;
|
|
62866
62837
|
if (includeOptional ? !(filteredByApplicability.flags & 131072 /* Never */) : isRelatedTo(targetKeys, sourceKeys, 3 /* Both */)) {
|
|
@@ -63895,7 +63866,7 @@ ${lanes.join("\n")}
|
|
|
63895
63866
|
if (type.flags & 3145728 /* UnionOrIntersection */) {
|
|
63896
63867
|
return !!forEach(type.types, typeCouldHaveTopLevelSingletonTypes);
|
|
63897
63868
|
}
|
|
63898
|
-
if (type.flags &
|
|
63869
|
+
if (type.flags & 465829888 /* Instantiable */) {
|
|
63899
63870
|
const constraint = getConstraintOfType(type);
|
|
63900
63871
|
if (constraint && constraint !== type) {
|
|
63901
63872
|
return typeCouldHaveTopLevelSingletonTypes(constraint);
|
|
@@ -64944,7 +64915,7 @@ ${lanes.join("\n")}
|
|
|
64944
64915
|
if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
|
|
64945
64916
|
return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
|
|
64946
64917
|
}
|
|
64947
|
-
const result = !!(type.flags &
|
|
64918
|
+
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || forEach(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
|
|
64948
64919
|
if (type.flags & 3899393 /* ObjectFlagsType */) {
|
|
64949
64920
|
type.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (result ? 1048576 /* CouldContainTypeVariables */ : 0);
|
|
64950
64921
|
}
|
|
@@ -65226,7 +65197,7 @@ ${lanes.join("\n")}
|
|
|
65226
65197
|
let expandingFlags = 0 /* None */;
|
|
65227
65198
|
inferFromTypes(originalSource, originalTarget);
|
|
65228
65199
|
function inferFromTypes(source, target) {
|
|
65229
|
-
if (!couldContainTypeVariables(target)
|
|
65200
|
+
if (!couldContainTypeVariables(target)) {
|
|
65230
65201
|
return;
|
|
65231
65202
|
}
|
|
65232
65203
|
if (source === wildcardType) {
|
|
@@ -65325,7 +65296,7 @@ ${lanes.join("\n")}
|
|
|
65325
65296
|
/*writing*/
|
|
65326
65297
|
false
|
|
65327
65298
|
);
|
|
65328
|
-
if (indexType.flags &
|
|
65299
|
+
if (indexType.flags & 465829888 /* Instantiable */) {
|
|
65329
65300
|
const simplified2 = distributeIndexOverObjectType(
|
|
65330
65301
|
getSimplifiedType(
|
|
65331
65302
|
target.objectType,
|
|
@@ -65372,7 +65343,7 @@ ${lanes.join("\n")}
|
|
|
65372
65343
|
inferToTemplateLiteralType(source, target);
|
|
65373
65344
|
} else {
|
|
65374
65345
|
source = getReducedType(source);
|
|
65375
|
-
if (!(priority & 512 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ |
|
|
65346
|
+
if (!(priority & 512 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */))) {
|
|
65376
65347
|
const apparentSource = getApparentType(source);
|
|
65377
65348
|
if (apparentSource !== source && allowComplexConstraintInference && !(apparentSource.flags & (524288 /* Object */ | 2097152 /* Intersection */))) {
|
|
65378
65349
|
allowComplexConstraintInference = false;
|
|
@@ -66124,7 +66095,7 @@ ${lanes.join("\n")}
|
|
|
66124
66095
|
const map2 = /* @__PURE__ */ new Map();
|
|
66125
66096
|
let count = 0;
|
|
66126
66097
|
for (const type of types) {
|
|
66127
|
-
if (type.flags & (524288 /* Object */ | 2097152 /* Intersection */ |
|
|
66098
|
+
if (type.flags & (524288 /* Object */ | 2097152 /* Intersection */ | 58982400 /* InstantiableNonPrimitive */)) {
|
|
66128
66099
|
const discriminant = getTypeOfPropertyOfType(type, name);
|
|
66129
66100
|
if (discriminant) {
|
|
66130
66101
|
if (!isLiteralType(discriminant)) {
|
|
@@ -66150,11 +66121,11 @@ ${lanes.join("\n")}
|
|
|
66150
66121
|
}
|
|
66151
66122
|
function getKeyPropertyName(unionType) {
|
|
66152
66123
|
const types = unionType.types;
|
|
66153
|
-
if (types.length < 10 || getObjectFlags(unionType) & 32768 /* PrimitiveUnion */ || countWhere(types, (t) => !!(t.flags & (524288 /* Object */ |
|
|
66124
|
+
if (types.length < 10 || getObjectFlags(unionType) & 32768 /* PrimitiveUnion */ || countWhere(types, (t) => !!(t.flags & (524288 /* Object */ | 58982400 /* InstantiableNonPrimitive */))) < 10) {
|
|
66154
66125
|
return void 0;
|
|
66155
66126
|
}
|
|
66156
66127
|
if (unionType.keyPropertyName === void 0) {
|
|
66157
|
-
const keyPropertyName = forEach(types, (t) => t.flags & (524288 /* Object */ |
|
|
66128
|
+
const keyPropertyName = forEach(types, (t) => t.flags & (524288 /* Object */ | 58982400 /* InstantiableNonPrimitive */) ? forEach(getPropertiesOfType(t), (p) => isUnitType(getTypeOfSymbol(p)) ? p.escapedName : void 0) : void 0);
|
|
66158
66129
|
const mapByKeyProperty = keyPropertyName && mapTypesByKeyProperty(types, keyPropertyName);
|
|
66159
66130
|
unionType.keyPropertyName = mapByKeyProperty ? keyPropertyName : "";
|
|
66160
66131
|
unionType.constituentMap = mapByKeyProperty;
|
|
@@ -66232,7 +66203,7 @@ ${lanes.join("\n")}
|
|
|
66232
66203
|
return !!(resolved.callSignatures.length || resolved.constructSignatures.length || resolved.members.get("bind") && isTypeSubtypeOf(type, globalFunctionType));
|
|
66233
66204
|
}
|
|
66234
66205
|
function getTypeFacts(type) {
|
|
66235
|
-
if (type.flags & (2097152 /* Intersection */ |
|
|
66206
|
+
if (type.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */)) {
|
|
66236
66207
|
type = getBaseConstraintOfType(type) || unknownType;
|
|
66237
66208
|
}
|
|
66238
66209
|
const flags = type.flags;
|
|
@@ -67777,7 +67748,7 @@ ${lanes.join("\n")}
|
|
|
67777
67748
|
const discriminant = keyPropertyName && getTypeOfPropertyOfType(c, keyPropertyName);
|
|
67778
67749
|
const matching = discriminant && getConstituentTypeForKeyType(type, discriminant);
|
|
67779
67750
|
const directlyRelated = mapType(matching || type, checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeStrictSubtypeOf(t, c) ? t : isTypeStrictSubtypeOf(c, t) ? c : isTypeSubtypeOf(t, c) ? t : isTypeSubtypeOf(c, t) ? c : neverType);
|
|
67780
|
-
return directlyRelated.flags & 131072 /* Never */ ? mapType(type, (t) => maybeTypeOfKind(t,
|
|
67751
|
+
return directlyRelated.flags & 131072 /* Never */ ? mapType(type, (t) => maybeTypeOfKind(t, 465829888 /* Instantiable */) && isRelated(c, getBaseConstraintOfType(t) || unknownType) ? getIntersectionType([t, c]) : neverType) : directlyRelated;
|
|
67781
67752
|
});
|
|
67782
67753
|
return !(narrowedType.flags & 131072 /* Never */) ? narrowedType : isTypeSubtypeOf(candidate, type) ? candidate : isTypeAssignableTo(type, candidate) ? type : isTypeAssignableTo(candidate, type) ? candidate : getIntersectionType([type, candidate]);
|
|
67783
67754
|
}
|
|
@@ -67957,10 +67928,10 @@ ${lanes.join("\n")}
|
|
|
67957
67928
|
return parent2.kind === 209 /* PropertyAccessExpression */ || parent2.kind === 164 /* QualifiedName */ || parent2.kind === 211 /* CallExpression */ && parent2.expression === node || parent2.kind === 210 /* ElementAccessExpression */ && parent2.expression === node && !(someType(type, isGenericTypeWithoutNullableConstraint) && isGenericIndexType(getTypeOfExpression(parent2.argumentExpression)));
|
|
67958
67929
|
}
|
|
67959
67930
|
function isGenericTypeWithUnionConstraint(type) {
|
|
67960
|
-
return type.flags & 2097152 /* Intersection */ ? some(type.types, isGenericTypeWithUnionConstraint) : !!(type.flags &
|
|
67931
|
+
return type.flags & 2097152 /* Intersection */ ? some(type.types, isGenericTypeWithUnionConstraint) : !!(type.flags & 465829888 /* Instantiable */ && getBaseConstraintOrType(type).flags & (98304 /* Nullable */ | 1048576 /* Union */));
|
|
67961
67932
|
}
|
|
67962
67933
|
function isGenericTypeWithoutNullableConstraint(type) {
|
|
67963
|
-
return type.flags & 2097152 /* Intersection */ ? some(type.types, isGenericTypeWithoutNullableConstraint) : !!(type.flags &
|
|
67934
|
+
return type.flags & 2097152 /* Intersection */ ? some(type.types, isGenericTypeWithoutNullableConstraint) : !!(type.flags & 465829888 /* Instantiable */ && !maybeTypeOfKind(getBaseConstraintOrType(type), 98304 /* Nullable */));
|
|
67964
67935
|
}
|
|
67965
67936
|
function hasContextualTypeWithNoGenericTypes(node, checkMode) {
|
|
67966
67937
|
const contextualType = (isIdentifier(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node)) && !((isJsxOpeningElement(node.parent) || isJsxSelfClosingElement(node.parent)) && node.parent.tagName === node) && (checkMode && checkMode & 64 /* RestBindingElement */ ? getContextualType2(node, 8 /* SkipBindingPatterns */) : getContextualType2(
|
|
@@ -69268,7 +69239,7 @@ ${lanes.join("\n")}
|
|
|
69268
69239
|
}
|
|
69269
69240
|
}
|
|
69270
69241
|
function instantiateContextualType(contextualType, node, contextFlags) {
|
|
69271
|
-
if (contextualType && maybeTypeOfKind(contextualType,
|
|
69242
|
+
if (contextualType && maybeTypeOfKind(contextualType, 465829888 /* Instantiable */)) {
|
|
69272
69243
|
const inferenceContext = getInferenceContext(node);
|
|
69273
69244
|
if (inferenceContext && contextFlags & 1 /* Signature */ && some(inferenceContext.inferences, hasInferenceCandidatesOrDefault)) {
|
|
69274
69245
|
return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
|
|
@@ -69281,7 +69252,7 @@ ${lanes.join("\n")}
|
|
|
69281
69252
|
return contextualType;
|
|
69282
69253
|
}
|
|
69283
69254
|
function instantiateInstantiableTypes(type, mapper) {
|
|
69284
|
-
if (type.flags &
|
|
69255
|
+
if (type.flags & 465829888 /* Instantiable */) {
|
|
69285
69256
|
return instantiateType(type, mapper);
|
|
69286
69257
|
}
|
|
69287
69258
|
if (type.flags & 1048576 /* Union */) {
|
|
@@ -70055,7 +70026,7 @@ ${lanes.join("\n")}
|
|
|
70055
70026
|
}
|
|
70056
70027
|
function isValidSpreadType(type) {
|
|
70057
70028
|
const t = removeDefinitelyFalsyTypes(mapType(type, getBaseConstraintOrType));
|
|
70058
|
-
return !!(t.flags & (1 /* Any */ | 67108864 /* NonPrimitive */ | 524288 /* Object */ |
|
|
70029
|
+
return !!(t.flags & (1 /* Any */ | 67108864 /* NonPrimitive */ | 524288 /* Object */ | 58982400 /* InstantiableNonPrimitive */) || t.flags & 3145728 /* UnionOrIntersection */ && every(t.types, isValidSpreadType));
|
|
70059
70030
|
}
|
|
70060
70031
|
function checkJsxSelfClosingElementDeferred(node) {
|
|
70061
70032
|
checkJsxOpeningLikeElementOrOpeningFragment(node);
|
|
@@ -73609,7 +73580,7 @@ ${lanes.join("\n")}
|
|
|
73609
73580
|
result3.node = node;
|
|
73610
73581
|
return result3;
|
|
73611
73582
|
}
|
|
73612
|
-
} else if (type2.flags &
|
|
73583
|
+
} else if (type2.flags & 58982400 /* InstantiableNonPrimitive */) {
|
|
73613
73584
|
const constraint = getBaseConstraintOfType(type2);
|
|
73614
73585
|
if (constraint) {
|
|
73615
73586
|
const instantiated = getInstantiatedTypePart(constraint);
|
|
@@ -73793,12 +73764,12 @@ ${lanes.join("\n")}
|
|
|
73793
73764
|
}
|
|
73794
73765
|
return void 0;
|
|
73795
73766
|
}
|
|
73796
|
-
function getRestTypeAtPosition(source, pos) {
|
|
73767
|
+
function getRestTypeAtPosition(source, pos, readonly = false) {
|
|
73797
73768
|
const parameterCount = getParameterCount(source);
|
|
73798
73769
|
const minArgumentCount = getMinArgumentCount(source);
|
|
73799
73770
|
const restType = getEffectiveRestType(source);
|
|
73800
73771
|
if (restType && pos >= parameterCount - 1) {
|
|
73801
|
-
return pos === parameterCount - 1 ? restType : createArrayType(getIndexedAccessType(restType, numberType));
|
|
73772
|
+
return pos === parameterCount - 1 ? restType : createArrayType(getIndexedAccessType(restType, numberType), readonly);
|
|
73802
73773
|
}
|
|
73803
73774
|
const types = [];
|
|
73804
73775
|
const flags = [];
|
|
@@ -73816,13 +73787,7 @@ ${lanes.join("\n")}
|
|
|
73816
73787
|
names.push(name);
|
|
73817
73788
|
}
|
|
73818
73789
|
}
|
|
73819
|
-
return createTupleType(
|
|
73820
|
-
types,
|
|
73821
|
-
flags,
|
|
73822
|
-
/*readonly*/
|
|
73823
|
-
false,
|
|
73824
|
-
length(names) === length(types) ? names : void 0
|
|
73825
|
-
);
|
|
73790
|
+
return createTupleType(types, flags, readonly, length(names) === length(types) ? names : void 0);
|
|
73826
73791
|
}
|
|
73827
73792
|
function getParameterCount(signature) {
|
|
73828
73793
|
const length2 = signature.parameters.length;
|
|
@@ -75882,7 +75847,7 @@ ${lanes.join("\n")}
|
|
|
75882
75847
|
) || unknownType, isTemplateLiteralContextualType) ? getTemplateLiteralType(texts, types) : stringType;
|
|
75883
75848
|
}
|
|
75884
75849
|
function isTemplateLiteralContextualType(type) {
|
|
75885
|
-
return !!(type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */) || type.flags &
|
|
75850
|
+
return !!(type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */) || type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 402653316 /* StringLike */));
|
|
75886
75851
|
}
|
|
75887
75852
|
function getContextNode2(node) {
|
|
75888
75853
|
if (isJsxAttributes(node) && !isJsxSelfClosingElement(node.parent)) {
|
|
@@ -75995,7 +75960,7 @@ ${lanes.join("\n")}
|
|
|
75995
75960
|
const types = contextualType.types;
|
|
75996
75961
|
return some(types, (t) => isLiteralOfContextualType(candidateType, t));
|
|
75997
75962
|
}
|
|
75998
|
-
if (contextualType.flags &
|
|
75963
|
+
if (contextualType.flags & 58982400 /* InstantiableNonPrimitive */) {
|
|
75999
75964
|
const constraint = getBaseConstraintOfType(contextualType) || unknownType;
|
|
76000
75965
|
return maybeTypeOfKind(constraint, 4 /* String */) && maybeTypeOfKind(candidateType, 128 /* StringLiteral */) || maybeTypeOfKind(constraint, 8 /* Number */) && maybeTypeOfKind(candidateType, 256 /* NumberLiteral */) || maybeTypeOfKind(constraint, 64 /* BigInt */) && maybeTypeOfKind(candidateType, 2048 /* BigIntLiteral */) || maybeTypeOfKind(constraint, 4096 /* ESSymbol */) && maybeTypeOfKind(candidateType, 8192 /* UniqueESSymbol */) || isLiteralOfContextualType(candidateType, constraint);
|
|
76001
75966
|
}
|
|
@@ -77100,11 +77065,7 @@ ${lanes.join("\n")}
|
|
|
77100
77065
|
}
|
|
77101
77066
|
const objectType = type.objectType;
|
|
77102
77067
|
const indexType = type.indexType;
|
|
77103
|
-
if (isTypeAssignableTo(indexType, getIndexType(
|
|
77104
|
-
objectType,
|
|
77105
|
-
/*stringsOnly*/
|
|
77106
|
-
false
|
|
77107
|
-
))) {
|
|
77068
|
+
if (isTypeAssignableTo(indexType, getIndexType(objectType, 0 /* None */))) {
|
|
77108
77069
|
if (accessNode.kind === 210 /* ElementAccessExpression */ && isAssignmentTarget(accessNode) && getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) {
|
|
77109
77070
|
error(accessNode, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType));
|
|
77110
77071
|
}
|
|
@@ -79053,7 +79014,7 @@ ${lanes.join("\n")}
|
|
|
79053
79014
|
);
|
|
79054
79015
|
}
|
|
79055
79016
|
}
|
|
79056
|
-
if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 /* NonPrimitive */ |
|
|
79017
|
+
if (rightType === neverType || !isTypeAssignableToKind(rightType, 67108864 /* NonPrimitive */ | 58982400 /* InstantiableNonPrimitive */)) {
|
|
79057
79018
|
error(node.expression, Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0, typeToString(rightType));
|
|
79058
79019
|
}
|
|
79059
79020
|
checkSourceElement(node.statement);
|
|
@@ -80730,7 +80691,7 @@ ${lanes.join("\n")}
|
|
|
80730
80691
|
checkExportsOnMergedDeclarations(node);
|
|
80731
80692
|
checkTypeParameters(node.typeParameters);
|
|
80732
80693
|
if (node.type.kind === 140 /* IntrinsicKeyword */) {
|
|
80733
|
-
if (!
|
|
80694
|
+
if (!intrinsicTypeKinds.has(node.name.escapedText) || length(node.typeParameters) !== 1) {
|
|
80734
80695
|
error(node.type, Diagnostics.The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types);
|
|
80735
80696
|
}
|
|
80736
80697
|
} else {
|
|
@@ -83924,7 +83885,8 @@ ${lanes.join("\n")}
|
|
|
83924
83885
|
return grammarErrorOnNode(modifier, Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration);
|
|
83925
83886
|
}
|
|
83926
83887
|
if (!(node.parent.kind === 261 /* ClassDeclaration */ && hasSyntacticModifier(node.parent, 256 /* Abstract */))) {
|
|
83927
|
-
|
|
83888
|
+
const message = node.kind === 170 /* PropertyDeclaration */ ? Diagnostics.Abstract_properties_can_only_appear_within_an_abstract_class : Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class;
|
|
83889
|
+
return grammarErrorOnNode(modifier, message);
|
|
83928
83890
|
}
|
|
83929
83891
|
if (flags & 32 /* Static */) {
|
|
83930
83892
|
return grammarErrorOnNode(modifier, Diagnostics._0_modifier_cannot_be_used_with_1_modifier, "static", "abstract");
|
|
@@ -85235,7 +85197,7 @@ ${lanes.join("\n")}
|
|
|
85235
85197
|
readFile: host.readFile ? (fileName) => host.readFile(fileName) : void 0
|
|
85236
85198
|
};
|
|
85237
85199
|
}
|
|
85238
|
-
var ambientModuleSymbolRegex, anon, nextSymbolId, nextNodeId, nextMergeId, nextFlowId, TypeFacts, typeofNEFacts, CheckMode, SignatureCheckMode, isNotOverloadAndNotAccessor,
|
|
85200
|
+
var ambientModuleSymbolRegex, anon, nextSymbolId, nextNodeId, nextMergeId, nextFlowId, TypeFacts, typeofNEFacts, CheckMode, SignatureCheckMode, isNotOverloadAndNotAccessor, intrinsicTypeKinds, SymbolLinks, JsxNames, SymbolTrackerImpl;
|
|
85239
85201
|
var init_checker = __esm({
|
|
85240
85202
|
"src/compiler/checker.ts"() {
|
|
85241
85203
|
"use strict";
|
|
@@ -85359,7 +85321,7 @@ ${lanes.join("\n")}
|
|
|
85359
85321
|
return SignatureCheckMode3;
|
|
85360
85322
|
})(SignatureCheckMode || {});
|
|
85361
85323
|
isNotOverloadAndNotAccessor = and(isNotOverload, isNotAccessor);
|
|
85362
|
-
|
|
85324
|
+
intrinsicTypeKinds = new Map(Object.entries({
|
|
85363
85325
|
Uppercase: 0 /* Uppercase */,
|
|
85364
85326
|
Lowercase: 1 /* Lowercase */,
|
|
85365
85327
|
Capitalize: 2 /* Capitalize */,
|
|
@@ -131958,6 +131920,9 @@ ${lanes.join("\n")}
|
|
|
131958
131920
|
}
|
|
131959
131921
|
}
|
|
131960
131922
|
for (const option of transpileOptionValueCompilerOptions) {
|
|
131923
|
+
if (options.verbatimModuleSyntax && optionsRedundantWithVerbatimModuleSyntax.has(option.name)) {
|
|
131924
|
+
continue;
|
|
131925
|
+
}
|
|
131961
131926
|
options[option.name] = option.transpileOptionValue;
|
|
131962
131927
|
}
|
|
131963
131928
|
options.suppressOutputPathCheck = true;
|
|
@@ -132061,11 +132026,16 @@ ${lanes.join("\n")}
|
|
|
132061
132026
|
}
|
|
132062
132027
|
return options;
|
|
132063
132028
|
}
|
|
132064
|
-
var commandLineOptionsStringToEnum;
|
|
132029
|
+
var optionsRedundantWithVerbatimModuleSyntax, commandLineOptionsStringToEnum;
|
|
132065
132030
|
var init_transpile = __esm({
|
|
132066
132031
|
"src/services/transpile.ts"() {
|
|
132067
132032
|
"use strict";
|
|
132068
132033
|
init_ts4();
|
|
132034
|
+
optionsRedundantWithVerbatimModuleSyntax = /* @__PURE__ */ new Set([
|
|
132035
|
+
"isolatedModules",
|
|
132036
|
+
"preserveValueImports",
|
|
132037
|
+
"importsNotUsedAsValues"
|
|
132038
|
+
]);
|
|
132069
132039
|
}
|
|
132070
132040
|
});
|
|
132071
132041
|
|
|
@@ -178713,6 +178683,7 @@ ${e.message}`;
|
|
|
178713
178683
|
ImportKind: () => ImportKind,
|
|
178714
178684
|
ImportsNotUsedAsValues: () => ImportsNotUsedAsValues,
|
|
178715
178685
|
IndentStyle: () => IndentStyle,
|
|
178686
|
+
IndexFlags: () => IndexFlags,
|
|
178716
178687
|
IndexKind: () => IndexKind,
|
|
178717
178688
|
InferenceFlags: () => InferenceFlags,
|
|
178718
178689
|
InferencePriority: () => InferencePriority,
|
|
@@ -181069,6 +181040,7 @@ ${e.message}`;
|
|
|
181069
181040
|
ImportKind: () => ImportKind,
|
|
181070
181041
|
ImportsNotUsedAsValues: () => ImportsNotUsedAsValues,
|
|
181071
181042
|
IndentStyle: () => IndentStyle,
|
|
181043
|
+
IndexFlags: () => IndexFlags,
|
|
181072
181044
|
IndexKind: () => IndexKind,
|
|
181073
181045
|
InferenceFlags: () => InferenceFlags,
|
|
181074
181046
|
InferencePriority: () => InferencePriority,
|