@typescript-deploys/pr-build 5.2.0-pr-55052-3 → 5.2.0-pr-55028-5
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 +40 -105
- package/lib/tsserver.js +45 -103
- package/lib/tsserverlibrary.d.ts +1 -1
- package/lib/tsserverlibrary.js +45 -103
- package/lib/typescript.d.ts +1 -1
- package/lib/typescript.js +45 -103
- package/lib/typingsInstaller.js +3 -6
- package/package.json +2 -2
package/lib/typescript.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.2";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20230720`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -4576,7 +4576,8 @@ ${lanes.join("\n")}
|
|
|
4576
4576
|
SignatureFlags5[SignatureFlags5["IsOuterCallChain"] = 16] = "IsOuterCallChain";
|
|
4577
4577
|
SignatureFlags5[SignatureFlags5["IsUntypedSignatureInJSFile"] = 32] = "IsUntypedSignatureInJSFile";
|
|
4578
4578
|
SignatureFlags5[SignatureFlags5["IsNonInferrable"] = 64] = "IsNonInferrable";
|
|
4579
|
-
SignatureFlags5[SignatureFlags5["
|
|
4579
|
+
SignatureFlags5[SignatureFlags5["IsSignatureCandidateForOverloadFailure"] = 128] = "IsSignatureCandidateForOverloadFailure";
|
|
4580
|
+
SignatureFlags5[SignatureFlags5["PropagatingFlags"] = 167] = "PropagatingFlags";
|
|
4580
4581
|
SignatureFlags5[SignatureFlags5["CallChainFlags"] = 24] = "CallChainFlags";
|
|
4581
4582
|
return SignatureFlags5;
|
|
4582
4583
|
})(SignatureFlags || {});
|
|
@@ -7972,9 +7973,6 @@ ${lanes.join("\n")}
|
|
|
7972
7973
|
await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(2852, 1 /* Error */, "await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_2852", "'await using' statements are only allowed within async functions and at the top levels of modules."),
|
|
7973
7974
|
await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(2853, 1 /* Error */, "await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_th_2853", "'await using' statements are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
|
|
7974
7975
|
Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(2854, 1 /* Error */, "Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_sys_2854", "Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
|
|
7975
|
-
The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_hand_side_s_Symbol_hasInstance_method: diag(2855, 1 /* Error */, "The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_2855", "The left-hand side of an 'instanceof' expression must be assignable to the first argument of the right-hand side's '[Symbol.hasInstance]' method."),
|
|
7976
|
-
An_object_s_Symbol_hasInstance_method_must_return_a_boolean_value_for_it_to_be_used_on_the_right_hand_side_of_an_instanceof_expression: diag(2856, 1 /* Error */, "An_object_s_Symbol_hasInstance_method_must_return_a_boolean_value_for_it_to_be_used_on_the_right_han_2856", "An object's '[Symbol.hasInstance]' method must return a boolean value for it to be used on the right-hand side of an 'instanceof' expression."),
|
|
7977
|
-
The_right_hand_side_of_an_instanceof_expression_must_be_either_of_type_any_an_object_type_with_a_Symbol_hasInstance_method_or_a_type_assignable_to_the_Function_interface_type: diag(2857, 1 /* Error */, "The_right_hand_side_of_an_instanceof_expression_must_be_either_of_type_any_an_object_type_with_a_Sym_2857", "The right-hand side of an 'instanceof' expression must be either of type 'any', an object type with a '[Symbol.hasInstance]()' method, or a type assignable to the 'Function' interface type."),
|
|
7978
7976
|
Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
7979
7977
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
|
7980
7978
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
|
@@ -12455,7 +12453,6 @@ ${lanes.join("\n")}
|
|
|
12455
12453
|
case 236 /* MetaProperty */:
|
|
12456
12454
|
case 102 /* ImportKeyword */:
|
|
12457
12455
|
case 282 /* MissingDeclaration */:
|
|
12458
|
-
case 237 /* SyntheticExpression */:
|
|
12459
12456
|
return true;
|
|
12460
12457
|
default:
|
|
12461
12458
|
return false;
|
|
@@ -46341,7 +46338,6 @@ ${lanes.join("\n")}
|
|
|
46341
46338
|
var potentialReflectCollisions = [];
|
|
46342
46339
|
var potentialUnusedRenamedBindingElementsInTypes = [];
|
|
46343
46340
|
var awaitedTypeStack = [];
|
|
46344
|
-
var hasGlobalSymbolHasInstanceProperty;
|
|
46345
46341
|
var diagnostics = createDiagnosticCollection();
|
|
46346
46342
|
var suggestionDiagnostics = createDiagnosticCollection();
|
|
46347
46343
|
var typeofType = createTypeofType();
|
|
@@ -46853,7 +46849,7 @@ ${lanes.join("\n")}
|
|
|
46853
46849
|
false
|
|
46854
46850
|
);
|
|
46855
46851
|
} else if (isParameterPropertyDeclaration(declaration, declaration.parent)) {
|
|
46856
|
-
return !(
|
|
46852
|
+
return !(useDefineForClassFields && getContainingClass(declaration) === getContainingClass(usage) && isUsedInFunctionOrInstanceProperty(usage, declaration));
|
|
46857
46853
|
}
|
|
46858
46854
|
return true;
|
|
46859
46855
|
}
|
|
@@ -46867,7 +46863,7 @@ ${lanes.join("\n")}
|
|
|
46867
46863
|
return true;
|
|
46868
46864
|
}
|
|
46869
46865
|
if (isUsedInFunctionOrInstanceProperty(usage, declaration)) {
|
|
46870
|
-
if (
|
|
46866
|
+
if (useDefineForClassFields && getContainingClass(declaration) && (isPropertyDeclaration(declaration) || isParameterPropertyDeclaration(declaration, declaration.parent))) {
|
|
46871
46867
|
return !isPropertyImmediatelyReferencedWithinDeclaration(
|
|
46872
46868
|
declaration,
|
|
46873
46869
|
usage,
|
|
@@ -46991,7 +46987,7 @@ ${lanes.join("\n")}
|
|
|
46991
46987
|
return requiresScopeChangeWorker(node.name);
|
|
46992
46988
|
case 172 /* PropertyDeclaration */:
|
|
46993
46989
|
if (hasStaticModifier(node)) {
|
|
46994
|
-
return
|
|
46990
|
+
return !useDefineForClassFields;
|
|
46995
46991
|
}
|
|
46996
46992
|
return requiresScopeChangeWorker(node.name);
|
|
46997
46993
|
default:
|
|
@@ -47030,7 +47026,7 @@ ${lanes.join("\n")}
|
|
|
47030
47026
|
if (name === "const" && isConstAssertion(location)) {
|
|
47031
47027
|
return void 0;
|
|
47032
47028
|
}
|
|
47033
|
-
if (
|
|
47029
|
+
if (isModuleOrEnumDeclaration(location) && lastLocation && location.name === lastLocation) {
|
|
47034
47030
|
lastLocation = location;
|
|
47035
47031
|
location = location.parent;
|
|
47036
47032
|
}
|
|
@@ -47262,7 +47258,7 @@ ${lanes.join("\n")}
|
|
|
47262
47258
|
}
|
|
47263
47259
|
}
|
|
47264
47260
|
function checkAndReportErrorForInvalidInitializer() {
|
|
47265
|
-
if (propertyWithInvalidInitializer && !
|
|
47261
|
+
if (propertyWithInvalidInitializer && !useDefineForClassFields) {
|
|
47266
47262
|
error2(
|
|
47267
47263
|
errorLocation,
|
|
47268
47264
|
errorLocation && propertyWithInvalidInitializer.type && textRangeContainsPositionInclusive(propertyWithInvalidInitializer.type, errorLocation.pos) ? Diagnostics.Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor : Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor,
|
|
@@ -54052,7 +54048,7 @@ ${lanes.join("\n")}
|
|
|
54052
54048
|
false,
|
|
54053
54049
|
definedInMethod && !definedInConstructor
|
|
54054
54050
|
));
|
|
54055
|
-
if (symbol.valueDeclaration && filterType(widened, (t) => !!(t.flags & ~98304 /* Nullable */)) === neverType) {
|
|
54051
|
+
if (symbol.valueDeclaration && isInJSFile(symbol.valueDeclaration) && filterType(widened, (t) => !!(t.flags & ~98304 /* Nullable */)) === neverType) {
|
|
54056
54052
|
reportImplicitAny(symbol.valueDeclaration, anyType);
|
|
54057
54053
|
return anyType;
|
|
54058
54054
|
}
|
|
@@ -55412,6 +55408,7 @@ ${lanes.join("\n")}
|
|
|
55412
55408
|
return links.resolvedSymbol;
|
|
55413
55409
|
}
|
|
55414
55410
|
function getResolvedMembersOrExportsOfSymbol(symbol, resolutionKind) {
|
|
55411
|
+
var _a, _b, _c;
|
|
55415
55412
|
const links = getSymbolLinks(symbol);
|
|
55416
55413
|
if (!links[resolutionKind]) {
|
|
55417
55414
|
const isStatic2 = resolutionKind === "resolvedExports" /* resolvedExports */;
|
|
@@ -55430,7 +55427,7 @@ ${lanes.join("\n")}
|
|
|
55430
55427
|
}
|
|
55431
55428
|
}
|
|
55432
55429
|
}
|
|
55433
|
-
const assignments = symbol.assignmentDeclarationMembers;
|
|
55430
|
+
const assignments = (((_a = symbol.valueDeclaration) == null ? void 0 : _a.kind) === 219 /* ArrowFunction */ || ((_b = symbol.valueDeclaration) == null ? void 0 : _b.kind) === 218 /* FunctionExpression */) && ((_c = getSymbolOfNode(symbol.valueDeclaration.parent)) == null ? void 0 : _c.assignmentDeclarationMembers) || symbol.assignmentDeclarationMembers;
|
|
55434
55431
|
if (assignments) {
|
|
55435
55432
|
const decls = arrayFrom(assignments.values());
|
|
55436
55433
|
for (const member of decls) {
|
|
@@ -55559,7 +55556,7 @@ ${lanes.join("\n")}
|
|
|
55559
55556
|
/*resolvedTypePredicate*/
|
|
55560
55557
|
void 0,
|
|
55561
55558
|
sig.minArgumentCount,
|
|
55562
|
-
sig.flags &
|
|
55559
|
+
sig.flags & 167 /* PropagatingFlags */
|
|
55563
55560
|
);
|
|
55564
55561
|
result.target = sig.target;
|
|
55565
55562
|
result.mapper = sig.mapper;
|
|
@@ -55860,7 +55857,7 @@ ${lanes.join("\n")}
|
|
|
55860
55857
|
/*resolvedTypePredicate*/
|
|
55861
55858
|
void 0,
|
|
55862
55859
|
minArgCount,
|
|
55863
|
-
(left.flags | right.flags) &
|
|
55860
|
+
(left.flags | right.flags) & 167 /* PropagatingFlags */
|
|
55864
55861
|
);
|
|
55865
55862
|
result.compositeKind = 1048576 /* Union */;
|
|
55866
55863
|
result.compositeSignatures = concatenate(left.compositeKind !== 2097152 /* Intersection */ && left.compositeSignatures || [left], [right]);
|
|
@@ -56070,7 +56067,7 @@ ${lanes.join("\n")}
|
|
|
56070
56067
|
/*resolvedTypePredicate*/
|
|
56071
56068
|
void 0,
|
|
56072
56069
|
sig.minArgumentCount,
|
|
56073
|
-
sig.flags &
|
|
56070
|
+
sig.flags & 167 /* PropagatingFlags */
|
|
56074
56071
|
) : void 0
|
|
56075
56072
|
));
|
|
56076
56073
|
}
|
|
@@ -60853,7 +60850,7 @@ ${lanes.join("\n")}
|
|
|
60853
60850
|
/*resolvedTypePredicate*/
|
|
60854
60851
|
void 0,
|
|
60855
60852
|
signature.minArgumentCount,
|
|
60856
|
-
signature.flags &
|
|
60853
|
+
signature.flags & 167 /* PropagatingFlags */
|
|
60857
60854
|
);
|
|
60858
60855
|
result.target = signature;
|
|
60859
60856
|
result.mapper = mapper;
|
|
@@ -68114,12 +68111,15 @@ ${lanes.join("\n")}
|
|
|
68114
68111
|
return narrowTypeByPrivateIdentifierInInExpression(type, expr, assumeTrue);
|
|
68115
68112
|
}
|
|
68116
68113
|
const target = getReferenceCandidate(expr.right);
|
|
68117
|
-
|
|
68118
|
-
|
|
68119
|
-
if (
|
|
68114
|
+
if (containsMissingType(type) && isAccessExpression(reference) && isMatchingReference(reference.expression, target)) {
|
|
68115
|
+
const leftType = getTypeOfExpression(expr.left);
|
|
68116
|
+
if (isTypeUsableAsPropertyName(leftType) && getAccessedPropertyName(reference) === getPropertyNameFromType(leftType)) {
|
|
68120
68117
|
return getTypeWithFacts(type, assumeTrue ? 524288 /* NEUndefined */ : 65536 /* EQUndefined */);
|
|
68121
68118
|
}
|
|
68122
|
-
|
|
68119
|
+
}
|
|
68120
|
+
if (isMatchingReference(reference, target)) {
|
|
68121
|
+
const leftType = getTypeOfExpression(expr.left);
|
|
68122
|
+
if (isTypeUsableAsPropertyName(leftType)) {
|
|
68123
68123
|
return narrowTypeByInKeyword(type, leftType, assumeTrue);
|
|
68124
68124
|
}
|
|
68125
68125
|
}
|
|
@@ -68384,15 +68384,6 @@ ${lanes.join("\n")}
|
|
|
68384
68384
|
return type;
|
|
68385
68385
|
}
|
|
68386
68386
|
const rightType = getTypeOfExpression(expr.right);
|
|
68387
|
-
const hasInstanceMethodType = getSymbolHasInstanceMethodOfObjectType(rightType);
|
|
68388
|
-
if (hasInstanceMethodType) {
|
|
68389
|
-
const syntheticCall = createSyntheticHasInstanceMethodCall(left, expr.right, type, hasInstanceMethodType);
|
|
68390
|
-
const signature = getEffectsSignature(syntheticCall);
|
|
68391
|
-
const predicate = signature && getTypePredicateOfSignature(signature);
|
|
68392
|
-
if (predicate && (predicate.kind === 0 /* This */ || predicate.kind === 1 /* Identifier */)) {
|
|
68393
|
-
return narrowTypeByTypePredicate(type, predicate, syntheticCall, assumeTrue);
|
|
68394
|
-
}
|
|
68395
|
-
}
|
|
68396
68387
|
if (!isTypeDerivedFrom(rightType, globalFunctionType)) {
|
|
68397
68388
|
return type;
|
|
68398
68389
|
}
|
|
@@ -68472,12 +68463,8 @@ ${lanes.join("\n")}
|
|
|
68472
68463
|
}
|
|
68473
68464
|
function narrowTypeByTypePredicate(type, predicate, callExpression, assumeTrue) {
|
|
68474
68465
|
if (predicate.type && !(isTypeAny(type) && (predicate.type === globalObjectType || predicate.type === globalFunctionType))) {
|
|
68475
|
-
|
|
68466
|
+
const predicateArgument = getTypePredicateArgument(predicate, callExpression);
|
|
68476
68467
|
if (predicateArgument) {
|
|
68477
|
-
if (isSyntheticExpression(predicateArgument) && predicate.parameterIndex === 0 && isSyntheticHasInstanceMethodCall(callExpression)) {
|
|
68478
|
-
Debug.assertNode(predicateArgument.parent, isExpression);
|
|
68479
|
-
predicateArgument = predicateArgument.parent;
|
|
68480
|
-
}
|
|
68481
68468
|
if (isMatchingReference(reference, predicateArgument)) {
|
|
68482
68469
|
return getNarrowedType(
|
|
68483
68470
|
type,
|
|
@@ -70315,7 +70302,7 @@ ${lanes.join("\n")}
|
|
|
70315
70302
|
/*resolvedTypePredicate*/
|
|
70316
70303
|
void 0,
|
|
70317
70304
|
minArgCount,
|
|
70318
|
-
(left.flags | right.flags) &
|
|
70305
|
+
(left.flags | right.flags) & 167 /* PropagatingFlags */
|
|
70319
70306
|
);
|
|
70320
70307
|
result.compositeKind = 2097152 /* Intersection */;
|
|
70321
70308
|
result.compositeSignatures = concatenate(left.compositeKind === 2097152 /* Intersection */ && left.compositeSignatures || [left], [right]);
|
|
@@ -71849,7 +71836,7 @@ ${lanes.join("\n")}
|
|
|
71849
71836
|
}
|
|
71850
71837
|
let diagnosticMessage;
|
|
71851
71838
|
const declarationName = idText(right);
|
|
71852
|
-
if (isInPropertyInitializerOrClassStaticBlock(node) && !isOptionalPropertyDeclaration(valueDeclaration) && !(isAccessExpression(node) && isAccessExpression(node.expression)) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right) && !(isMethodDeclaration(valueDeclaration) && getCombinedModifierFlagsCached(valueDeclaration) & 32 /* Static */) && (
|
|
71839
|
+
if (isInPropertyInitializerOrClassStaticBlock(node) && !isOptionalPropertyDeclaration(valueDeclaration) && !(isAccessExpression(node) && isAccessExpression(node.expression)) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right) && !(isMethodDeclaration(valueDeclaration) && getCombinedModifierFlagsCached(valueDeclaration) & 32 /* Static */) && (useDefineForClassFields || !isPropertyDeclaredInAncestorClass(prop))) {
|
|
71853
71840
|
diagnosticMessage = error2(right, Diagnostics.Property_0_is_used_before_its_initialization, declarationName);
|
|
71854
71841
|
} else if (valueDeclaration.kind === 263 /* ClassDeclaration */ && node.parent.kind !== 183 /* TypeReference */ && !(valueDeclaration.flags & 33554432 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) {
|
|
71855
71842
|
diagnosticMessage = error2(right, Diagnostics.Class_0_used_before_its_declaration, declarationName);
|
|
@@ -73054,7 +73041,7 @@ ${lanes.join("\n")}
|
|
|
73054
73041
|
}
|
|
73055
73042
|
return createDiagnosticForNodeArray(getSourceFileOfNode(node), typeArguments, Diagnostics.Expected_0_type_arguments_but_got_1, belowArgCount === -Infinity ? aboveArgCount : belowArgCount, argCount);
|
|
73056
73043
|
}
|
|
73057
|
-
function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags,
|
|
73044
|
+
function resolveCall(node, signatures, candidatesOutArray, checkMode, callChainFlags, headMessage) {
|
|
73058
73045
|
const isTaggedTemplate = node.kind === 215 /* TaggedTemplateExpression */;
|
|
73059
73046
|
const isDecorator2 = node.kind === 170 /* Decorator */;
|
|
73060
73047
|
const isJsxOpeningOrSelfClosingElement = isJsxOpeningLikeElement(node);
|
|
@@ -73097,7 +73084,6 @@ ${lanes.join("\n")}
|
|
|
73097
73084
|
chain = chainDiagnosticMessages(chain, Diagnostics.The_last_overload_gave_the_following_error);
|
|
73098
73085
|
chain = chainDiagnosticMessages(chain, Diagnostics.No_overload_matches_this_call);
|
|
73099
73086
|
}
|
|
73100
|
-
const headMessage = headMessageCallback == null ? void 0 : headMessageCallback();
|
|
73101
73087
|
if (headMessage) {
|
|
73102
73088
|
chain = chainDiagnosticMessages(chain, headMessage);
|
|
73103
73089
|
}
|
|
@@ -73165,7 +73151,6 @@ ${lanes.join("\n")}
|
|
|
73165
73151
|
map(diags, createDiagnosticMessageChainFromDiagnostic),
|
|
73166
73152
|
Diagnostics.No_overload_matches_this_call
|
|
73167
73153
|
);
|
|
73168
|
-
const headMessage = headMessageCallback == null ? void 0 : headMessageCallback();
|
|
73169
73154
|
if (headMessage) {
|
|
73170
73155
|
chain = chainDiagnosticMessages(chain, headMessage);
|
|
73171
73156
|
}
|
|
@@ -73181,21 +73166,21 @@ ${lanes.join("\n")}
|
|
|
73181
73166
|
diagnostics.add(diag2);
|
|
73182
73167
|
}
|
|
73183
73168
|
} else if (candidateForArgumentArityError) {
|
|
73184
|
-
diagnostics.add(getArgumentArityError(node, [candidateForArgumentArityError], args,
|
|
73169
|
+
diagnostics.add(getArgumentArityError(node, [candidateForArgumentArityError], args, headMessage));
|
|
73185
73170
|
} else if (candidateForTypeArgumentError) {
|
|
73186
73171
|
checkTypeArguments(
|
|
73187
73172
|
candidateForTypeArgumentError,
|
|
73188
73173
|
node.typeArguments,
|
|
73189
73174
|
/*reportErrors*/
|
|
73190
73175
|
true,
|
|
73191
|
-
|
|
73176
|
+
headMessage
|
|
73192
73177
|
);
|
|
73193
73178
|
} else {
|
|
73194
73179
|
const signaturesWithCorrectTypeArgumentArity = filter(signatures, (s) => hasCorrectTypeArgumentArity(s, typeArguments));
|
|
73195
73180
|
if (signaturesWithCorrectTypeArgumentArity.length === 0) {
|
|
73196
|
-
diagnostics.add(getTypeArgumentArityError(node, signatures, typeArguments,
|
|
73181
|
+
diagnostics.add(getTypeArgumentArityError(node, signatures, typeArguments, headMessage));
|
|
73197
73182
|
} else {
|
|
73198
|
-
diagnostics.add(getArgumentArityError(node, signaturesWithCorrectTypeArgumentArity, args,
|
|
73183
|
+
diagnostics.add(getArgumentArityError(node, signaturesWithCorrectTypeArgumentArity, args, headMessage));
|
|
73199
73184
|
}
|
|
73200
73185
|
}
|
|
73201
73186
|
}
|
|
@@ -73346,7 +73331,7 @@ ${lanes.join("\n")}
|
|
|
73346
73331
|
parameters.push(createCombinedSymbolFromTypes(symbols, mapDefined(candidates, (candidate) => tryGetTypeAtPosition(candidate, i))));
|
|
73347
73332
|
}
|
|
73348
73333
|
const restParameterSymbols = mapDefined(candidates, (c) => signatureHasRestParameter(c) ? last(c.parameters) : void 0);
|
|
73349
|
-
let flags =
|
|
73334
|
+
let flags = 128 /* IsSignatureCandidateForOverloadFailure */;
|
|
73350
73335
|
if (restParameterSymbols.length !== 0) {
|
|
73351
73336
|
const type = createArrayType(getUnionType(mapDefined(candidates, tryGetRestTypeOfSignature), 2 /* Subtype */));
|
|
73352
73337
|
parameters.push(createCombinedSymbolForOverloadFailure(restParameterSymbols, type));
|
|
@@ -73503,7 +73488,7 @@ ${lanes.join("\n")}
|
|
|
73503
73488
|
error2(node, Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType));
|
|
73504
73489
|
return resolveErrorCall(node);
|
|
73505
73490
|
}
|
|
73506
|
-
return resolveCall(node, callSignatures, candidatesOutArray, checkMode, callChainFlags
|
|
73491
|
+
return resolveCall(node, callSignatures, candidatesOutArray, checkMode, callChainFlags);
|
|
73507
73492
|
}
|
|
73508
73493
|
function isGenericFunctionReturningFunction(signature) {
|
|
73509
73494
|
return !!(signature.typeParameters && isFunctionType(getReturnTypeOfSignature(signature)));
|
|
@@ -73800,7 +73785,7 @@ ${lanes.join("\n")}
|
|
|
73800
73785
|
invocationErrorRecovery(apparentType, 0 /* Call */, diag2);
|
|
73801
73786
|
return resolveErrorCall(node);
|
|
73802
73787
|
}
|
|
73803
|
-
return resolveCall(node, callSignatures, candidatesOutArray, checkMode, 0 /* None */,
|
|
73788
|
+
return resolveCall(node, callSignatures, candidatesOutArray, checkMode, 0 /* None */, headMessage);
|
|
73804
73789
|
}
|
|
73805
73790
|
function createSignatureForJSXIntrinsic(node, result) {
|
|
73806
73791
|
const namespace = getJsxNamespaceAt(node);
|
|
@@ -74070,6 +74055,8 @@ ${lanes.join("\n")}
|
|
|
74070
74055
|
return returnType;
|
|
74071
74056
|
}
|
|
74072
74057
|
function checkDeprecatedSignature(signature, node) {
|
|
74058
|
+
if (signature.flags & 128 /* IsSignatureCandidateForOverloadFailure */)
|
|
74059
|
+
return;
|
|
74073
74060
|
if (signature.declaration && signature.declaration.flags & 536870912 /* Deprecated */) {
|
|
74074
74061
|
const suggestionNode = getDeprecatedSuggestionNode(node);
|
|
74075
74062
|
const name = tryGetPropertyAccessOrIdentifierToString(getInvokedExpression(node));
|
|
@@ -75833,32 +75820,6 @@ ${lanes.join("\n")}
|
|
|
75833
75820
|
function isConstEnumSymbol(symbol) {
|
|
75834
75821
|
return (symbol.flags & 128 /* ConstEnum */) !== 0;
|
|
75835
75822
|
}
|
|
75836
|
-
function getSymbolHasInstanceMethodOfObjectType(type) {
|
|
75837
|
-
const hasInstancePropertyName = getPropertyNameForKnownSymbolName("hasInstance");
|
|
75838
|
-
const hasInstanceProperty = getPropertyOfObjectType(type, hasInstancePropertyName);
|
|
75839
|
-
if (hasInstanceProperty) {
|
|
75840
|
-
const hasInstancePropertyType = getTypeOfSymbol(hasInstanceProperty);
|
|
75841
|
-
if (hasInstancePropertyType && getSignaturesOfType(hasInstancePropertyType, 0 /* Call */).length !== 0) {
|
|
75842
|
-
return hasInstancePropertyType;
|
|
75843
|
-
}
|
|
75844
|
-
}
|
|
75845
|
-
}
|
|
75846
|
-
function createSyntheticHasInstanceMethodCall(left, right, leftType, hasInstanceMethodType) {
|
|
75847
|
-
const syntheticExpression = createSyntheticExpression(right, hasInstanceMethodType);
|
|
75848
|
-
const syntheticArgument = createSyntheticExpression(left, leftType);
|
|
75849
|
-
const syntheticCall = parseNodeFactory.createCallExpression(
|
|
75850
|
-
syntheticExpression,
|
|
75851
|
-
/*typeArguments*/
|
|
75852
|
-
void 0,
|
|
75853
|
-
[syntheticArgument]
|
|
75854
|
-
);
|
|
75855
|
-
setParent(syntheticCall, left.parent);
|
|
75856
|
-
setTextRange(syntheticCall, left.parent);
|
|
75857
|
-
return syntheticCall;
|
|
75858
|
-
}
|
|
75859
|
-
function isSyntheticHasInstanceMethodCall(node) {
|
|
75860
|
-
return isSyntheticExpression(node.expression) && node.arguments.length === 1 && isSyntheticExpression(node.arguments[0]) && isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 104 /* InstanceOfKeyword */ && node.parent.right === node.expression.parent && node.parent.left === node.arguments[0].parent;
|
|
75861
|
-
}
|
|
75862
75823
|
function checkInstanceOfExpression(left, right, leftType, rightType) {
|
|
75863
75824
|
if (leftType === silentNeverType || rightType === silentNeverType) {
|
|
75864
75825
|
return silentNeverType;
|
|
@@ -75866,31 +75827,8 @@ ${lanes.join("\n")}
|
|
|
75866
75827
|
if (!isTypeAny(leftType) && allTypesAssignableToKind(leftType, 402784252 /* Primitive */)) {
|
|
75867
75828
|
error2(left, Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter);
|
|
75868
75829
|
}
|
|
75869
|
-
if (!isTypeAny(rightType)) {
|
|
75870
|
-
|
|
75871
|
-
if (hasInstanceMethodType) {
|
|
75872
|
-
const cache = hasInstanceMethodType;
|
|
75873
|
-
if (cache.hasSimpleUnrestrictedSingleCallSignature === void 0) {
|
|
75874
|
-
const signature = getSingleCallSignature(hasInstanceMethodType);
|
|
75875
|
-
cache.hasSimpleUnrestrictedSingleCallSignature = !!signature && signature.parameters.length === 1 && !!(getTypeOfSymbol(signature.parameters[0]).flags & 3 /* AnyOrUnknown */) && !!signature.resolvedReturnType && !!(signature.resolvedReturnType.flags & 16 /* Boolean */);
|
|
75876
|
-
}
|
|
75877
|
-
if (!cache.hasSimpleUnrestrictedSingleCallSignature) {
|
|
75878
|
-
const syntheticCall = createSyntheticHasInstanceMethodCall(left, right, leftType, hasInstanceMethodType);
|
|
75879
|
-
const returnType = getReturnTypeOfSignature(getResolvedSignature(syntheticCall));
|
|
75880
|
-
checkTypeAssignableTo(returnType, booleanType, right, Diagnostics.An_object_s_Symbol_hasInstance_method_must_return_a_boolean_value_for_it_to_be_used_on_the_right_hand_side_of_an_instanceof_expression);
|
|
75881
|
-
}
|
|
75882
|
-
}
|
|
75883
|
-
if (!(hasInstanceMethodType || typeHasCallOrConstructSignatures(rightType) || isTypeSubtypeOf(rightType, globalFunctionType))) {
|
|
75884
|
-
if (hasGlobalSymbolHasInstanceProperty === void 0) {
|
|
75885
|
-
const globalESSymbolConstructorSymbol = getGlobalESSymbolConstructorTypeSymbol(
|
|
75886
|
-
/*reportErrors*/
|
|
75887
|
-
false
|
|
75888
|
-
);
|
|
75889
|
-
hasGlobalSymbolHasInstanceProperty = !!globalESSymbolConstructorSymbol && getMembersOfSymbol(globalESSymbolConstructorSymbol).has("hasInstance");
|
|
75890
|
-
}
|
|
75891
|
-
const message = hasGlobalSymbolHasInstanceProperty ? Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_either_of_type_any_an_object_type_with_a_Symbol_hasInstance_method_or_a_type_assignable_to_the_Function_interface_type : Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type;
|
|
75892
|
-
error2(right, message);
|
|
75893
|
-
}
|
|
75830
|
+
if (!(isTypeAny(rightType) || typeHasCallOrConstructSignatures(rightType) || isTypeSubtypeOf(rightType, globalFunctionType))) {
|
|
75831
|
+
error2(right, Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type);
|
|
75894
75832
|
}
|
|
75895
75833
|
return booleanType;
|
|
75896
75834
|
}
|
|
@@ -77592,7 +77530,7 @@ ${lanes.join("\n")}
|
|
|
77592
77530
|
case "length":
|
|
77593
77531
|
case "caller":
|
|
77594
77532
|
case "arguments":
|
|
77595
|
-
if (
|
|
77533
|
+
if (useDefineForClassFields) {
|
|
77596
77534
|
break;
|
|
77597
77535
|
}
|
|
77598
77536
|
case "prototype":
|
|
@@ -77740,7 +77678,7 @@ ${lanes.join("\n")}
|
|
|
77740
77678
|
if (classExtendsNull) {
|
|
77741
77679
|
error2(superCall, Diagnostics.A_constructor_cannot_contain_a_super_call_when_its_class_extends_null);
|
|
77742
77680
|
}
|
|
77743
|
-
const superCallShouldBeRootLevel =
|
|
77681
|
+
const superCallShouldBeRootLevel = !useDefineForClassFields && (some(node.parent.members, isInstancePropertyWithInitializerOrPrivateIdentifierProperty) || some(node.parameters, (p) => hasSyntacticModifier(p, 16476 /* ParameterPropertyModifier */)));
|
|
77744
77682
|
if (superCallShouldBeRootLevel) {
|
|
77745
77683
|
if (!superCallIsRootLevelInConstructor(superCall, node.body)) {
|
|
77746
77684
|
error2(superCall, Diagnostics.A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_initialized_properties_parameter_properties_or_private_identifiers);
|
|
@@ -81010,7 +80948,7 @@ ${lanes.join("\n")}
|
|
|
81010
80948
|
node
|
|
81011
80949
|
);
|
|
81012
80950
|
const willTransformPrivateElementsOrClassStaticBlocks = languageVersion <= 9 /* ES2022 */;
|
|
81013
|
-
const willTransformInitializers = !useDefineForClassFields
|
|
80951
|
+
const willTransformInitializers = !useDefineForClassFields;
|
|
81014
80952
|
if (willTransformStaticElementsOfDecoratedClass || willTransformPrivateElementsOrClassStaticBlocks) {
|
|
81015
80953
|
for (const member of node.members) {
|
|
81016
80954
|
if (willTransformStaticElementsOfDecoratedClass && classElementOrClassElementParameterIsDecorated(
|
|
@@ -158440,7 +158378,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
158440
158378
|
const leftMostName = getLeftMostName(computedPropertyName.expression);
|
|
158441
158379
|
const nameSymbol = leftMostName && typeChecker.getSymbolAtLocation(leftMostName);
|
|
158442
158380
|
const firstAccessibleSymbol = nameSymbol && getFirstSymbolInChain(nameSymbol, contextToken, typeChecker);
|
|
158443
|
-
|
|
158381
|
+
const firstAccessibleSymbolId = firstAccessibleSymbol && getSymbolId(firstAccessibleSymbol);
|
|
158382
|
+
if (firstAccessibleSymbolId && addToSeen(seenPropertySymbols, firstAccessibleSymbolId)) {
|
|
158444
158383
|
const index = symbols.length;
|
|
158445
158384
|
symbols.push(firstAccessibleSymbol);
|
|
158446
158385
|
const moduleSymbol = firstAccessibleSymbol.parent;
|
|
@@ -158470,6 +158409,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
158470
158409
|
}
|
|
158471
158410
|
}
|
|
158472
158411
|
} else if (preferences.includeCompletionsWithInsertText) {
|
|
158412
|
+
if (firstAccessibleSymbolId && seenPropertySymbols.has(firstAccessibleSymbolId)) {
|
|
158413
|
+
return;
|
|
158414
|
+
}
|
|
158473
158415
|
addSymbolOriginInfo(symbol);
|
|
158474
158416
|
addSymbolSortInfo(symbol);
|
|
158475
158417
|
symbols.push(symbol);
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
|
|
|
54
54
|
|
|
55
55
|
// src/compiler/corePublic.ts
|
|
56
56
|
var versionMajorMinor = "5.2";
|
|
57
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
57
|
+
var version = `${versionMajorMinor}.0-insiders.20230720`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -3193,7 +3193,8 @@ var SignatureFlags = /* @__PURE__ */ ((SignatureFlags4) => {
|
|
|
3193
3193
|
SignatureFlags4[SignatureFlags4["IsOuterCallChain"] = 16] = "IsOuterCallChain";
|
|
3194
3194
|
SignatureFlags4[SignatureFlags4["IsUntypedSignatureInJSFile"] = 32] = "IsUntypedSignatureInJSFile";
|
|
3195
3195
|
SignatureFlags4[SignatureFlags4["IsNonInferrable"] = 64] = "IsNonInferrable";
|
|
3196
|
-
SignatureFlags4[SignatureFlags4["
|
|
3196
|
+
SignatureFlags4[SignatureFlags4["IsSignatureCandidateForOverloadFailure"] = 128] = "IsSignatureCandidateForOverloadFailure";
|
|
3197
|
+
SignatureFlags4[SignatureFlags4["PropagatingFlags"] = 167] = "PropagatingFlags";
|
|
3197
3198
|
SignatureFlags4[SignatureFlags4["CallChainFlags"] = 24] = "CallChainFlags";
|
|
3198
3199
|
return SignatureFlags4;
|
|
3199
3200
|
})(SignatureFlags || {});
|
|
@@ -6042,9 +6043,6 @@ var Diagnostics = {
|
|
|
6042
6043
|
await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(2852, 1 /* Error */, "await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_2852", "'await using' statements are only allowed within async functions and at the top levels of modules."),
|
|
6043
6044
|
await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(2853, 1 /* Error */, "await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_th_2853", "'await using' statements are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
|
|
6044
6045
|
Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(2854, 1 /* Error */, "Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_sys_2854", "Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
|
|
6045
|
-
The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_hand_side_s_Symbol_hasInstance_method: diag(2855, 1 /* Error */, "The_left_hand_side_of_an_instanceof_expression_must_be_assignable_to_the_first_argument_of_the_right_2855", "The left-hand side of an 'instanceof' expression must be assignable to the first argument of the right-hand side's '[Symbol.hasInstance]' method."),
|
|
6046
|
-
An_object_s_Symbol_hasInstance_method_must_return_a_boolean_value_for_it_to_be_used_on_the_right_hand_side_of_an_instanceof_expression: diag(2856, 1 /* Error */, "An_object_s_Symbol_hasInstance_method_must_return_a_boolean_value_for_it_to_be_used_on_the_right_han_2856", "An object's '[Symbol.hasInstance]' method must return a boolean value for it to be used on the right-hand side of an 'instanceof' expression."),
|
|
6047
|
-
The_right_hand_side_of_an_instanceof_expression_must_be_either_of_type_any_an_object_type_with_a_Symbol_hasInstance_method_or_a_type_assignable_to_the_Function_interface_type: diag(2857, 1 /* Error */, "The_right_hand_side_of_an_instanceof_expression_must_be_either_of_type_any_an_object_type_with_a_Sym_2857", "The right-hand side of an 'instanceof' expression must be either of type 'any', an object type with a '[Symbol.hasInstance]()' method, or a type assignable to the 'Function' interface type."),
|
|
6048
6046
|
Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
6049
6047
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
|
6050
6048
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
|
@@ -9874,7 +9872,6 @@ function isLeftHandSideExpressionKind(kind) {
|
|
|
9874
9872
|
case 236 /* MetaProperty */:
|
|
9875
9873
|
case 102 /* ImportKeyword */:
|
|
9876
9874
|
case 282 /* MissingDeclaration */:
|
|
9877
|
-
case 237 /* SyntheticExpression */:
|
|
9878
9875
|
return true;
|
|
9879
9876
|
default:
|
|
9880
9877
|
return false;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@typescript-deploys/pr-build",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.2.0-pr-
|
|
5
|
+
"version": "5.2.0-pr-55028-5",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
"node": "20.1.0",
|
|
115
115
|
"npm": "8.19.4"
|
|
116
116
|
},
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "fb842a7dca335bf33800fb078366120784fc52fa"
|
|
118
118
|
}
|