typescript 5.9.0-dev.20250220 → 5.9.0-dev.20250222
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 +46 -22
- package/lib/typescript.js +60 -24
- package/package.json +2 -2
package/lib/_tsc.js
CHANGED
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
18
18
|
|
19
19
|
// src/compiler/corePublic.ts
|
20
20
|
var versionMajorMinor = "5.9";
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20250222`;
|
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}'."),
|
@@ -67513,7 +67514,7 @@ function createTypeChecker(host) {
|
|
67513
67514
|
value,
|
67514
67515
|
/*roundTripOnly*/
|
67515
67516
|
false
|
67516
|
-
) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(
|
67517
|
+
) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(source, target) || target.flags & 134217728 /* TemplateLiteral */ && isTypeMatchedByTemplateLiteralType(source, target));
|
67517
67518
|
}
|
67518
67519
|
if (source.flags & 134217728 /* TemplateLiteral */) {
|
67519
67520
|
const texts = source.texts;
|
@@ -77254,14 +77255,14 @@ function createTypeChecker(host) {
|
|
77254
77255
|
function getTypeOfFirstParameterOfSignatureWithFallback(signature, fallbackType) {
|
77255
77256
|
return signature.parameters.length > 0 ? getTypeAtPosition(signature, 0) : fallbackType;
|
77256
77257
|
}
|
77257
|
-
function
|
77258
|
+
function inferFromAnnotatedParametersAndReturn(signature, context, inferenceContext) {
|
77258
77259
|
const len = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);
|
77259
77260
|
for (let i = 0; i < len; i++) {
|
77260
77261
|
const declaration = signature.parameters[i].valueDeclaration;
|
77261
|
-
const
|
77262
|
-
if (
|
77262
|
+
const typeNode2 = getEffectiveTypeAnnotationNode(declaration);
|
77263
|
+
if (typeNode2) {
|
77263
77264
|
const source = addOptionality(
|
77264
|
-
getTypeFromTypeNode(
|
77265
|
+
getTypeFromTypeNode(typeNode2),
|
77265
77266
|
/*isProperty*/
|
77266
77267
|
false,
|
77267
77268
|
isOptionalDeclaration(declaration)
|
@@ -77270,6 +77271,12 @@ function createTypeChecker(host) {
|
|
77270
77271
|
inferTypes(inferenceContext.inferences, source, target);
|
77271
77272
|
}
|
77272
77273
|
}
|
77274
|
+
const typeNode = signature.declaration && getEffectiveReturnTypeNode(signature.declaration);
|
77275
|
+
if (typeNode) {
|
77276
|
+
const source = getTypeFromTypeNode(typeNode);
|
77277
|
+
const target = getReturnTypeOfSignature(context);
|
77278
|
+
inferTypes(inferenceContext.inferences, source, target);
|
77279
|
+
}
|
77273
77280
|
}
|
77274
77281
|
function assignContextualParameterTypes(signature, context) {
|
77275
77282
|
if (context.typeParameters) {
|
@@ -77963,7 +77970,7 @@ function createTypeChecker(host) {
|
|
77963
77970
|
const trueType2 = getFlowTypeOfReference(param.name, initType, initType, func, trueCondition);
|
77964
77971
|
if (trueType2 === initType) return void 0;
|
77965
77972
|
const falseCondition = createFlowNode(64 /* FalseCondition */, expr, antecedent);
|
77966
|
-
const falseSubtype = getFlowTypeOfReference(param.name, initType, trueType2, func, falseCondition);
|
77973
|
+
const falseSubtype = getReducedType(getFlowTypeOfReference(param.name, initType, trueType2, func, falseCondition));
|
77967
77974
|
return falseSubtype.flags & 131072 /* Never */ ? trueType2 : void 0;
|
77968
77975
|
}
|
77969
77976
|
function checkAllCodePathsInNonVoidFunctionReturnOrThrow(func, returnType) {
|
@@ -78058,7 +78065,7 @@ function createTypeChecker(host) {
|
|
78058
78065
|
const inferenceContext = getInferenceContext(node);
|
78059
78066
|
let instantiatedContextualSignature;
|
78060
78067
|
if (checkMode && checkMode & 2 /* Inferential */) {
|
78061
|
-
|
78068
|
+
inferFromAnnotatedParametersAndReturn(signature, contextualSignature, inferenceContext);
|
78062
78069
|
const restType = getEffectiveRestType(contextualSignature);
|
78063
78070
|
if (restType && restType.flags & 262144 /* TypeParameter */) {
|
78064
78071
|
instantiatedContextualSignature = instantiateSignature(contextualSignature, inferenceContext.nonFixingMapper);
|
@@ -78072,7 +78079,7 @@ function createTypeChecker(host) {
|
|
78072
78079
|
} else if (contextualSignature && !node.typeParameters && contextualSignature.parameters.length > node.parameters.length) {
|
78073
78080
|
const inferenceContext = getInferenceContext(node);
|
78074
78081
|
if (checkMode && checkMode & 2 /* Inferential */) {
|
78075
|
-
|
78082
|
+
inferFromAnnotatedParametersAndReturn(signature, contextualSignature, inferenceContext);
|
78076
78083
|
}
|
78077
78084
|
}
|
78078
78085
|
if (contextualSignature && !getReturnTypeFromAnnotation(node) && !signature.resolvedReturnType) {
|
@@ -78835,21 +78842,36 @@ function createTypeChecker(host) {
|
|
78835
78842
|
if (isBinaryExpression(right) && (right.operatorToken.kind === 57 /* BarBarToken */ || right.operatorToken.kind === 56 /* AmpersandAmpersandToken */)) {
|
78836
78843
|
grammarErrorOnNode(right, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(right.operatorToken.kind), tokenToString(operatorToken.kind));
|
78837
78844
|
}
|
78838
|
-
|
78839
|
-
|
78840
|
-
|
78841
|
-
|
78842
|
-
|
78843
|
-
|
78844
|
-
|
78845
|
-
|
78846
|
-
|
78847
|
-
|
78848
|
-
|
78849
|
-
|
78845
|
+
checkNullishCoalesceOperandLeft(node);
|
78846
|
+
checkNullishCoalesceOperandRight(node);
|
78847
|
+
}
|
78848
|
+
}
|
78849
|
+
function checkNullishCoalesceOperandLeft(node) {
|
78850
|
+
const leftTarget = skipOuterExpressions(node.left, 63 /* All */);
|
78851
|
+
const nullishSemantics = getSyntacticNullishnessSemantics(leftTarget);
|
78852
|
+
if (nullishSemantics !== 3 /* Sometimes */) {
|
78853
|
+
if (nullishSemantics === 1 /* Always */) {
|
78854
|
+
error(leftTarget, Diagnostics.This_expression_is_always_nullish);
|
78855
|
+
} else {
|
78856
|
+
error(leftTarget, Diagnostics.Right_operand_of_is_unreachable_because_the_left_operand_is_never_nullish);
|
78850
78857
|
}
|
78851
78858
|
}
|
78852
78859
|
}
|
78860
|
+
function checkNullishCoalesceOperandRight(node) {
|
78861
|
+
const rightTarget = skipOuterExpressions(node.right, 63 /* All */);
|
78862
|
+
const nullishSemantics = getSyntacticNullishnessSemantics(rightTarget);
|
78863
|
+
if (isNotWithinNullishCoalesceExpression(node)) {
|
78864
|
+
return;
|
78865
|
+
}
|
78866
|
+
if (nullishSemantics === 1 /* Always */) {
|
78867
|
+
error(rightTarget, Diagnostics.This_expression_is_always_nullish);
|
78868
|
+
} else if (nullishSemantics === 2 /* Never */) {
|
78869
|
+
error(rightTarget, Diagnostics.This_expression_is_never_nullish);
|
78870
|
+
}
|
78871
|
+
}
|
78872
|
+
function isNotWithinNullishCoalesceExpression(node) {
|
78873
|
+
return !isBinaryExpression(node.parent) || node.parent.operatorToken.kind !== 61 /* QuestionQuestionToken */;
|
78874
|
+
}
|
78853
78875
|
function getSyntacticNullishnessSemantics(node) {
|
78854
78876
|
node = skipOuterExpressions(node);
|
78855
78877
|
switch (node.kind) {
|
@@ -84568,7 +84590,7 @@ function createTypeChecker(host) {
|
|
84568
84590
|
checkGrammarModifiers(node);
|
84569
84591
|
checkCollisionsForDeclarationName(node, node.name);
|
84570
84592
|
checkExportsOnMergedDeclarations(node);
|
84571
|
-
node.members.forEach(
|
84593
|
+
node.members.forEach(checkSourceElement);
|
84572
84594
|
if (compilerOptions.erasableSyntaxOnly && !(node.flags & 33554432 /* Ambient */)) {
|
84573
84595
|
error(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
|
84574
84596
|
}
|
@@ -85529,6 +85551,8 @@ function createTypeChecker(host) {
|
|
85529
85551
|
return checkTypeAliasDeclaration(node);
|
85530
85552
|
case 266 /* EnumDeclaration */:
|
85531
85553
|
return checkEnumDeclaration(node);
|
85554
|
+
case 306 /* EnumMember */:
|
85555
|
+
return checkEnumMember(node);
|
85532
85556
|
case 267 /* ModuleDeclaration */:
|
85533
85557
|
return checkModuleDeclaration(node);
|
85534
85558
|
case 272 /* ImportDeclaration */:
|
package/lib/typescript.js
CHANGED
@@ -2285,7 +2285,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
2285
2285
|
|
2286
2286
|
// src/compiler/corePublic.ts
|
2287
2287
|
var versionMajorMinor = "5.9";
|
2288
|
-
var version = `${versionMajorMinor}.0-dev.
|
2288
|
+
var version = `${versionMajorMinor}.0-dev.20250222`;
|
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}'."),
|
@@ -72123,7 +72124,7 @@ function createTypeChecker(host) {
|
|
72123
72124
|
value,
|
72124
72125
|
/*roundTripOnly*/
|
72125
72126
|
false
|
72126
|
-
) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(
|
72127
|
+
) || target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName || target.flags & 268435456 /* StringMapping */ && isMemberOfStringMapping(source, target) || target.flags & 134217728 /* TemplateLiteral */ && isTypeMatchedByTemplateLiteralType(source, target));
|
72127
72128
|
}
|
72128
72129
|
if (source.flags & 134217728 /* TemplateLiteral */) {
|
72129
72130
|
const texts = source.texts;
|
@@ -81864,14 +81865,14 @@ function createTypeChecker(host) {
|
|
81864
81865
|
function getTypeOfFirstParameterOfSignatureWithFallback(signature, fallbackType) {
|
81865
81866
|
return signature.parameters.length > 0 ? getTypeAtPosition(signature, 0) : fallbackType;
|
81866
81867
|
}
|
81867
|
-
function
|
81868
|
+
function inferFromAnnotatedParametersAndReturn(signature, context, inferenceContext) {
|
81868
81869
|
const len = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);
|
81869
81870
|
for (let i = 0; i < len; i++) {
|
81870
81871
|
const declaration = signature.parameters[i].valueDeclaration;
|
81871
|
-
const
|
81872
|
-
if (
|
81872
|
+
const typeNode2 = getEffectiveTypeAnnotationNode(declaration);
|
81873
|
+
if (typeNode2) {
|
81873
81874
|
const source = addOptionality(
|
81874
|
-
getTypeFromTypeNode(
|
81875
|
+
getTypeFromTypeNode(typeNode2),
|
81875
81876
|
/*isProperty*/
|
81876
81877
|
false,
|
81877
81878
|
isOptionalDeclaration(declaration)
|
@@ -81880,6 +81881,12 @@ function createTypeChecker(host) {
|
|
81880
81881
|
inferTypes(inferenceContext.inferences, source, target);
|
81881
81882
|
}
|
81882
81883
|
}
|
81884
|
+
const typeNode = signature.declaration && getEffectiveReturnTypeNode(signature.declaration);
|
81885
|
+
if (typeNode) {
|
81886
|
+
const source = getTypeFromTypeNode(typeNode);
|
81887
|
+
const target = getReturnTypeOfSignature(context);
|
81888
|
+
inferTypes(inferenceContext.inferences, source, target);
|
81889
|
+
}
|
81883
81890
|
}
|
81884
81891
|
function assignContextualParameterTypes(signature, context) {
|
81885
81892
|
if (context.typeParameters) {
|
@@ -82573,7 +82580,7 @@ function createTypeChecker(host) {
|
|
82573
82580
|
const trueType2 = getFlowTypeOfReference(param.name, initType, initType, func, trueCondition);
|
82574
82581
|
if (trueType2 === initType) return void 0;
|
82575
82582
|
const falseCondition = createFlowNode(64 /* FalseCondition */, expr, antecedent);
|
82576
|
-
const falseSubtype = getFlowTypeOfReference(param.name, initType, trueType2, func, falseCondition);
|
82583
|
+
const falseSubtype = getReducedType(getFlowTypeOfReference(param.name, initType, trueType2, func, falseCondition));
|
82577
82584
|
return falseSubtype.flags & 131072 /* Never */ ? trueType2 : void 0;
|
82578
82585
|
}
|
82579
82586
|
function checkAllCodePathsInNonVoidFunctionReturnOrThrow(func, returnType) {
|
@@ -82668,7 +82675,7 @@ function createTypeChecker(host) {
|
|
82668
82675
|
const inferenceContext = getInferenceContext(node);
|
82669
82676
|
let instantiatedContextualSignature;
|
82670
82677
|
if (checkMode && checkMode & 2 /* Inferential */) {
|
82671
|
-
|
82678
|
+
inferFromAnnotatedParametersAndReturn(signature, contextualSignature, inferenceContext);
|
82672
82679
|
const restType = getEffectiveRestType(contextualSignature);
|
82673
82680
|
if (restType && restType.flags & 262144 /* TypeParameter */) {
|
82674
82681
|
instantiatedContextualSignature = instantiateSignature(contextualSignature, inferenceContext.nonFixingMapper);
|
@@ -82682,7 +82689,7 @@ function createTypeChecker(host) {
|
|
82682
82689
|
} else if (contextualSignature && !node.typeParameters && contextualSignature.parameters.length > node.parameters.length) {
|
82683
82690
|
const inferenceContext = getInferenceContext(node);
|
82684
82691
|
if (checkMode && checkMode & 2 /* Inferential */) {
|
82685
|
-
|
82692
|
+
inferFromAnnotatedParametersAndReturn(signature, contextualSignature, inferenceContext);
|
82686
82693
|
}
|
82687
82694
|
}
|
82688
82695
|
if (contextualSignature && !getReturnTypeFromAnnotation(node) && !signature.resolvedReturnType) {
|
@@ -83445,21 +83452,36 @@ function createTypeChecker(host) {
|
|
83445
83452
|
if (isBinaryExpression(right) && (right.operatorToken.kind === 57 /* BarBarToken */ || right.operatorToken.kind === 56 /* AmpersandAmpersandToken */)) {
|
83446
83453
|
grammarErrorOnNode(right, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(right.operatorToken.kind), tokenToString(operatorToken.kind));
|
83447
83454
|
}
|
83448
|
-
|
83449
|
-
|
83450
|
-
|
83451
|
-
|
83452
|
-
|
83453
|
-
|
83454
|
-
|
83455
|
-
|
83456
|
-
|
83457
|
-
|
83458
|
-
|
83459
|
-
|
83455
|
+
checkNullishCoalesceOperandLeft(node);
|
83456
|
+
checkNullishCoalesceOperandRight(node);
|
83457
|
+
}
|
83458
|
+
}
|
83459
|
+
function checkNullishCoalesceOperandLeft(node) {
|
83460
|
+
const leftTarget = skipOuterExpressions(node.left, 63 /* All */);
|
83461
|
+
const nullishSemantics = getSyntacticNullishnessSemantics(leftTarget);
|
83462
|
+
if (nullishSemantics !== 3 /* Sometimes */) {
|
83463
|
+
if (nullishSemantics === 1 /* Always */) {
|
83464
|
+
error2(leftTarget, Diagnostics.This_expression_is_always_nullish);
|
83465
|
+
} else {
|
83466
|
+
error2(leftTarget, Diagnostics.Right_operand_of_is_unreachable_because_the_left_operand_is_never_nullish);
|
83460
83467
|
}
|
83461
83468
|
}
|
83462
83469
|
}
|
83470
|
+
function checkNullishCoalesceOperandRight(node) {
|
83471
|
+
const rightTarget = skipOuterExpressions(node.right, 63 /* All */);
|
83472
|
+
const nullishSemantics = getSyntacticNullishnessSemantics(rightTarget);
|
83473
|
+
if (isNotWithinNullishCoalesceExpression(node)) {
|
83474
|
+
return;
|
83475
|
+
}
|
83476
|
+
if (nullishSemantics === 1 /* Always */) {
|
83477
|
+
error2(rightTarget, Diagnostics.This_expression_is_always_nullish);
|
83478
|
+
} else if (nullishSemantics === 2 /* Never */) {
|
83479
|
+
error2(rightTarget, Diagnostics.This_expression_is_never_nullish);
|
83480
|
+
}
|
83481
|
+
}
|
83482
|
+
function isNotWithinNullishCoalesceExpression(node) {
|
83483
|
+
return !isBinaryExpression(node.parent) || node.parent.operatorToken.kind !== 61 /* QuestionQuestionToken */;
|
83484
|
+
}
|
83463
83485
|
function getSyntacticNullishnessSemantics(node) {
|
83464
83486
|
node = skipOuterExpressions(node);
|
83465
83487
|
switch (node.kind) {
|
@@ -89178,7 +89200,7 @@ function createTypeChecker(host) {
|
|
89178
89200
|
checkGrammarModifiers(node);
|
89179
89201
|
checkCollisionsForDeclarationName(node, node.name);
|
89180
89202
|
checkExportsOnMergedDeclarations(node);
|
89181
|
-
node.members.forEach(
|
89203
|
+
node.members.forEach(checkSourceElement);
|
89182
89204
|
if (compilerOptions.erasableSyntaxOnly && !(node.flags & 33554432 /* Ambient */)) {
|
89183
89205
|
error2(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
|
89184
89206
|
}
|
@@ -90139,6 +90161,8 @@ function createTypeChecker(host) {
|
|
90139
90161
|
return checkTypeAliasDeclaration(node);
|
90140
90162
|
case 266 /* EnumDeclaration */:
|
90141
90163
|
return checkEnumDeclaration(node);
|
90164
|
+
case 306 /* EnumMember */:
|
90165
|
+
return checkEnumMember(node);
|
90142
90166
|
case 267 /* ModuleDeclaration */:
|
90143
90167
|
return checkModuleDeclaration(node);
|
90144
90168
|
case 272 /* ImportDeclaration */:
|
@@ -144165,6 +144189,7 @@ function computeSuggestionDiagnostics(sourceFile, program, cancellationToken) {
|
|
144165
144189
|
if (getAllowSyntheticDefaultImports(program.getCompilerOptions())) {
|
144166
144190
|
for (const moduleSpecifier of sourceFile.imports) {
|
144167
144191
|
const importNode = importFromModuleSpecifier(moduleSpecifier);
|
144192
|
+
if (isImportEqualsDeclaration(importNode) && hasSyntacticModifier(importNode, 32 /* Export */)) continue;
|
144168
144193
|
const name = importNameForConvertToDefaultImport(importNode);
|
144169
144194
|
if (!name) continue;
|
144170
144195
|
const module2 = (_a = program.getResolvedModuleFromModuleSpecifier(moduleSpecifier, sourceFile)) == null ? void 0 : _a.resolvedModule;
|
@@ -170107,6 +170132,17 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, program,
|
|
170107
170132
|
const existing = new Set(namedImportsOrExports.elements.map((n) => moduleExportNameTextEscaped(n.propertyName || n.name)));
|
170108
170133
|
const uniques = exports2.filter((e) => e.escapedName !== "default" /* Default */ && !existing.has(e.escapedName));
|
170109
170134
|
return { kind: 1 /* Properties */, symbols: uniques, hasIndexSignature: false };
|
170135
|
+
case 226 /* BinaryExpression */:
|
170136
|
+
if (parent2.operatorToken.kind === 103 /* InKeyword */) {
|
170137
|
+
const type = typeChecker.getTypeAtLocation(parent2.right);
|
170138
|
+
const properties = type.isUnion() ? typeChecker.getAllPossiblePropertiesOfTypes(type.types) : type.getApparentProperties();
|
170139
|
+
return {
|
170140
|
+
kind: 1 /* Properties */,
|
170141
|
+
symbols: properties.filter((prop) => !prop.valueDeclaration || !isPrivateIdentifierClassElementDeclaration(prop.valueDeclaration)),
|
170142
|
+
hasIndexSignature: false
|
170143
|
+
};
|
170144
|
+
}
|
170145
|
+
return fromContextualType(0 /* None */);
|
170110
170146
|
default:
|
170111
170147
|
return fromContextualType() || fromContextualType(0 /* None */);
|
170112
170148
|
}
|
@@ -173235,8 +173271,8 @@ var Core;
|
|
173235
173271
|
if (!(symbol2.flags & (32 /* Class */ | 64 /* Interface */)) || !addToSeen(seen, symbol2)) return;
|
173236
173272
|
return firstDefined(symbol2.declarations, (declaration) => firstDefined(getAllSuperTypeNodes(declaration), (typeReference) => {
|
173237
173273
|
const type = checker.getTypeAtLocation(typeReference);
|
173238
|
-
const propertySymbol = type
|
173239
|
-
return
|
173274
|
+
const propertySymbol = type.symbol && checker.getPropertyOfType(type, propertyName);
|
173275
|
+
return propertySymbol && firstDefined(checker.getRootSymbols(propertySymbol), cb) || type.symbol && recur(type.symbol);
|
173240
173276
|
}));
|
173241
173277
|
}
|
173242
173278
|
}
|
package/package.json
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
"name": "typescript",
|
3
3
|
"author": "Microsoft Corp.",
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
5
|
-
"version": "5.9.0-dev.
|
5
|
+
"version": "5.9.0-dev.20250222",
|
6
6
|
"license": "Apache-2.0",
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
8
8
|
"keywords": [
|
@@ -116,5 +116,5 @@
|
|
116
116
|
"node": "20.1.0",
|
117
117
|
"npm": "8.19.4"
|
118
118
|
},
|
119
|
-
"gitHead": "
|
119
|
+
"gitHead": "1cd8e20f947513cc8c0c7c59e55b2f4524eff316"
|
120
120
|
}
|