@typescript-deploys/pr-build 5.8.0-pr-60434-6 → 5.9.0-pr-61291-4
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 +84 -97
- package/lib/cs/diagnosticMessages.generated.json +1 -0
- package/lib/de/diagnosticMessages.generated.json +1 -0
- package/lib/es/diagnosticMessages.generated.json +1 -0
- package/lib/fr/diagnosticMessages.generated.json +1 -0
- package/lib/it/diagnosticMessages.generated.json +1 -0
- package/lib/ja/diagnosticMessages.generated.json +1 -0
- package/lib/ko/diagnosticMessages.generated.json +1 -0
- package/lib/lib.es2015.symbol.wellknown.d.ts +1 -1
- package/lib/lib.es2017.sharedmemory.d.ts +1 -1
- package/lib/pl/diagnosticMessages.generated.json +1 -0
- package/lib/pt-br/diagnosticMessages.generated.json +1 -0
- package/lib/ru/diagnosticMessages.generated.json +1 -0
- package/lib/tr/diagnosticMessages.generated.json +1 -0
- package/lib/typescript.d.ts +1 -1
- package/lib/typescript.js +107 -99
- package/lib/zh-cn/diagnosticMessages.generated.json +1 -0
- package/lib/zh-tw/diagnosticMessages.generated.json +1 -0
- package/package.json +20 -20
package/lib/_tsc.js
CHANGED
|
@@ -17,8 +17,8 @@ and limitations under the License.
|
|
|
17
17
|
"use strict";
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
|
-
var versionMajorMinor = "5.
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
20
|
+
var versionMajorMinor = "5.9";
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20250228`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -6825,6 +6825,7 @@ var Diagnostics = {
|
|
|
6825
6825
|
This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_between_the_projects_output_files_is_not_the_same_as_the_relative_path_between_its_input_files: diag(2878, 1 /* Error */, "This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_b_2878", "This import path is unsafe to rewrite because it resolves to another project, and the relative path between the projects' output files is not the same as the relative path between its input files."),
|
|
6826
6826
|
Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found: diag(2879, 1 /* Error */, "Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found_2879", "Using JSX fragments requires fragment factory '{0}' to be in scope, but it could not be found."),
|
|
6827
6827
|
Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert: diag(2880, 1 /* Error */, "Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert_2880", "Import assertions have been replaced by import attributes. Use 'with' instead of 'assert'."),
|
|
6828
|
+
This_expression_is_never_nullish: diag(2881, 1 /* Error */, "This_expression_is_never_nullish_2881", "This expression is never nullish."),
|
|
6828
6829
|
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}'."),
|
|
6829
6830
|
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}'."),
|
|
6830
6831
|
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}'."),
|
|
@@ -6936,6 +6937,7 @@ var Diagnostics = {
|
|
|
6936
6937
|
One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value: diag(4126, 1 /* Error */, "One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value_4126", "One value of '{0}.{1}' is the string '{2}', and the other is assumed to be an unknown numeric value."),
|
|
6937
6938
|
This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic: diag(4127, 1 /* Error */, "This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic_4127", "This member cannot have an 'override' modifier because its name is dynamic."),
|
|
6938
6939
|
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic: diag(4128, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic_4128", "This member cannot have a JSDoc comment with an '@override' tag because its name is dynamic."),
|
|
6940
|
+
Private_or_protected_member_0_cannot_be_accessed_via_indexed_access: diag(4129, 1 /* Error */, "Private_or_protected_member_0_cannot_be_accessed_via_indexed_access_4129", "Private or protected member '{0}' cannot be accessed via indexed access."),
|
|
6939
6941
|
The_current_host_does_not_support_the_0_option: diag(5001, 1 /* Error */, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
|
|
6940
6942
|
Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, 1 /* Error */, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
|
|
6941
6943
|
File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, 1 /* Error */, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
|
|
@@ -50482,6 +50484,7 @@ function createTypeChecker(host) {
|
|
|
50482
50484
|
const context = syntacticContext;
|
|
50483
50485
|
if (context.bundled || context.enclosingFile !== getSourceFileOfNode(lit)) {
|
|
50484
50486
|
let name = lit.text;
|
|
50487
|
+
const originalName = name;
|
|
50485
50488
|
const nodeSymbol = getNodeLinks(parent).resolvedSymbol;
|
|
50486
50489
|
const meaning = parent.isTypeOf ? 111551 /* Value */ : 788968 /* Type */;
|
|
50487
50490
|
const parentSymbol = nodeSymbol && isSymbolAccessible(
|
|
@@ -50511,7 +50514,9 @@ function createTypeChecker(host) {
|
|
|
50511
50514
|
context.tracker.reportLikelyUnsafeImportRequiredError(name);
|
|
50512
50515
|
}
|
|
50513
50516
|
}
|
|
50514
|
-
|
|
50517
|
+
if (name !== originalName) {
|
|
50518
|
+
return name;
|
|
50519
|
+
}
|
|
50515
50520
|
}
|
|
50516
50521
|
},
|
|
50517
50522
|
canReuseTypeNode(context, typeNode) {
|
|
@@ -52885,10 +52890,7 @@ function createTypeChecker(host) {
|
|
|
52885
52890
|
/*context*/
|
|
52886
52891
|
void 0
|
|
52887
52892
|
);
|
|
52888
|
-
|
|
52889
|
-
setTextRange2(context, updated, node2);
|
|
52890
|
-
}
|
|
52891
|
-
return updated;
|
|
52893
|
+
return setTextRange2(context, updated, node2);
|
|
52892
52894
|
}
|
|
52893
52895
|
}
|
|
52894
52896
|
function serializeTypeName(context, node, isTypeOf, typeArguments) {
|
|
@@ -55602,7 +55604,7 @@ function createTypeChecker(host) {
|
|
|
55602
55604
|
if (reportErrors2) {
|
|
55603
55605
|
reportErrorsFromWidening(declaration, type);
|
|
55604
55606
|
}
|
|
55605
|
-
if (type.flags & 8192 /* UniqueESSymbol */ && (isBindingElement(declaration) || !declaration
|
|
55607
|
+
if (type.flags & 8192 /* UniqueESSymbol */ && (isBindingElement(declaration) || !tryGetTypeFromEffectiveTypeNode(declaration)) && type.symbol !== getSymbolOfDeclaration(declaration)) {
|
|
55606
55608
|
type = esSymbolType;
|
|
55607
55609
|
}
|
|
55608
55610
|
return getWidenedType(type);
|
|
@@ -58572,7 +58574,7 @@ function createTypeChecker(host) {
|
|
|
58572
58574
|
let hasThisParameter = false;
|
|
58573
58575
|
const iife = getImmediatelyInvokedFunctionExpression(declaration);
|
|
58574
58576
|
const isJSConstructSignature = isJSDocConstructSignature(declaration);
|
|
58575
|
-
const isUntypedSignatureInJSFile = !iife && isInJSFile(declaration) && isValueSignatureDeclaration(declaration) && !hasJSDocParameterTags(declaration) && !getJSDocType(declaration);
|
|
58577
|
+
const isUntypedSignatureInJSFile = !iife && isInJSFile(declaration) && isValueSignatureDeclaration(declaration) && !hasJSDocParameterTags(declaration) && !getJSDocType(declaration) && !getContextualSignatureForFunctionLikeDeclaration(declaration);
|
|
58576
58578
|
if (isUntypedSignatureInJSFile) {
|
|
58577
58579
|
flags |= 32 /* IsUntypedSignatureInJSFile */;
|
|
58578
58580
|
}
|
|
@@ -67513,7 +67515,7 @@ function createTypeChecker(host) {
|
|
|
67513
67515
|
value,
|
|
67514
67516
|
/*roundTripOnly*/
|
|
67515
67517
|
false
|
|
67516
|
-
) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(
|
|
67518
|
+
) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(source, target) || target.flags & 134217728 /* TemplateLiteral */ && isTypeMatchedByTemplateLiteralType(source, target));
|
|
67517
67519
|
}
|
|
67518
67520
|
if (source.flags & 134217728 /* TemplateLiteral */) {
|
|
67519
67521
|
const texts = source.texts;
|
|
@@ -69701,7 +69703,7 @@ function createTypeChecker(host) {
|
|
|
69701
69703
|
if (isBindingPattern(reference) || isFunctionExpressionOrArrowFunction(reference) || isObjectLiteralMethod(reference)) {
|
|
69702
69704
|
if (isIdentifier(expr)) {
|
|
69703
69705
|
const symbol = getResolvedSymbol(expr);
|
|
69704
|
-
const declaration = symbol.valueDeclaration;
|
|
69706
|
+
const declaration = getExportSymbolOfValueSymbolIfExported(symbol).valueDeclaration;
|
|
69705
69707
|
if (declaration && (isBindingElement(declaration) || isParameter(declaration)) && reference === declaration.parent && !declaration.initializer && !declaration.dotDotDotToken) {
|
|
69706
69708
|
return declaration;
|
|
69707
69709
|
}
|
|
@@ -72343,50 +72345,6 @@ function createTypeChecker(host) {
|
|
|
72343
72345
|
)
|
|
72344
72346
|
);
|
|
72345
72347
|
}
|
|
72346
|
-
function discriminateContextualTypeByArrayElements(node, contextualType) {
|
|
72347
|
-
const key = `D${getNodeId(node)},${getTypeId(contextualType)}`;
|
|
72348
|
-
const cachedType = getCachedType(key);
|
|
72349
|
-
if (cachedType) return cachedType;
|
|
72350
|
-
const isIndexPropertyLike = (property) => /^[-+]?\d+$/.test(property.escapedName);
|
|
72351
|
-
const hasIndexPropertyOutOfRange = (type, length2) => some(getPropertiesOfType(type), (p) => {
|
|
72352
|
-
if (p.flags & 16777216 /* Optional */ || !isIndexPropertyLike(p)) return false;
|
|
72353
|
-
const index = +p.escapedName;
|
|
72354
|
-
return index < 0 || index >= length2;
|
|
72355
|
-
});
|
|
72356
|
-
const hasIndexPropertyInRange = (type, length2) => some(getPropertiesOfType(type), (p) => {
|
|
72357
|
-
if (!isIndexPropertyLike(p)) return false;
|
|
72358
|
-
const index = +p.escapedName;
|
|
72359
|
-
return index >= 0 || index < length2;
|
|
72360
|
-
});
|
|
72361
|
-
const elementsLength = node.elements.length;
|
|
72362
|
-
const filteredType = filterType(contextualType, (type) => {
|
|
72363
|
-
if (isTupleType(type)) {
|
|
72364
|
-
return elementsLength >= type.target.minLength && (!!(type.target.combinedFlags & 12 /* Variable */) || elementsLength <= type.target.fixedLength);
|
|
72365
|
-
}
|
|
72366
|
-
return !hasIndexPropertyOutOfRange(type, elementsLength);
|
|
72367
|
-
});
|
|
72368
|
-
if (filteredType.flags & 131072 /* Never */) return setCachedType(key, contextualType);
|
|
72369
|
-
if (!(filteredType.flags & 1048576 /* Union */)) {
|
|
72370
|
-
return setCachedType(
|
|
72371
|
-
key,
|
|
72372
|
-
isTupleType(filteredType) || hasIndexPropertyInRange(filteredType, elementsLength) ? filteredType : contextualType
|
|
72373
|
-
);
|
|
72374
|
-
}
|
|
72375
|
-
return setCachedType(
|
|
72376
|
-
key,
|
|
72377
|
-
discriminateTypeByDiscriminableItems(
|
|
72378
|
-
filteredType,
|
|
72379
|
-
filter(
|
|
72380
|
-
map(node.elements, (element, index) => {
|
|
72381
|
-
const name = "" + index;
|
|
72382
|
-
return isPossiblyDiscriminantValue(element) && isDiscriminantProperty(filteredType, name) ? [() => getContextFreeTypeOfExpression(element), name] : void 0;
|
|
72383
|
-
}),
|
|
72384
|
-
(discriminator) => !!discriminator
|
|
72385
|
-
),
|
|
72386
|
-
isTypeAssignableTo
|
|
72387
|
-
)
|
|
72388
|
-
);
|
|
72389
|
-
}
|
|
72390
72348
|
function getApparentTypeOfContextualType(node, contextFlags) {
|
|
72391
72349
|
const contextualType = isObjectLiteralMethod(node) ? getContextualTypeForObjectLiteralMethod(node, contextFlags) : getContextualType(node, contextFlags);
|
|
72392
72350
|
const instantiatedType = instantiateContextualType(contextualType, node, contextFlags);
|
|
@@ -72401,12 +72359,7 @@ function createTypeChecker(host) {
|
|
|
72401
72359
|
/*noReductions*/
|
|
72402
72360
|
true
|
|
72403
72361
|
);
|
|
72404
|
-
|
|
72405
|
-
if (isObjectLiteralExpression(node)) return discriminateContextualTypeByObjectMembers(node, apparentType);
|
|
72406
|
-
if (isJsxAttributes(node)) return discriminateContextualTypeByJSXAttributes(node, apparentType);
|
|
72407
|
-
if (isArrayLiteralExpression(node)) return discriminateContextualTypeByArrayElements(node, apparentType);
|
|
72408
|
-
}
|
|
72409
|
-
return apparentType;
|
|
72362
|
+
return apparentType.flags & 1048576 /* Union */ && isObjectLiteralExpression(node) ? discriminateContextualTypeByObjectMembers(node, apparentType) : apparentType.flags & 1048576 /* Union */ && isJsxAttributes(node) ? discriminateContextualTypeByJSXAttributes(node, apparentType) : apparentType;
|
|
72410
72363
|
}
|
|
72411
72364
|
}
|
|
72412
72365
|
function instantiateContextualType(contextualType, node, contextFlags) {
|
|
@@ -77303,14 +77256,14 @@ function createTypeChecker(host) {
|
|
|
77303
77256
|
function getTypeOfFirstParameterOfSignatureWithFallback(signature, fallbackType) {
|
|
77304
77257
|
return signature.parameters.length > 0 ? getTypeAtPosition(signature, 0) : fallbackType;
|
|
77305
77258
|
}
|
|
77306
|
-
function
|
|
77259
|
+
function inferFromAnnotatedParametersAndReturn(signature, context, inferenceContext) {
|
|
77307
77260
|
const len = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);
|
|
77308
77261
|
for (let i = 0; i < len; i++) {
|
|
77309
77262
|
const declaration = signature.parameters[i].valueDeclaration;
|
|
77310
|
-
const
|
|
77311
|
-
if (
|
|
77263
|
+
const typeNode2 = getEffectiveTypeAnnotationNode(declaration);
|
|
77264
|
+
if (typeNode2) {
|
|
77312
77265
|
const source = addOptionality(
|
|
77313
|
-
getTypeFromTypeNode(
|
|
77266
|
+
getTypeFromTypeNode(typeNode2),
|
|
77314
77267
|
/*isProperty*/
|
|
77315
77268
|
false,
|
|
77316
77269
|
isOptionalDeclaration(declaration)
|
|
@@ -77319,6 +77272,12 @@ function createTypeChecker(host) {
|
|
|
77319
77272
|
inferTypes(inferenceContext.inferences, source, target);
|
|
77320
77273
|
}
|
|
77321
77274
|
}
|
|
77275
|
+
const typeNode = signature.declaration && getEffectiveReturnTypeNode(signature.declaration);
|
|
77276
|
+
if (typeNode) {
|
|
77277
|
+
const source = getTypeFromTypeNode(typeNode);
|
|
77278
|
+
const target = getReturnTypeOfSignature(context);
|
|
77279
|
+
inferTypes(inferenceContext.inferences, source, target);
|
|
77280
|
+
}
|
|
77322
77281
|
}
|
|
77323
77282
|
function assignContextualParameterTypes(signature, context) {
|
|
77324
77283
|
if (context.typeParameters) {
|
|
@@ -78012,7 +77971,7 @@ function createTypeChecker(host) {
|
|
|
78012
77971
|
const trueType2 = getFlowTypeOfReference(param.name, initType, initType, func, trueCondition);
|
|
78013
77972
|
if (trueType2 === initType) return void 0;
|
|
78014
77973
|
const falseCondition = createFlowNode(64 /* FalseCondition */, expr, antecedent);
|
|
78015
|
-
const falseSubtype = getFlowTypeOfReference(param.name, initType, trueType2, func, falseCondition);
|
|
77974
|
+
const falseSubtype = getReducedType(getFlowTypeOfReference(param.name, initType, trueType2, func, falseCondition));
|
|
78016
77975
|
return falseSubtype.flags & 131072 /* Never */ ? trueType2 : void 0;
|
|
78017
77976
|
}
|
|
78018
77977
|
function checkAllCodePathsInNonVoidFunctionReturnOrThrow(func, returnType) {
|
|
@@ -78107,7 +78066,7 @@ function createTypeChecker(host) {
|
|
|
78107
78066
|
const inferenceContext = getInferenceContext(node);
|
|
78108
78067
|
let instantiatedContextualSignature;
|
|
78109
78068
|
if (checkMode && checkMode & 2 /* Inferential */) {
|
|
78110
|
-
|
|
78069
|
+
inferFromAnnotatedParametersAndReturn(signature, contextualSignature, inferenceContext);
|
|
78111
78070
|
const restType = getEffectiveRestType(contextualSignature);
|
|
78112
78071
|
if (restType && restType.flags & 262144 /* TypeParameter */) {
|
|
78113
78072
|
instantiatedContextualSignature = instantiateSignature(contextualSignature, inferenceContext.nonFixingMapper);
|
|
@@ -78121,7 +78080,7 @@ function createTypeChecker(host) {
|
|
|
78121
78080
|
} else if (contextualSignature && !node.typeParameters && contextualSignature.parameters.length > node.parameters.length) {
|
|
78122
78081
|
const inferenceContext = getInferenceContext(node);
|
|
78123
78082
|
if (checkMode && checkMode & 2 /* Inferential */) {
|
|
78124
|
-
|
|
78083
|
+
inferFromAnnotatedParametersAndReturn(signature, contextualSignature, inferenceContext);
|
|
78125
78084
|
}
|
|
78126
78085
|
}
|
|
78127
78086
|
if (contextualSignature && !getReturnTypeFromAnnotation(node) && !signature.resolvedReturnType) {
|
|
@@ -78884,21 +78843,36 @@ function createTypeChecker(host) {
|
|
|
78884
78843
|
if (isBinaryExpression(right) && (right.operatorToken.kind === 57 /* BarBarToken */ || right.operatorToken.kind === 56 /* AmpersandAmpersandToken */)) {
|
|
78885
78844
|
grammarErrorOnNode(right, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(right.operatorToken.kind), tokenToString(operatorToken.kind));
|
|
78886
78845
|
}
|
|
78887
|
-
|
|
78888
|
-
|
|
78889
|
-
|
|
78890
|
-
|
|
78891
|
-
|
|
78892
|
-
|
|
78893
|
-
|
|
78894
|
-
|
|
78895
|
-
|
|
78896
|
-
|
|
78897
|
-
|
|
78898
|
-
|
|
78846
|
+
checkNullishCoalesceOperandLeft(node);
|
|
78847
|
+
checkNullishCoalesceOperandRight(node);
|
|
78848
|
+
}
|
|
78849
|
+
}
|
|
78850
|
+
function checkNullishCoalesceOperandLeft(node) {
|
|
78851
|
+
const leftTarget = skipOuterExpressions(node.left, 63 /* All */);
|
|
78852
|
+
const nullishSemantics = getSyntacticNullishnessSemantics(leftTarget);
|
|
78853
|
+
if (nullishSemantics !== 3 /* Sometimes */) {
|
|
78854
|
+
if (nullishSemantics === 1 /* Always */) {
|
|
78855
|
+
error(leftTarget, Diagnostics.This_expression_is_always_nullish);
|
|
78856
|
+
} else {
|
|
78857
|
+
error(leftTarget, Diagnostics.Right_operand_of_is_unreachable_because_the_left_operand_is_never_nullish);
|
|
78899
78858
|
}
|
|
78900
78859
|
}
|
|
78901
78860
|
}
|
|
78861
|
+
function checkNullishCoalesceOperandRight(node) {
|
|
78862
|
+
const rightTarget = skipOuterExpressions(node.right, 63 /* All */);
|
|
78863
|
+
const nullishSemantics = getSyntacticNullishnessSemantics(rightTarget);
|
|
78864
|
+
if (isNotWithinNullishCoalesceExpression(node)) {
|
|
78865
|
+
return;
|
|
78866
|
+
}
|
|
78867
|
+
if (nullishSemantics === 1 /* Always */) {
|
|
78868
|
+
error(rightTarget, Diagnostics.This_expression_is_always_nullish);
|
|
78869
|
+
} else if (nullishSemantics === 2 /* Never */) {
|
|
78870
|
+
error(rightTarget, Diagnostics.This_expression_is_never_nullish);
|
|
78871
|
+
}
|
|
78872
|
+
}
|
|
78873
|
+
function isNotWithinNullishCoalesceExpression(node) {
|
|
78874
|
+
return !isBinaryExpression(node.parent) || node.parent.operatorToken.kind !== 61 /* QuestionQuestionToken */;
|
|
78875
|
+
}
|
|
78902
78876
|
function getSyntacticNullishnessSemantics(node) {
|
|
78903
78877
|
node = skipOuterExpressions(node);
|
|
78904
78878
|
switch (node.kind) {
|
|
@@ -80746,6 +80720,18 @@ function createTypeChecker(host) {
|
|
|
80746
80720
|
}
|
|
80747
80721
|
function checkIndexedAccessIndexType(type, accessNode) {
|
|
80748
80722
|
if (!(type.flags & 8388608 /* IndexedAccess */)) {
|
|
80723
|
+
if (isIndexedAccessTypeNode(accessNode)) {
|
|
80724
|
+
const indexType2 = getTypeFromTypeNode(accessNode.indexType);
|
|
80725
|
+
const objectType2 = getTypeFromTypeNode(accessNode.objectType);
|
|
80726
|
+
const propertyName2 = getPropertyNameFromIndex(indexType2, accessNode);
|
|
80727
|
+
if (propertyName2) {
|
|
80728
|
+
const propertySymbol = forEachType(getApparentType(objectType2), (t) => getPropertyOfType(t, propertyName2));
|
|
80729
|
+
if (propertySymbol && getDeclarationModifierFlagsFromSymbol(propertySymbol) & 6 /* NonPublicAccessibilityModifier */) {
|
|
80730
|
+
error(accessNode, Diagnostics.Private_or_protected_member_0_cannot_be_accessed_via_indexed_access, unescapeLeadingUnderscores(propertyName2));
|
|
80731
|
+
return errorType;
|
|
80732
|
+
}
|
|
80733
|
+
}
|
|
80734
|
+
}
|
|
80749
80735
|
return type;
|
|
80750
80736
|
}
|
|
80751
80737
|
const objectType = type.objectType;
|
|
@@ -80758,14 +80744,12 @@ function createTypeChecker(host) {
|
|
|
80758
80744
|
}
|
|
80759
80745
|
return type;
|
|
80760
80746
|
}
|
|
80761
|
-
|
|
80762
|
-
|
|
80763
|
-
|
|
80764
|
-
|
|
80765
|
-
|
|
80766
|
-
|
|
80767
|
-
return errorType;
|
|
80768
|
-
}
|
|
80747
|
+
const propertyName = getPropertyNameFromIndex(indexType, accessNode);
|
|
80748
|
+
if (propertyName) {
|
|
80749
|
+
const propertySymbol = forEachType(getApparentType(objectType), (t) => getPropertyOfType(t, propertyName));
|
|
80750
|
+
if (propertySymbol && getDeclarationModifierFlagsFromSymbol(propertySymbol) & 6 /* NonPublicAccessibilityModifier */) {
|
|
80751
|
+
error(accessNode, Diagnostics.Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter, unescapeLeadingUnderscores(propertyName));
|
|
80752
|
+
return errorType;
|
|
80769
80753
|
}
|
|
80770
80754
|
}
|
|
80771
80755
|
error(accessNode, Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(objectType));
|
|
@@ -84617,7 +84601,7 @@ function createTypeChecker(host) {
|
|
|
84617
84601
|
checkGrammarModifiers(node);
|
|
84618
84602
|
checkCollisionsForDeclarationName(node, node.name);
|
|
84619
84603
|
checkExportsOnMergedDeclarations(node);
|
|
84620
|
-
node.members.forEach(
|
|
84604
|
+
node.members.forEach(checkSourceElement);
|
|
84621
84605
|
if (compilerOptions.erasableSyntaxOnly && !(node.flags & 33554432 /* Ambient */)) {
|
|
84622
84606
|
error(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
|
|
84623
84607
|
}
|
|
@@ -85112,11 +85096,10 @@ function createTypeChecker(host) {
|
|
|
85112
85096
|
return;
|
|
85113
85097
|
}
|
|
85114
85098
|
checkGrammarModifiers(node);
|
|
85115
|
-
|
|
85116
|
-
if (compilerOptions.erasableSyntaxOnly && isImportEquals && !(node.flags & 33554432 /* Ambient */)) {
|
|
85099
|
+
if (compilerOptions.erasableSyntaxOnly && !(node.flags & 33554432 /* Ambient */)) {
|
|
85117
85100
|
error(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
|
|
85118
85101
|
}
|
|
85119
|
-
if (
|
|
85102
|
+
if (isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) {
|
|
85120
85103
|
checkImportBinding(node);
|
|
85121
85104
|
markLinkedReferences(node, 6 /* ExportImportEquals */);
|
|
85122
85105
|
if (node.moduleReference.kind !== 283 /* ExternalModuleReference */) {
|
|
@@ -85236,6 +85219,9 @@ function createTypeChecker(host) {
|
|
|
85236
85219
|
if (checkGrammarModuleElementContext(node, illegalContextMessage)) {
|
|
85237
85220
|
return;
|
|
85238
85221
|
}
|
|
85222
|
+
if (compilerOptions.erasableSyntaxOnly && node.isExportEquals && !(node.flags & 33554432 /* Ambient */)) {
|
|
85223
|
+
error(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
|
|
85224
|
+
}
|
|
85239
85225
|
const container = node.parent.kind === 307 /* SourceFile */ ? node.parent : node.parent.parent;
|
|
85240
85226
|
if (container.kind === 267 /* ModuleDeclaration */ && !isAmbientModule(container)) {
|
|
85241
85227
|
if (node.isExportEquals) {
|
|
@@ -85576,6 +85562,8 @@ function createTypeChecker(host) {
|
|
|
85576
85562
|
return checkTypeAliasDeclaration(node);
|
|
85577
85563
|
case 266 /* EnumDeclaration */:
|
|
85578
85564
|
return checkEnumDeclaration(node);
|
|
85565
|
+
case 306 /* EnumMember */:
|
|
85566
|
+
return checkEnumMember(node);
|
|
85579
85567
|
case 267 /* ModuleDeclaration */:
|
|
85580
85568
|
return checkModuleDeclaration(node);
|
|
85581
85569
|
case 272 /* ImportDeclaration */:
|
|
@@ -131909,9 +131897,11 @@ function createSyntacticTypeNodeBuilder(options, resolver) {
|
|
|
131909
131897
|
if (!resolver.canReuseTypeNode(context, node)) {
|
|
131910
131898
|
return resolver.serializeExistingTypeNode(context, node);
|
|
131911
131899
|
}
|
|
131900
|
+
const specifier = rewriteModuleSpecifier2(node, node.argument.literal);
|
|
131901
|
+
const literal = specifier === node.argument.literal ? reuseNode(context, node.argument.literal) : specifier;
|
|
131912
131902
|
return factory.updateImportTypeNode(
|
|
131913
131903
|
node,
|
|
131914
|
-
|
|
131904
|
+
literal === node.argument.literal ? reuseNode(context, node.argument) : factory.createLiteralTypeNode(literal),
|
|
131915
131905
|
visitNode(node.attributes, visitExistingNodeTreeSymbols, isImportAttributes),
|
|
131916
131906
|
visitNode(node.qualifier, visitExistingNodeTreeSymbols, isEntityName),
|
|
131917
131907
|
visitNodes2(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode),
|
|
@@ -132066,10 +132056,7 @@ function createSyntacticTypeNodeBuilder(options, resolver) {
|
|
|
132066
132056
|
}
|
|
132067
132057
|
function rewriteModuleSpecifier2(parent, lit) {
|
|
132068
132058
|
const newName = resolver.getModuleSpecifierOverride(context, parent, lit);
|
|
132069
|
-
|
|
132070
|
-
return setOriginalNode(factory.createStringLiteral(newName), lit);
|
|
132071
|
-
}
|
|
132072
|
-
return visitNode(lit, visitExistingNodeTreeSymbols, isStringLiteral);
|
|
132059
|
+
return newName ? setOriginalNode(factory.createStringLiteral(newName), lit) : lit;
|
|
132073
132060
|
}
|
|
132074
132061
|
}
|
|
132075
132062
|
}
|
|
@@ -1655,6 +1655,7 @@
|
|
|
1655
1655
|
"This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_2774": "Tato podmínka vždy vrátí hodnotu True, protože tato funkce je vždy definována. Chtěli jste ji místo toho nazvat?",
|
|
1656
1656
|
"This_constructor_function_may_be_converted_to_a_class_declaration_80002": "Tato funkce konstruktoru se může převést na deklaraci třídy.",
|
|
1657
1657
|
"This_expression_is_always_nullish_2871": "Tento výraz má vždy hodnotu null.",
|
|
1658
|
+
"This_expression_is_never_nullish_2881": "Tento výraz nikdy nemá hodnotu null.",
|
|
1658
1659
|
"This_expression_is_not_callable_2349": "Tento výraz se nedá zavolat.",
|
|
1659
1660
|
"This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234": "Tento výraz se nedá volat, protože je to přístupový objekt get. Nechtěli jste ho použít bez ()?",
|
|
1660
1661
|
"This_expression_is_not_constructable_2351": "Tento výraz se nedá vytvořit.",
|
|
@@ -1655,6 +1655,7 @@
|
|
|
1655
1655
|
"This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_2774": "Diese Bedingung gibt immer TRUE zurück, weil diese Funktion immer definiert ist. Möchten Sie sie stattdessen aufrufen?",
|
|
1656
1656
|
"This_constructor_function_may_be_converted_to_a_class_declaration_80002": "Diese Konstruktorfunktion kann in eine Klassendeklaration konvertiert werden.",
|
|
1657
1657
|
"This_expression_is_always_nullish_2871": "Dieser Ausdruck ist immer „NULLISH“.",
|
|
1658
|
+
"This_expression_is_never_nullish_2881": "Dieser binäre Ausdruck ist nie „NULLISH“.",
|
|
1658
1659
|
"This_expression_is_not_callable_2349": "Dieser Ausdruck kann nicht aufgerufen werden.",
|
|
1659
1660
|
"This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234": "Dieser Ausdruck kann nicht aufgerufen werden, weil es sich um eine get-Zugriffsmethode handelt. Möchten Sie den Wert ohne \"()\" verwenden?",
|
|
1660
1661
|
"This_expression_is_not_constructable_2351": "Dieser Ausdruck kann nicht erstellt werden.",
|
|
@@ -1655,6 +1655,7 @@
|
|
|
1655
1655
|
"This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_2774": "Esta condición siempre devolverá true, porque esta función se define siempre. ¿Pretendía llamarla en su lugar?",
|
|
1656
1656
|
"This_constructor_function_may_be_converted_to_a_class_declaration_80002": "Esta función de constructor puede convertirse en una declaración de clase.",
|
|
1657
1657
|
"This_expression_is_always_nullish_2871": "Esta expresión siempre acepta valores NULL.",
|
|
1658
|
+
"This_expression_is_never_nullish_2881": "Esta expresión nunca es nula.",
|
|
1658
1659
|
"This_expression_is_not_callable_2349": "No se puede llamar a esta expresión.",
|
|
1659
1660
|
"This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234": "No se puede llamar a esta expresión porque es un descriptor de acceso \"get\". ¿Pretendía usarlo sin \"()\"?",
|
|
1660
1661
|
"This_expression_is_not_constructable_2351": "No se puede construir esta expresión.",
|
|
@@ -1655,6 +1655,7 @@
|
|
|
1655
1655
|
"This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_2774": "Cette condition retourne toujours true, car cette fonction est toujours définie. Est-ce que vous avez voulu l'appeler à la place ?",
|
|
1656
1656
|
"This_constructor_function_may_be_converted_to_a_class_declaration_80002": "Cette fonction constructeur peut être convertie en déclaration de classe.",
|
|
1657
1657
|
"This_expression_is_always_nullish_2871": "Cette expression est toujours nulle.",
|
|
1658
|
+
"This_expression_is_never_nullish_2881": "Cette expression n’est jamais nulle.",
|
|
1658
1659
|
"This_expression_is_not_callable_2349": "Impossible d'appeler cette expression.",
|
|
1659
1660
|
"This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234": "Impossible d'appeler cette expression, car il s'agit d'un accesseur 'get'. Voulez-vous vraiment l'utiliser sans '()' ?",
|
|
1660
1661
|
"This_expression_is_not_constructable_2351": "Impossible de construire cette expression.",
|
|
@@ -1655,6 +1655,7 @@
|
|
|
1655
1655
|
"This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_2774": "Questa condizione restituirà sempre true perché questa funzione è sempre definita. Si intendeva chiamarla?",
|
|
1656
1656
|
"This_constructor_function_may_be_converted_to_a_class_declaration_80002": "Questa funzione del costruttore può essere convertita in una dichiarazione di classe.",
|
|
1657
1657
|
"This_expression_is_always_nullish_2871": "Questa espressione è sempre nullish.",
|
|
1658
|
+
"This_expression_is_never_nullish_2881": "Questa espressione non è mai null.",
|
|
1658
1659
|
"This_expression_is_not_callable_2349": "Questa espressione non può essere chiamata.",
|
|
1659
1660
|
"This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234": "Non è possibile chiamare questa espressione perché è una funzione di accesso 'get'. Si intendeva usarla senza '()'?",
|
|
1660
1661
|
"This_expression_is_not_constructable_2351": "Questa espressione non può essere costruita.",
|
|
@@ -1655,6 +1655,7 @@
|
|
|
1655
1655
|
"This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_2774": "この関数は常に定義されているため、この条件は常に true を返します。代わりにこれを呼び出すことを意図していましたか?",
|
|
1656
1656
|
"This_constructor_function_may_be_converted_to_a_class_declaration_80002": "このコンストラクター関数はクラス宣言に変換される可能性があります。",
|
|
1657
1657
|
"This_expression_is_always_nullish_2871": "この式は常に null です。",
|
|
1658
|
+
"This_expression_is_never_nullish_2881": "この式が NULL 値になることはありません。",
|
|
1658
1659
|
"This_expression_is_not_callable_2349": "この式は呼び出し可能ではありません。",
|
|
1659
1660
|
"This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234": "この式は 'get' アクセサーであるため、呼び出すことができません。'()' なしで使用しますか?",
|
|
1660
1661
|
"This_expression_is_not_constructable_2351": "この式はコンストラクト可能ではありません。",
|
|
@@ -1655,6 +1655,7 @@
|
|
|
1655
1655
|
"This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_2774": "함수가 항상 정의되므로 이 조건은 항상 true를 반환합니다. 대신 호출하시겠어요?",
|
|
1656
1656
|
"This_constructor_function_may_be_converted_to_a_class_declaration_80002": "이 생성자 함수는 클래스 선언으로 변환될 수 있습니다.",
|
|
1657
1657
|
"This_expression_is_always_nullish_2871": "이 식은 항상 nullish입니다.",
|
|
1658
|
+
"This_expression_is_never_nullish_2881": "이 표현식은 nullish가 되지 않습니다.",
|
|
1658
1659
|
"This_expression_is_not_callable_2349": "이 식은 호출할 수 없습니다.",
|
|
1659
1660
|
"This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234": "이 식은 'get' 접근자이므로 호출할 수 없습니다. '()' 없이 사용하시겠습니까?",
|
|
1660
1661
|
"This_expression_is_not_constructable_2351": "이 식은 생성할 수 없습니다.",
|
|
@@ -29,13 +29,13 @@ interface SharedArrayBuffer {
|
|
|
29
29
|
* Returns a section of an SharedArrayBuffer.
|
|
30
30
|
*/
|
|
31
31
|
slice(begin?: number, end?: number): SharedArrayBuffer;
|
|
32
|
-
readonly [Symbol.species]: SharedArrayBuffer;
|
|
33
32
|
readonly [Symbol.toStringTag]: "SharedArrayBuffer";
|
|
34
33
|
}
|
|
35
34
|
|
|
36
35
|
interface SharedArrayBufferConstructor {
|
|
37
36
|
readonly prototype: SharedArrayBuffer;
|
|
38
37
|
new (byteLength?: number): SharedArrayBuffer;
|
|
38
|
+
readonly [Symbol.species]: SharedArrayBufferConstructor;
|
|
39
39
|
}
|
|
40
40
|
declare var SharedArrayBuffer: SharedArrayBufferConstructor;
|
|
41
41
|
|
|
@@ -1655,6 +1655,7 @@
|
|
|
1655
1655
|
"This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_2774": "Ten warunek będzie zawsze zwracał wartość true, ponieważ funkcja jest zawsze zdefiniowana. Czy chcesz wywołać ją zamiast tego?",
|
|
1656
1656
|
"This_constructor_function_may_be_converted_to_a_class_declaration_80002": "Ta funkcja konstruktora może zostać przekonwertowana na deklarację klasy.",
|
|
1657
1657
|
"This_expression_is_always_nullish_2871": "To wyrażenie ma zawsze wartość null.",
|
|
1658
|
+
"This_expression_is_never_nullish_2881": "To wyrażenie nigdy nie ma wartości null.",
|
|
1658
1659
|
"This_expression_is_not_callable_2349": "To wyrażenie nie jest wywoływalne.",
|
|
1659
1660
|
"This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234": "Tego wyrażenia nie można wywoływać, ponieważ jest to metoda dostępu „get”. Czy chodziło Ci o użycie go bez znaków „()”?",
|
|
1660
1661
|
"This_expression_is_not_constructable_2351": "Tego wyrażenia nie można skonstruować.",
|
|
@@ -1655,6 +1655,7 @@
|
|
|
1655
1655
|
"This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_2774": "Esta condição sempre retornará verdadeira, uma vez que esta função foi sempre definida. Você pretendia chamá-la em vez disso?",
|
|
1656
1656
|
"This_constructor_function_may_be_converted_to_a_class_declaration_80002": "Esta função de construtor pode ser convertida em uma declaração de classe.",
|
|
1657
1657
|
"This_expression_is_always_nullish_2871": "Essa expressão sempre é nula.",
|
|
1658
|
+
"This_expression_is_never_nullish_2881": "Esta expressão nunca é nula.",
|
|
1658
1659
|
"This_expression_is_not_callable_2349": "Essa expressão não pode ser chamada.",
|
|
1659
1660
|
"This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234": "Esta expressão não pode ser chamada porque é um acessador 'get'. Você quis usá-la sem '()'?",
|
|
1660
1661
|
"This_expression_is_not_constructable_2351": "Essa expressão não pode ser construída.",
|
|
@@ -1655,6 +1655,7 @@
|
|
|
1655
1655
|
"This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_2774": "Это условие будет всегда возвращать значение true, поскольку функция всегда определена. Возможно, вы хотите вызвать ее?",
|
|
1656
1656
|
"This_constructor_function_may_be_converted_to_a_class_declaration_80002": "Эту функцию конструктора можно преобразовать в объявление класса.",
|
|
1657
1657
|
"This_expression_is_always_nullish_2871": "Это выражение всегда равно нулю.",
|
|
1658
|
+
"This_expression_is_never_nullish_2881": "Это выражение никогда не принимает значение null.",
|
|
1658
1659
|
"This_expression_is_not_callable_2349": "Это выражение не является вызываемым.",
|
|
1659
1660
|
"This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234": "Это выражение не может быть вызвано, так как оно является методом доступа get. Вы хотели использовать его без \"()\"?",
|
|
1660
1661
|
"This_expression_is_not_constructable_2351": "Это выражение не может быть построено.",
|
|
@@ -1655,6 +1655,7 @@
|
|
|
1655
1655
|
"This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_2774": "İşlev her zaman tanımlı olduğundan bu koşul her zaman true döndürür. Bunun yerine işlevi çağırmayı mı istediniz?",
|
|
1656
1656
|
"This_constructor_function_may_be_converted_to_a_class_declaration_80002": "Bu oluşturucu işlevi bir sınıf bildirimine dönüştürülebilir.",
|
|
1657
1657
|
"This_expression_is_always_nullish_2871": "Bu ifade her zaman boş değerlidir.",
|
|
1658
|
+
"This_expression_is_never_nullish_2881": "Bu ifade hiçbir zaman boş gibi değildir.",
|
|
1658
1659
|
"This_expression_is_not_callable_2349": "Bu ifade çağrılabilir değil.",
|
|
1659
1660
|
"This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234": "Bu ifade 'get' erişimcisi olduğundan çağrılamaz. Bunu '()' olmadan mı kullanmak istiyorsunuz?",
|
|
1660
1661
|
"This_expression_is_not_constructable_2351": "Bu ifade oluşturulabilir değil.",
|
package/lib/typescript.d.ts
CHANGED
|
@@ -3634,7 +3634,7 @@ declare namespace ts {
|
|
|
3634
3634
|
readDirectory(rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[] | undefined, depth?: number): string[];
|
|
3635
3635
|
}
|
|
3636
3636
|
}
|
|
3637
|
-
const versionMajorMinor = "5.
|
|
3637
|
+
const versionMajorMinor = "5.9";
|
|
3638
3638
|
/** The version of the TypeScript compiler release */
|
|
3639
3639
|
const version: string;
|
|
3640
3640
|
/**
|
package/lib/typescript.js
CHANGED
|
@@ -2284,8 +2284,8 @@ __export(typescript_exports, {
|
|
|
2284
2284
|
module.exports = __toCommonJS(typescript_exports);
|
|
2285
2285
|
|
|
2286
2286
|
// src/compiler/corePublic.ts
|
|
2287
|
-
var versionMajorMinor = "5.
|
|
2288
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2287
|
+
var versionMajorMinor = "5.9";
|
|
2288
|
+
var version = `${versionMajorMinor}.0-insiders.20250228`;
|
|
2289
2289
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2290
2290
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2291
2291
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -10211,6 +10211,7 @@ var Diagnostics = {
|
|
|
10211
10211
|
This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_between_the_projects_output_files_is_not_the_same_as_the_relative_path_between_its_input_files: diag(2878, 1 /* Error */, "This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_b_2878", "This import path is unsafe to rewrite because it resolves to another project, and the relative path between the projects' output files is not the same as the relative path between its input files."),
|
|
10212
10212
|
Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found: diag(2879, 1 /* Error */, "Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found_2879", "Using JSX fragments requires fragment factory '{0}' to be in scope, but it could not be found."),
|
|
10213
10213
|
Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert: diag(2880, 1 /* Error */, "Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert_2880", "Import assertions have been replaced by import attributes. Use 'with' instead of 'assert'."),
|
|
10214
|
+
This_expression_is_never_nullish: diag(2881, 1 /* Error */, "This_expression_is_never_nullish_2881", "This expression is never nullish."),
|
|
10214
10215
|
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}'."),
|
|
10215
10216
|
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}'."),
|
|
10216
10217
|
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}'."),
|
|
@@ -10322,6 +10323,7 @@ var Diagnostics = {
|
|
|
10322
10323
|
One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value: diag(4126, 1 /* Error */, "One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value_4126", "One value of '{0}.{1}' is the string '{2}', and the other is assumed to be an unknown numeric value."),
|
|
10323
10324
|
This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic: diag(4127, 1 /* Error */, "This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic_4127", "This member cannot have an 'override' modifier because its name is dynamic."),
|
|
10324
10325
|
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic: diag(4128, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic_4128", "This member cannot have a JSDoc comment with an '@override' tag because its name is dynamic."),
|
|
10326
|
+
Private_or_protected_member_0_cannot_be_accessed_via_indexed_access: diag(4129, 1 /* Error */, "Private_or_protected_member_0_cannot_be_accessed_via_indexed_access_4129", "Private or protected member '{0}' cannot be accessed via indexed access."),
|
|
10325
10327
|
The_current_host_does_not_support_the_0_option: diag(5001, 1 /* Error */, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
|
|
10326
10328
|
Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, 1 /* Error */, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
|
|
10327
10329
|
File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, 1 /* Error */, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
|
|
@@ -55092,6 +55094,7 @@ function createTypeChecker(host) {
|
|
|
55092
55094
|
const context = syntacticContext;
|
|
55093
55095
|
if (context.bundled || context.enclosingFile !== getSourceFileOfNode(lit)) {
|
|
55094
55096
|
let name = lit.text;
|
|
55097
|
+
const originalName = name;
|
|
55095
55098
|
const nodeSymbol = getNodeLinks(parent2).resolvedSymbol;
|
|
55096
55099
|
const meaning = parent2.isTypeOf ? 111551 /* Value */ : 788968 /* Type */;
|
|
55097
55100
|
const parentSymbol = nodeSymbol && isSymbolAccessible(
|
|
@@ -55121,7 +55124,9 @@ function createTypeChecker(host) {
|
|
|
55121
55124
|
context.tracker.reportLikelyUnsafeImportRequiredError(name);
|
|
55122
55125
|
}
|
|
55123
55126
|
}
|
|
55124
|
-
|
|
55127
|
+
if (name !== originalName) {
|
|
55128
|
+
return name;
|
|
55129
|
+
}
|
|
55125
55130
|
}
|
|
55126
55131
|
},
|
|
55127
55132
|
canReuseTypeNode(context, typeNode) {
|
|
@@ -57495,10 +57500,7 @@ function createTypeChecker(host) {
|
|
|
57495
57500
|
/*context*/
|
|
57496
57501
|
void 0
|
|
57497
57502
|
);
|
|
57498
|
-
|
|
57499
|
-
setTextRange2(context, updated, node2);
|
|
57500
|
-
}
|
|
57501
|
-
return updated;
|
|
57503
|
+
return setTextRange2(context, updated, node2);
|
|
57502
57504
|
}
|
|
57503
57505
|
}
|
|
57504
57506
|
function serializeTypeName(context, node, isTypeOf, typeArguments) {
|
|
@@ -60212,7 +60214,7 @@ function createTypeChecker(host) {
|
|
|
60212
60214
|
if (reportErrors2) {
|
|
60213
60215
|
reportErrorsFromWidening(declaration, type);
|
|
60214
60216
|
}
|
|
60215
|
-
if (type.flags & 8192 /* UniqueESSymbol */ && (isBindingElement(declaration) || !declaration
|
|
60217
|
+
if (type.flags & 8192 /* UniqueESSymbol */ && (isBindingElement(declaration) || !tryGetTypeFromEffectiveTypeNode(declaration)) && type.symbol !== getSymbolOfDeclaration(declaration)) {
|
|
60216
60218
|
type = esSymbolType;
|
|
60217
60219
|
}
|
|
60218
60220
|
return getWidenedType(type);
|
|
@@ -63182,7 +63184,7 @@ function createTypeChecker(host) {
|
|
|
63182
63184
|
let hasThisParameter2 = false;
|
|
63183
63185
|
const iife = getImmediatelyInvokedFunctionExpression(declaration);
|
|
63184
63186
|
const isJSConstructSignature = isJSDocConstructSignature(declaration);
|
|
63185
|
-
const isUntypedSignatureInJSFile = !iife && isInJSFile(declaration) && isValueSignatureDeclaration(declaration) && !hasJSDocParameterTags(declaration) && !getJSDocType(declaration);
|
|
63187
|
+
const isUntypedSignatureInJSFile = !iife && isInJSFile(declaration) && isValueSignatureDeclaration(declaration) && !hasJSDocParameterTags(declaration) && !getJSDocType(declaration) && !getContextualSignatureForFunctionLikeDeclaration(declaration);
|
|
63186
63188
|
if (isUntypedSignatureInJSFile) {
|
|
63187
63189
|
flags |= 32 /* IsUntypedSignatureInJSFile */;
|
|
63188
63190
|
}
|
|
@@ -72123,7 +72125,7 @@ function createTypeChecker(host) {
|
|
|
72123
72125
|
value,
|
|
72124
72126
|
/*roundTripOnly*/
|
|
72125
72127
|
false
|
|
72126
|
-
) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(
|
|
72128
|
+
) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(source, target) || target.flags & 134217728 /* TemplateLiteral */ && isTypeMatchedByTemplateLiteralType(source, target));
|
|
72127
72129
|
}
|
|
72128
72130
|
if (source.flags & 134217728 /* TemplateLiteral */) {
|
|
72129
72131
|
const texts = source.texts;
|
|
@@ -74311,7 +74313,7 @@ function createTypeChecker(host) {
|
|
|
74311
74313
|
if (isBindingPattern(reference) || isFunctionExpressionOrArrowFunction(reference) || isObjectLiteralMethod(reference)) {
|
|
74312
74314
|
if (isIdentifier(expr)) {
|
|
74313
74315
|
const symbol = getResolvedSymbol(expr);
|
|
74314
|
-
const declaration = symbol.valueDeclaration;
|
|
74316
|
+
const declaration = getExportSymbolOfValueSymbolIfExported(symbol).valueDeclaration;
|
|
74315
74317
|
if (declaration && (isBindingElement(declaration) || isParameter(declaration)) && reference === declaration.parent && !declaration.initializer && !declaration.dotDotDotToken) {
|
|
74316
74318
|
return declaration;
|
|
74317
74319
|
}
|
|
@@ -76953,50 +76955,6 @@ function createTypeChecker(host) {
|
|
|
76953
76955
|
)
|
|
76954
76956
|
);
|
|
76955
76957
|
}
|
|
76956
|
-
function discriminateContextualTypeByArrayElements(node, contextualType) {
|
|
76957
|
-
const key = `D${getNodeId(node)},${getTypeId(contextualType)}`;
|
|
76958
|
-
const cachedType = getCachedType(key);
|
|
76959
|
-
if (cachedType) return cachedType;
|
|
76960
|
-
const isIndexPropertyLike = (property) => /^[-+]?\d+$/.test(property.escapedName);
|
|
76961
|
-
const hasIndexPropertyOutOfRange = (type, length2) => some(getPropertiesOfType(type), (p) => {
|
|
76962
|
-
if (p.flags & 16777216 /* Optional */ || !isIndexPropertyLike(p)) return false;
|
|
76963
|
-
const index = +p.escapedName;
|
|
76964
|
-
return index < 0 || index >= length2;
|
|
76965
|
-
});
|
|
76966
|
-
const hasIndexPropertyInRange = (type, length2) => some(getPropertiesOfType(type), (p) => {
|
|
76967
|
-
if (!isIndexPropertyLike(p)) return false;
|
|
76968
|
-
const index = +p.escapedName;
|
|
76969
|
-
return index >= 0 || index < length2;
|
|
76970
|
-
});
|
|
76971
|
-
const elementsLength = node.elements.length;
|
|
76972
|
-
const filteredType = filterType(contextualType, (type) => {
|
|
76973
|
-
if (isTupleType(type)) {
|
|
76974
|
-
return elementsLength >= type.target.minLength && (!!(type.target.combinedFlags & 12 /* Variable */) || elementsLength <= type.target.fixedLength);
|
|
76975
|
-
}
|
|
76976
|
-
return !hasIndexPropertyOutOfRange(type, elementsLength);
|
|
76977
|
-
});
|
|
76978
|
-
if (filteredType.flags & 131072 /* Never */) return setCachedType(key, contextualType);
|
|
76979
|
-
if (!(filteredType.flags & 1048576 /* Union */)) {
|
|
76980
|
-
return setCachedType(
|
|
76981
|
-
key,
|
|
76982
|
-
isTupleType(filteredType) || hasIndexPropertyInRange(filteredType, elementsLength) ? filteredType : contextualType
|
|
76983
|
-
);
|
|
76984
|
-
}
|
|
76985
|
-
return setCachedType(
|
|
76986
|
-
key,
|
|
76987
|
-
discriminateTypeByDiscriminableItems(
|
|
76988
|
-
filteredType,
|
|
76989
|
-
filter(
|
|
76990
|
-
map(node.elements, (element, index) => {
|
|
76991
|
-
const name = "" + index;
|
|
76992
|
-
return isPossiblyDiscriminantValue(element) && isDiscriminantProperty(filteredType, name) ? [() => getContextFreeTypeOfExpression(element), name] : void 0;
|
|
76993
|
-
}),
|
|
76994
|
-
(discriminator) => !!discriminator
|
|
76995
|
-
),
|
|
76996
|
-
isTypeAssignableTo
|
|
76997
|
-
)
|
|
76998
|
-
);
|
|
76999
|
-
}
|
|
77000
76958
|
function getApparentTypeOfContextualType(node, contextFlags) {
|
|
77001
76959
|
const contextualType = isObjectLiteralMethod(node) ? getContextualTypeForObjectLiteralMethod(node, contextFlags) : getContextualType2(node, contextFlags);
|
|
77002
76960
|
const instantiatedType = instantiateContextualType(contextualType, node, contextFlags);
|
|
@@ -77011,12 +76969,7 @@ function createTypeChecker(host) {
|
|
|
77011
76969
|
/*noReductions*/
|
|
77012
76970
|
true
|
|
77013
76971
|
);
|
|
77014
|
-
|
|
77015
|
-
if (isObjectLiteralExpression(node)) return discriminateContextualTypeByObjectMembers(node, apparentType);
|
|
77016
|
-
if (isJsxAttributes(node)) return discriminateContextualTypeByJSXAttributes(node, apparentType);
|
|
77017
|
-
if (isArrayLiteralExpression(node)) return discriminateContextualTypeByArrayElements(node, apparentType);
|
|
77018
|
-
}
|
|
77019
|
-
return apparentType;
|
|
76972
|
+
return apparentType.flags & 1048576 /* Union */ && isObjectLiteralExpression(node) ? discriminateContextualTypeByObjectMembers(node, apparentType) : apparentType.flags & 1048576 /* Union */ && isJsxAttributes(node) ? discriminateContextualTypeByJSXAttributes(node, apparentType) : apparentType;
|
|
77020
76973
|
}
|
|
77021
76974
|
}
|
|
77022
76975
|
function instantiateContextualType(contextualType, node, contextFlags) {
|
|
@@ -81913,14 +81866,14 @@ function createTypeChecker(host) {
|
|
|
81913
81866
|
function getTypeOfFirstParameterOfSignatureWithFallback(signature, fallbackType) {
|
|
81914
81867
|
return signature.parameters.length > 0 ? getTypeAtPosition(signature, 0) : fallbackType;
|
|
81915
81868
|
}
|
|
81916
|
-
function
|
|
81869
|
+
function inferFromAnnotatedParametersAndReturn(signature, context, inferenceContext) {
|
|
81917
81870
|
const len = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);
|
|
81918
81871
|
for (let i = 0; i < len; i++) {
|
|
81919
81872
|
const declaration = signature.parameters[i].valueDeclaration;
|
|
81920
|
-
const
|
|
81921
|
-
if (
|
|
81873
|
+
const typeNode2 = getEffectiveTypeAnnotationNode(declaration);
|
|
81874
|
+
if (typeNode2) {
|
|
81922
81875
|
const source = addOptionality(
|
|
81923
|
-
getTypeFromTypeNode(
|
|
81876
|
+
getTypeFromTypeNode(typeNode2),
|
|
81924
81877
|
/*isProperty*/
|
|
81925
81878
|
false,
|
|
81926
81879
|
isOptionalDeclaration(declaration)
|
|
@@ -81929,6 +81882,12 @@ function createTypeChecker(host) {
|
|
|
81929
81882
|
inferTypes(inferenceContext.inferences, source, target);
|
|
81930
81883
|
}
|
|
81931
81884
|
}
|
|
81885
|
+
const typeNode = signature.declaration && getEffectiveReturnTypeNode(signature.declaration);
|
|
81886
|
+
if (typeNode) {
|
|
81887
|
+
const source = getTypeFromTypeNode(typeNode);
|
|
81888
|
+
const target = getReturnTypeOfSignature(context);
|
|
81889
|
+
inferTypes(inferenceContext.inferences, source, target);
|
|
81890
|
+
}
|
|
81932
81891
|
}
|
|
81933
81892
|
function assignContextualParameterTypes(signature, context) {
|
|
81934
81893
|
if (context.typeParameters) {
|
|
@@ -82622,7 +82581,7 @@ function createTypeChecker(host) {
|
|
|
82622
82581
|
const trueType2 = getFlowTypeOfReference(param.name, initType, initType, func, trueCondition);
|
|
82623
82582
|
if (trueType2 === initType) return void 0;
|
|
82624
82583
|
const falseCondition = createFlowNode(64 /* FalseCondition */, expr, antecedent);
|
|
82625
|
-
const falseSubtype = getFlowTypeOfReference(param.name, initType, trueType2, func, falseCondition);
|
|
82584
|
+
const falseSubtype = getReducedType(getFlowTypeOfReference(param.name, initType, trueType2, func, falseCondition));
|
|
82626
82585
|
return falseSubtype.flags & 131072 /* Never */ ? trueType2 : void 0;
|
|
82627
82586
|
}
|
|
82628
82587
|
function checkAllCodePathsInNonVoidFunctionReturnOrThrow(func, returnType) {
|
|
@@ -82717,7 +82676,7 @@ function createTypeChecker(host) {
|
|
|
82717
82676
|
const inferenceContext = getInferenceContext(node);
|
|
82718
82677
|
let instantiatedContextualSignature;
|
|
82719
82678
|
if (checkMode && checkMode & 2 /* Inferential */) {
|
|
82720
|
-
|
|
82679
|
+
inferFromAnnotatedParametersAndReturn(signature, contextualSignature, inferenceContext);
|
|
82721
82680
|
const restType = getEffectiveRestType(contextualSignature);
|
|
82722
82681
|
if (restType && restType.flags & 262144 /* TypeParameter */) {
|
|
82723
82682
|
instantiatedContextualSignature = instantiateSignature(contextualSignature, inferenceContext.nonFixingMapper);
|
|
@@ -82731,7 +82690,7 @@ function createTypeChecker(host) {
|
|
|
82731
82690
|
} else if (contextualSignature && !node.typeParameters && contextualSignature.parameters.length > node.parameters.length) {
|
|
82732
82691
|
const inferenceContext = getInferenceContext(node);
|
|
82733
82692
|
if (checkMode && checkMode & 2 /* Inferential */) {
|
|
82734
|
-
|
|
82693
|
+
inferFromAnnotatedParametersAndReturn(signature, contextualSignature, inferenceContext);
|
|
82735
82694
|
}
|
|
82736
82695
|
}
|
|
82737
82696
|
if (contextualSignature && !getReturnTypeFromAnnotation(node) && !signature.resolvedReturnType) {
|
|
@@ -83494,21 +83453,36 @@ function createTypeChecker(host) {
|
|
|
83494
83453
|
if (isBinaryExpression(right) && (right.operatorToken.kind === 57 /* BarBarToken */ || right.operatorToken.kind === 56 /* AmpersandAmpersandToken */)) {
|
|
83495
83454
|
grammarErrorOnNode(right, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(right.operatorToken.kind), tokenToString(operatorToken.kind));
|
|
83496
83455
|
}
|
|
83497
|
-
|
|
83498
|
-
|
|
83499
|
-
|
|
83500
|
-
|
|
83501
|
-
|
|
83502
|
-
|
|
83503
|
-
|
|
83504
|
-
|
|
83505
|
-
|
|
83506
|
-
|
|
83507
|
-
|
|
83508
|
-
|
|
83456
|
+
checkNullishCoalesceOperandLeft(node);
|
|
83457
|
+
checkNullishCoalesceOperandRight(node);
|
|
83458
|
+
}
|
|
83459
|
+
}
|
|
83460
|
+
function checkNullishCoalesceOperandLeft(node) {
|
|
83461
|
+
const leftTarget = skipOuterExpressions(node.left, 63 /* All */);
|
|
83462
|
+
const nullishSemantics = getSyntacticNullishnessSemantics(leftTarget);
|
|
83463
|
+
if (nullishSemantics !== 3 /* Sometimes */) {
|
|
83464
|
+
if (nullishSemantics === 1 /* Always */) {
|
|
83465
|
+
error2(leftTarget, Diagnostics.This_expression_is_always_nullish);
|
|
83466
|
+
} else {
|
|
83467
|
+
error2(leftTarget, Diagnostics.Right_operand_of_is_unreachable_because_the_left_operand_is_never_nullish);
|
|
83509
83468
|
}
|
|
83510
83469
|
}
|
|
83511
83470
|
}
|
|
83471
|
+
function checkNullishCoalesceOperandRight(node) {
|
|
83472
|
+
const rightTarget = skipOuterExpressions(node.right, 63 /* All */);
|
|
83473
|
+
const nullishSemantics = getSyntacticNullishnessSemantics(rightTarget);
|
|
83474
|
+
if (isNotWithinNullishCoalesceExpression(node)) {
|
|
83475
|
+
return;
|
|
83476
|
+
}
|
|
83477
|
+
if (nullishSemantics === 1 /* Always */) {
|
|
83478
|
+
error2(rightTarget, Diagnostics.This_expression_is_always_nullish);
|
|
83479
|
+
} else if (nullishSemantics === 2 /* Never */) {
|
|
83480
|
+
error2(rightTarget, Diagnostics.This_expression_is_never_nullish);
|
|
83481
|
+
}
|
|
83482
|
+
}
|
|
83483
|
+
function isNotWithinNullishCoalesceExpression(node) {
|
|
83484
|
+
return !isBinaryExpression(node.parent) || node.parent.operatorToken.kind !== 61 /* QuestionQuestionToken */;
|
|
83485
|
+
}
|
|
83512
83486
|
function getSyntacticNullishnessSemantics(node) {
|
|
83513
83487
|
node = skipOuterExpressions(node);
|
|
83514
83488
|
switch (node.kind) {
|
|
@@ -85356,6 +85330,18 @@ function createTypeChecker(host) {
|
|
|
85356
85330
|
}
|
|
85357
85331
|
function checkIndexedAccessIndexType(type, accessNode) {
|
|
85358
85332
|
if (!(type.flags & 8388608 /* IndexedAccess */)) {
|
|
85333
|
+
if (isIndexedAccessTypeNode(accessNode)) {
|
|
85334
|
+
const indexType2 = getTypeFromTypeNode(accessNode.indexType);
|
|
85335
|
+
const objectType2 = getTypeFromTypeNode(accessNode.objectType);
|
|
85336
|
+
const propertyName2 = getPropertyNameFromIndex(indexType2, accessNode);
|
|
85337
|
+
if (propertyName2) {
|
|
85338
|
+
const propertySymbol = forEachType(getApparentType(objectType2), (t) => getPropertyOfType(t, propertyName2));
|
|
85339
|
+
if (propertySymbol && getDeclarationModifierFlagsFromSymbol(propertySymbol) & 6 /* NonPublicAccessibilityModifier */) {
|
|
85340
|
+
error2(accessNode, Diagnostics.Private_or_protected_member_0_cannot_be_accessed_via_indexed_access, unescapeLeadingUnderscores(propertyName2));
|
|
85341
|
+
return errorType;
|
|
85342
|
+
}
|
|
85343
|
+
}
|
|
85344
|
+
}
|
|
85359
85345
|
return type;
|
|
85360
85346
|
}
|
|
85361
85347
|
const objectType = type.objectType;
|
|
@@ -85368,14 +85354,12 @@ function createTypeChecker(host) {
|
|
|
85368
85354
|
}
|
|
85369
85355
|
return type;
|
|
85370
85356
|
}
|
|
85371
|
-
|
|
85372
|
-
|
|
85373
|
-
|
|
85374
|
-
|
|
85375
|
-
|
|
85376
|
-
|
|
85377
|
-
return errorType;
|
|
85378
|
-
}
|
|
85357
|
+
const propertyName = getPropertyNameFromIndex(indexType, accessNode);
|
|
85358
|
+
if (propertyName) {
|
|
85359
|
+
const propertySymbol = forEachType(getApparentType(objectType), (t) => getPropertyOfType(t, propertyName));
|
|
85360
|
+
if (propertySymbol && getDeclarationModifierFlagsFromSymbol(propertySymbol) & 6 /* NonPublicAccessibilityModifier */) {
|
|
85361
|
+
error2(accessNode, Diagnostics.Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter, unescapeLeadingUnderscores(propertyName));
|
|
85362
|
+
return errorType;
|
|
85379
85363
|
}
|
|
85380
85364
|
}
|
|
85381
85365
|
error2(accessNode, Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(indexType), typeToString(objectType));
|
|
@@ -89227,7 +89211,7 @@ function createTypeChecker(host) {
|
|
|
89227
89211
|
checkGrammarModifiers(node);
|
|
89228
89212
|
checkCollisionsForDeclarationName(node, node.name);
|
|
89229
89213
|
checkExportsOnMergedDeclarations(node);
|
|
89230
|
-
node.members.forEach(
|
|
89214
|
+
node.members.forEach(checkSourceElement);
|
|
89231
89215
|
if (compilerOptions.erasableSyntaxOnly && !(node.flags & 33554432 /* Ambient */)) {
|
|
89232
89216
|
error2(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
|
|
89233
89217
|
}
|
|
@@ -89722,11 +89706,10 @@ function createTypeChecker(host) {
|
|
|
89722
89706
|
return;
|
|
89723
89707
|
}
|
|
89724
89708
|
checkGrammarModifiers(node);
|
|
89725
|
-
|
|
89726
|
-
if (compilerOptions.erasableSyntaxOnly && isImportEquals && !(node.flags & 33554432 /* Ambient */)) {
|
|
89709
|
+
if (compilerOptions.erasableSyntaxOnly && !(node.flags & 33554432 /* Ambient */)) {
|
|
89727
89710
|
error2(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
|
|
89728
89711
|
}
|
|
89729
|
-
if (
|
|
89712
|
+
if (isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) {
|
|
89730
89713
|
checkImportBinding(node);
|
|
89731
89714
|
markLinkedReferences(node, 6 /* ExportImportEquals */);
|
|
89732
89715
|
if (node.moduleReference.kind !== 283 /* ExternalModuleReference */) {
|
|
@@ -89846,6 +89829,9 @@ function createTypeChecker(host) {
|
|
|
89846
89829
|
if (checkGrammarModuleElementContext(node, illegalContextMessage)) {
|
|
89847
89830
|
return;
|
|
89848
89831
|
}
|
|
89832
|
+
if (compilerOptions.erasableSyntaxOnly && node.isExportEquals && !(node.flags & 33554432 /* Ambient */)) {
|
|
89833
|
+
error2(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
|
|
89834
|
+
}
|
|
89849
89835
|
const container = node.parent.kind === 307 /* SourceFile */ ? node.parent : node.parent.parent;
|
|
89850
89836
|
if (container.kind === 267 /* ModuleDeclaration */ && !isAmbientModule(container)) {
|
|
89851
89837
|
if (node.isExportEquals) {
|
|
@@ -90186,6 +90172,8 @@ function createTypeChecker(host) {
|
|
|
90186
90172
|
return checkTypeAliasDeclaration(node);
|
|
90187
90173
|
case 266 /* EnumDeclaration */:
|
|
90188
90174
|
return checkEnumDeclaration(node);
|
|
90175
|
+
case 306 /* EnumMember */:
|
|
90176
|
+
return checkEnumMember(node);
|
|
90189
90177
|
case 267 /* ModuleDeclaration */:
|
|
90190
90178
|
return checkModuleDeclaration(node);
|
|
90191
90179
|
case 272 /* ImportDeclaration */:
|
|
@@ -136876,9 +136864,11 @@ function createSyntacticTypeNodeBuilder(options, resolver) {
|
|
|
136876
136864
|
if (!resolver.canReuseTypeNode(context, node)) {
|
|
136877
136865
|
return resolver.serializeExistingTypeNode(context, node);
|
|
136878
136866
|
}
|
|
136867
|
+
const specifier = rewriteModuleSpecifier2(node, node.argument.literal);
|
|
136868
|
+
const literal = specifier === node.argument.literal ? reuseNode(context, node.argument.literal) : specifier;
|
|
136879
136869
|
return factory.updateImportTypeNode(
|
|
136880
136870
|
node,
|
|
136881
|
-
|
|
136871
|
+
literal === node.argument.literal ? reuseNode(context, node.argument) : factory.createLiteralTypeNode(literal),
|
|
136882
136872
|
visitNode(node.attributes, visitExistingNodeTreeSymbols, isImportAttributes),
|
|
136883
136873
|
visitNode(node.qualifier, visitExistingNodeTreeSymbols, isEntityName),
|
|
136884
136874
|
visitNodes2(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode),
|
|
@@ -137033,10 +137023,7 @@ function createSyntacticTypeNodeBuilder(options, resolver) {
|
|
|
137033
137023
|
}
|
|
137034
137024
|
function rewriteModuleSpecifier2(parent2, lit) {
|
|
137035
137025
|
const newName = resolver.getModuleSpecifierOverride(context, parent2, lit);
|
|
137036
|
-
|
|
137037
|
-
return setOriginalNode(factory.createStringLiteral(newName), lit);
|
|
137038
|
-
}
|
|
137039
|
-
return visitNode(lit, visitExistingNodeTreeSymbols, isStringLiteral);
|
|
137026
|
+
return newName ? setOriginalNode(factory.createStringLiteral(newName), lit) : lit;
|
|
137040
137027
|
}
|
|
137041
137028
|
}
|
|
137042
137029
|
}
|
|
@@ -144212,6 +144199,7 @@ function computeSuggestionDiagnostics(sourceFile, program, cancellationToken) {
|
|
|
144212
144199
|
if (getAllowSyntheticDefaultImports(program.getCompilerOptions())) {
|
|
144213
144200
|
for (const moduleSpecifier of sourceFile.imports) {
|
|
144214
144201
|
const importNode = importFromModuleSpecifier(moduleSpecifier);
|
|
144202
|
+
if (isImportEqualsDeclaration(importNode) && hasSyntacticModifier(importNode, 32 /* Export */)) continue;
|
|
144215
144203
|
const name = importNameForConvertToDefaultImport(importNode);
|
|
144216
144204
|
if (!name) continue;
|
|
144217
144205
|
const module2 = (_a = program.getResolvedModuleFromModuleSpecifier(moduleSpecifier, sourceFile)) == null ? void 0 : _a.resolvedModule;
|
|
@@ -164437,10 +164425,14 @@ function typeNodeToAutoImportableTypeNode(typeNode, importAdder, scriptTarget) {
|
|
|
164437
164425
|
return getSynthesizedDeepClone(typeNode);
|
|
164438
164426
|
}
|
|
164439
164427
|
function endOfRequiredTypeParameters(checker, type) {
|
|
164428
|
+
var _a;
|
|
164440
164429
|
Debug.assert(type.typeArguments);
|
|
164441
164430
|
const fullTypeArguments = type.typeArguments;
|
|
164442
164431
|
const target = type.target;
|
|
164443
164432
|
for (let cutoff = 0; cutoff < fullTypeArguments.length; cutoff++) {
|
|
164433
|
+
if (((_a = target.localTypeParameters) == null ? void 0 : _a[cutoff].constraint) === void 0) {
|
|
164434
|
+
continue;
|
|
164435
|
+
}
|
|
164444
164436
|
const typeArguments = fullTypeArguments.slice(0, cutoff);
|
|
164445
164437
|
const filledIn = checker.fillMissingTypeArguments(
|
|
164446
164438
|
typeArguments,
|
|
@@ -170150,6 +170142,17 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, program,
|
|
|
170150
170142
|
const existing = new Set(namedImportsOrExports.elements.map((n) => moduleExportNameTextEscaped(n.propertyName || n.name)));
|
|
170151
170143
|
const uniques = exports2.filter((e) => e.escapedName !== "default" /* Default */ && !existing.has(e.escapedName));
|
|
170152
170144
|
return { kind: 1 /* Properties */, symbols: uniques, hasIndexSignature: false };
|
|
170145
|
+
case 226 /* BinaryExpression */:
|
|
170146
|
+
if (parent2.operatorToken.kind === 103 /* InKeyword */) {
|
|
170147
|
+
const type = typeChecker.getTypeAtLocation(parent2.right);
|
|
170148
|
+
const properties = type.isUnion() ? typeChecker.getAllPossiblePropertiesOfTypes(type.types) : type.getApparentProperties();
|
|
170149
|
+
return {
|
|
170150
|
+
kind: 1 /* Properties */,
|
|
170151
|
+
symbols: properties.filter((prop) => !prop.valueDeclaration || !isPrivateIdentifierClassElementDeclaration(prop.valueDeclaration)),
|
|
170152
|
+
hasIndexSignature: false
|
|
170153
|
+
};
|
|
170154
|
+
}
|
|
170155
|
+
return fromContextualType(0 /* None */);
|
|
170153
170156
|
default:
|
|
170154
170157
|
return fromContextualType() || fromContextualType(0 /* None */);
|
|
170155
170158
|
}
|
|
@@ -173278,8 +173281,8 @@ var Core;
|
|
|
173278
173281
|
if (!(symbol2.flags & (32 /* Class */ | 64 /* Interface */)) || !addToSeen(seen, symbol2)) return;
|
|
173279
173282
|
return firstDefined(symbol2.declarations, (declaration) => firstDefined(getAllSuperTypeNodes(declaration), (typeReference) => {
|
|
173280
173283
|
const type = checker.getTypeAtLocation(typeReference);
|
|
173281
|
-
const propertySymbol = type
|
|
173282
|
-
return
|
|
173284
|
+
const propertySymbol = type.symbol && checker.getPropertyOfType(type, propertyName);
|
|
173285
|
+
return propertySymbol && firstDefined(checker.getRootSymbols(propertySymbol), cb) || type.symbol && recur(type.symbol);
|
|
173283
173286
|
}));
|
|
173284
173287
|
}
|
|
173285
173288
|
}
|
|
@@ -181975,6 +181978,11 @@ var SmartIndenter;
|
|
|
181975
181978
|
return false;
|
|
181976
181979
|
}
|
|
181977
181980
|
break;
|
|
181981
|
+
case 258 /* TryStatement */:
|
|
181982
|
+
if (childKind === 241 /* Block */) {
|
|
181983
|
+
return false;
|
|
181984
|
+
}
|
|
181985
|
+
break;
|
|
181978
181986
|
}
|
|
181979
181987
|
return indentByDefault;
|
|
181980
181988
|
}
|
|
@@ -1655,6 +1655,7 @@
|
|
|
1655
1655
|
"This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_2774": "此条件将始终返回 true,因为始终定义了函数。你是想改为调用它吗?",
|
|
1656
1656
|
"This_constructor_function_may_be_converted_to_a_class_declaration_80002": "此构造函数可能会转换为类声明。",
|
|
1657
1657
|
"This_expression_is_always_nullish_2871": "此表达式始终为 null。",
|
|
1658
|
+
"This_expression_is_never_nullish_2881": "此表达式从不为 null。",
|
|
1658
1659
|
"This_expression_is_not_callable_2349": "此表达式不可调用。",
|
|
1659
1660
|
"This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234": "此表达式是 \"get\" 访问器,因此不可调用。你想在不使用 \"()\" 的情况下使用它吗?",
|
|
1660
1661
|
"This_expression_is_not_constructable_2351": "此表达式不可构造。",
|
|
@@ -1655,6 +1655,7 @@
|
|
|
1655
1655
|
"This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_2774": "因為永遠會定義此函式,所以此條件永遠會傳回 true。您是要改為呼叫該條件嗎?",
|
|
1656
1656
|
"This_constructor_function_may_be_converted_to_a_class_declaration_80002": "此建構函式可轉換為類別宣告。",
|
|
1657
1657
|
"This_expression_is_always_nullish_2871": "此運算式一律為 nullish.",
|
|
1658
|
+
"This_expression_is_never_nullish_2881": "此運算式一律不會是 nullish。",
|
|
1658
1659
|
"This_expression_is_not_callable_2349": "無法呼叫此運算式。",
|
|
1659
1660
|
"This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without_6234": "因為此運算式為 'get' 存取子,所以無法呼叫。要在沒有 '()' 的情況下,使用該運算式嗎?",
|
|
1660
1661
|
"This_expression_is_not_constructable_2351": "無法建構此運算式。",
|
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.
|
|
5
|
+
"version": "5.9.0-pr-61291-4",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -40,48 +40,48 @@
|
|
|
40
40
|
],
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@dprint/formatter": "^0.4.1",
|
|
43
|
-
"@dprint/typescript": "0.93.
|
|
43
|
+
"@dprint/typescript": "0.93.4",
|
|
44
44
|
"@esfx/canceltoken": "^1.0.0",
|
|
45
|
-
"@eslint/js": "^9.
|
|
46
|
-
"@octokit/rest": "^21.
|
|
45
|
+
"@eslint/js": "^9.20.0",
|
|
46
|
+
"@octokit/rest": "^21.1.1",
|
|
47
47
|
"@types/chai": "^4.3.20",
|
|
48
|
-
"@types/diff": "^
|
|
48
|
+
"@types/diff": "^7.0.1",
|
|
49
49
|
"@types/minimist": "^1.2.5",
|
|
50
50
|
"@types/mocha": "^10.0.10",
|
|
51
51
|
"@types/ms": "^0.7.34",
|
|
52
52
|
"@types/node": "latest",
|
|
53
53
|
"@types/source-map-support": "^0.5.10",
|
|
54
54
|
"@types/which": "^3.0.4",
|
|
55
|
-
"@typescript-eslint/rule-tester": "^8.
|
|
56
|
-
"@typescript-eslint/type-utils": "^8.
|
|
57
|
-
"@typescript-eslint/utils": "^8.
|
|
55
|
+
"@typescript-eslint/rule-tester": "^8.24.1",
|
|
56
|
+
"@typescript-eslint/type-utils": "^8.24.1",
|
|
57
|
+
"@typescript-eslint/utils": "^8.24.1",
|
|
58
58
|
"azure-devops-node-api": "^14.1.0",
|
|
59
59
|
"c8": "^10.1.3",
|
|
60
60
|
"chai": "^4.5.0",
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"dprint": "^0.47.6",
|
|
61
|
+
"chokidar": "^4.0.3",
|
|
62
|
+
"diff": "^7.0.0",
|
|
63
|
+
"dprint": "^0.49.0",
|
|
65
64
|
"esbuild": "^0.25.0",
|
|
66
|
-
"eslint": "^9.
|
|
65
|
+
"eslint": "^9.20.1",
|
|
67
66
|
"eslint-formatter-autolinkable-stylish": "^1.4.0",
|
|
68
67
|
"eslint-plugin-regexp": "^2.7.0",
|
|
69
|
-
"fast-xml-parser": "^4.5.
|
|
68
|
+
"fast-xml-parser": "^4.5.2",
|
|
70
69
|
"glob": "^10.4.5",
|
|
71
|
-
"globals": "^15.
|
|
70
|
+
"globals": "^15.15.0",
|
|
72
71
|
"hereby": "^1.10.0",
|
|
73
72
|
"jsonc-parser": "^3.3.1",
|
|
74
|
-
"knip": "^5.
|
|
73
|
+
"knip": "^5.44.4",
|
|
75
74
|
"minimist": "^1.2.8",
|
|
76
75
|
"mocha": "^10.8.2",
|
|
77
76
|
"mocha-fivemat-progress-reporter": "^0.1.0",
|
|
78
|
-
"monocart-coverage-reports": "^2.
|
|
77
|
+
"monocart-coverage-reports": "^2.12.1",
|
|
79
78
|
"ms": "^2.1.3",
|
|
80
|
-
"
|
|
79
|
+
"picocolors": "^1.1.1",
|
|
80
|
+
"playwright": "^1.50.1",
|
|
81
81
|
"source-map-support": "^0.5.21",
|
|
82
82
|
"tslib": "^2.8.1",
|
|
83
|
-
"typescript": "^5.7.
|
|
84
|
-
"typescript-eslint": "^8.
|
|
83
|
+
"typescript": "^5.7.3",
|
|
84
|
+
"typescript-eslint": "^8.24.1",
|
|
85
85
|
"which": "^3.0.1"
|
|
86
86
|
},
|
|
87
87
|
"overrides": {
|