@typescript-deploys/pr-build 5.8.0-pr-61144-2 → 5.9.0-pr-60898-5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/_tsc.js 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.8";
21
- var version = `${versionMajorMinor}.0-insiders.20250207`;
20
+ var versionMajorMinor = "5.9";
21
+ var version = `${versionMajorMinor}.0-insiders.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}'."),
@@ -58572,7 +58573,7 @@ function createTypeChecker(host) {
58572
58573
  let hasThisParameter = false;
58573
58574
  const iife = getImmediatelyInvokedFunctionExpression(declaration);
58574
58575
  const isJSConstructSignature = isJSDocConstructSignature(declaration);
58575
- const isUntypedSignatureInJSFile = !iife && isInJSFile(declaration) && isValueSignatureDeclaration(declaration) && !hasJSDocParameterTags(declaration) && !getJSDocType(declaration);
58576
+ const isUntypedSignatureInJSFile = !iife && isInJSFile(declaration) && isValueSignatureDeclaration(declaration) && !hasJSDocParameterTags(declaration) && !getJSDocType(declaration) && !getContextualSignatureForFunctionLikeDeclaration(declaration);
58576
58577
  if (isUntypedSignatureInJSFile) {
58577
58578
  flags |= 32 /* IsUntypedSignatureInJSFile */;
58578
58579
  }
@@ -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(getStringLiteralType(value), target) || target.flags & 134217728 /* TemplateLiteral */ && isTypeMatchedByTemplateLiteralType(source, target));
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 inferFromAnnotatedParameters(signature, context, inferenceContext) {
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 typeNode = getEffectiveTypeAnnotationNode(declaration);
77262
- if (typeNode) {
77262
+ const typeNode2 = getEffectiveTypeAnnotationNode(declaration);
77263
+ if (typeNode2) {
77263
77264
  const source = addOptionality(
77264
- getTypeFromTypeNode(typeNode),
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
- inferFromAnnotatedParameters(signature, contextualSignature, inferenceContext);
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
- inferFromAnnotatedParameters(signature, contextualSignature, inferenceContext);
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
- const leftTarget = skipOuterExpressions(left, 63 /* All */);
78839
- const nullishSemantics = getSyntacticNullishnessSemantics(leftTarget);
78840
- if (nullishSemantics !== 3 /* Sometimes */) {
78841
- if (node.parent.kind === 226 /* BinaryExpression */) {
78842
- error(leftTarget, Diagnostics.This_binary_expression_is_never_nullish_Are_you_missing_parentheses);
78843
- } else {
78844
- if (nullishSemantics === 1 /* Always */) {
78845
- error(leftTarget, Diagnostics.This_expression_is_always_nullish);
78846
- } else {
78847
- error(leftTarget, Diagnostics.Right_operand_of_is_unreachable_because_the_left_operand_is_never_nullish);
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(checkEnumMember);
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
  }
@@ -85063,11 +85085,10 @@ function createTypeChecker(host) {
85063
85085
  return;
85064
85086
  }
85065
85087
  checkGrammarModifiers(node);
85066
- const isImportEquals = isInternalModuleImportEqualsDeclaration(node);
85067
- if (compilerOptions.erasableSyntaxOnly && isImportEquals && !(node.flags & 33554432 /* Ambient */)) {
85088
+ if (compilerOptions.erasableSyntaxOnly && !(node.flags & 33554432 /* Ambient */)) {
85068
85089
  error(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
85069
85090
  }
85070
- if (isImportEquals || checkExternalImportOrExportDeclaration(node)) {
85091
+ if (isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) {
85071
85092
  checkImportBinding(node);
85072
85093
  markLinkedReferences(node, 6 /* ExportImportEquals */);
85073
85094
  if (node.moduleReference.kind !== 283 /* ExternalModuleReference */) {
@@ -85187,6 +85208,9 @@ function createTypeChecker(host) {
85187
85208
  if (checkGrammarModuleElementContext(node, illegalContextMessage)) {
85188
85209
  return;
85189
85210
  }
85211
+ if (compilerOptions.erasableSyntaxOnly && node.isExportEquals && !(node.flags & 33554432 /* Ambient */)) {
85212
+ error(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
85213
+ }
85190
85214
  const container = node.parent.kind === 307 /* SourceFile */ ? node.parent : node.parent.parent;
85191
85215
  if (container.kind === 267 /* ModuleDeclaration */ && !isAmbientModule(container)) {
85192
85216
  if (node.isExportEquals) {
@@ -85527,6 +85551,8 @@ function createTypeChecker(host) {
85527
85551
  return checkTypeAliasDeclaration(node);
85528
85552
  case 266 /* EnumDeclaration */:
85529
85553
  return checkEnumDeclaration(node);
85554
+ case 306 /* EnumMember */:
85555
+ return checkEnumMember(node);
85530
85556
  case 267 /* ModuleDeclaration */:
85531
85557
  return checkModuleDeclaration(node);
85532
85558
  case 272 /* ImportDeclaration */:
@@ -111874,7 +111900,7 @@ function transformECMAScriptModule(context) {
111874
111900
  if (node === (importsAndRequiresToRewriteOrShim == null ? void 0 : importsAndRequiresToRewriteOrShim[0])) {
111875
111901
  return visitImportOrRequireCall(importsAndRequiresToRewriteOrShim.shift());
111876
111902
  }
111877
- break;
111903
+ // fallthrough
111878
111904
  default:
111879
111905
  if ((importsAndRequiresToRewriteOrShim == null ? void 0 : importsAndRequiresToRewriteOrShim.length) && rangeContainsRange(node, importsAndRequiresToRewriteOrShim[0])) {
111880
111906
  return visitEachChild(node, visitor, context);
@@ -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.8";
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.8";
2288
- var version = `${versionMajorMinor}.0-insiders.20250207`;
2287
+ var versionMajorMinor = "5.9";
2288
+ var version = `${versionMajorMinor}.0-insiders.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}'."),
@@ -63182,7 +63183,7 @@ function createTypeChecker(host) {
63182
63183
  let hasThisParameter2 = false;
63183
63184
  const iife = getImmediatelyInvokedFunctionExpression(declaration);
63184
63185
  const isJSConstructSignature = isJSDocConstructSignature(declaration);
63185
- const isUntypedSignatureInJSFile = !iife && isInJSFile(declaration) && isValueSignatureDeclaration(declaration) && !hasJSDocParameterTags(declaration) && !getJSDocType(declaration);
63186
+ const isUntypedSignatureInJSFile = !iife && isInJSFile(declaration) && isValueSignatureDeclaration(declaration) && !hasJSDocParameterTags(declaration) && !getJSDocType(declaration) && !getContextualSignatureForFunctionLikeDeclaration(declaration);
63186
63187
  if (isUntypedSignatureInJSFile) {
63187
63188
  flags |= 32 /* IsUntypedSignatureInJSFile */;
63188
63189
  }
@@ -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(getStringLiteralType(value), target) || target.flags & 134217728 /* TemplateLiteral */ && isTypeMatchedByTemplateLiteralType(source, target));
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 inferFromAnnotatedParameters(signature, context, inferenceContext) {
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 typeNode = getEffectiveTypeAnnotationNode(declaration);
81872
- if (typeNode) {
81872
+ const typeNode2 = getEffectiveTypeAnnotationNode(declaration);
81873
+ if (typeNode2) {
81873
81874
  const source = addOptionality(
81874
- getTypeFromTypeNode(typeNode),
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
- inferFromAnnotatedParameters(signature, contextualSignature, inferenceContext);
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
- inferFromAnnotatedParameters(signature, contextualSignature, inferenceContext);
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
- const leftTarget = skipOuterExpressions(left, 63 /* All */);
83449
- const nullishSemantics = getSyntacticNullishnessSemantics(leftTarget);
83450
- if (nullishSemantics !== 3 /* Sometimes */) {
83451
- if (node.parent.kind === 226 /* BinaryExpression */) {
83452
- error2(leftTarget, Diagnostics.This_binary_expression_is_never_nullish_Are_you_missing_parentheses);
83453
- } else {
83454
- if (nullishSemantics === 1 /* Always */) {
83455
- error2(leftTarget, Diagnostics.This_expression_is_always_nullish);
83456
- } else {
83457
- error2(leftTarget, Diagnostics.Right_operand_of_is_unreachable_because_the_left_operand_is_never_nullish);
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(checkEnumMember);
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
  }
@@ -89673,11 +89695,10 @@ function createTypeChecker(host) {
89673
89695
  return;
89674
89696
  }
89675
89697
  checkGrammarModifiers(node);
89676
- const isImportEquals = isInternalModuleImportEqualsDeclaration(node);
89677
- if (compilerOptions.erasableSyntaxOnly && isImportEquals && !(node.flags & 33554432 /* Ambient */)) {
89698
+ if (compilerOptions.erasableSyntaxOnly && !(node.flags & 33554432 /* Ambient */)) {
89678
89699
  error2(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
89679
89700
  }
89680
- if (isImportEquals || checkExternalImportOrExportDeclaration(node)) {
89701
+ if (isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) {
89681
89702
  checkImportBinding(node);
89682
89703
  markLinkedReferences(node, 6 /* ExportImportEquals */);
89683
89704
  if (node.moduleReference.kind !== 283 /* ExternalModuleReference */) {
@@ -89797,6 +89818,9 @@ function createTypeChecker(host) {
89797
89818
  if (checkGrammarModuleElementContext(node, illegalContextMessage)) {
89798
89819
  return;
89799
89820
  }
89821
+ if (compilerOptions.erasableSyntaxOnly && node.isExportEquals && !(node.flags & 33554432 /* Ambient */)) {
89822
+ error2(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
89823
+ }
89800
89824
  const container = node.parent.kind === 307 /* SourceFile */ ? node.parent : node.parent.parent;
89801
89825
  if (container.kind === 267 /* ModuleDeclaration */ && !isAmbientModule(container)) {
89802
89826
  if (node.isExportEquals) {
@@ -90137,6 +90161,8 @@ function createTypeChecker(host) {
90137
90161
  return checkTypeAliasDeclaration(node);
90138
90162
  case 266 /* EnumDeclaration */:
90139
90163
  return checkEnumDeclaration(node);
90164
+ case 306 /* EnumMember */:
90165
+ return checkEnumMember(node);
90140
90166
  case 267 /* ModuleDeclaration */:
90141
90167
  return checkModuleDeclaration(node);
90142
90168
  case 272 /* ImportDeclaration */:
@@ -116666,7 +116692,7 @@ function transformECMAScriptModule(context) {
116666
116692
  if (node === (importsAndRequiresToRewriteOrShim == null ? void 0 : importsAndRequiresToRewriteOrShim[0])) {
116667
116693
  return visitImportOrRequireCall(importsAndRequiresToRewriteOrShim.shift());
116668
116694
  }
116669
- break;
116695
+ // fallthrough
116670
116696
  default:
116671
116697
  if ((importsAndRequiresToRewriteOrShim == null ? void 0 : importsAndRequiresToRewriteOrShim.length) && rangeContainsRange(node, importsAndRequiresToRewriteOrShim[0])) {
116672
116698
  return visitEachChild(node, visitor, context);
@@ -144163,6 +144189,7 @@ function computeSuggestionDiagnostics(sourceFile, program, cancellationToken) {
144163
144189
  if (getAllowSyntheticDefaultImports(program.getCompilerOptions())) {
144164
144190
  for (const moduleSpecifier of sourceFile.imports) {
144165
144191
  const importNode = importFromModuleSpecifier(moduleSpecifier);
144192
+ if (isImportEqualsDeclaration(importNode) && hasSyntacticModifier(importNode, 32 /* Export */)) continue;
144166
144193
  const name = importNameForConvertToDefaultImport(importNode);
144167
144194
  if (!name) continue;
144168
144195
  const module2 = (_a = program.getResolvedModuleFromModuleSpecifier(moduleSpecifier, sourceFile)) == null ? void 0 : _a.resolvedModule;
@@ -164388,10 +164415,14 @@ function typeNodeToAutoImportableTypeNode(typeNode, importAdder, scriptTarget) {
164388
164415
  return getSynthesizedDeepClone(typeNode);
164389
164416
  }
164390
164417
  function endOfRequiredTypeParameters(checker, type) {
164418
+ var _a;
164391
164419
  Debug.assert(type.typeArguments);
164392
164420
  const fullTypeArguments = type.typeArguments;
164393
164421
  const target = type.target;
164394
164422
  for (let cutoff = 0; cutoff < fullTypeArguments.length; cutoff++) {
164423
+ if (((_a = target.localTypeParameters) == null ? void 0 : _a[cutoff].constraint) === void 0) {
164424
+ continue;
164425
+ }
164395
164426
  const typeArguments = fullTypeArguments.slice(0, cutoff);
164396
164427
  const filledIn = checker.fillMissingTypeArguments(
164397
164428
  typeArguments,
@@ -170101,6 +170132,17 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, program,
170101
170132
  const existing = new Set(namedImportsOrExports.elements.map((n) => moduleExportNameTextEscaped(n.propertyName || n.name)));
170102
170133
  const uniques = exports2.filter((e) => e.escapedName !== "default" /* Default */ && !existing.has(e.escapedName));
170103
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 */);
170104
170146
  default:
170105
170147
  return fromContextualType() || fromContextualType(0 /* None */);
170106
170148
  }
@@ -173229,8 +173271,8 @@ var Core;
173229
173271
  if (!(symbol2.flags & (32 /* Class */ | 64 /* Interface */)) || !addToSeen(seen, symbol2)) return;
173230
173272
  return firstDefined(symbol2.declarations, (declaration) => firstDefined(getAllSuperTypeNodes(declaration), (typeReference) => {
173231
173273
  const type = checker.getTypeAtLocation(typeReference);
173232
- const propertySymbol = type && type.symbol && checker.getPropertyOfType(type, propertyName);
173233
- return type && propertySymbol && (firstDefined(checker.getRootSymbols(propertySymbol), cb) || recur(type.symbol));
173274
+ const propertySymbol = type.symbol && checker.getPropertyOfType(type, propertyName);
173275
+ return propertySymbol && firstDefined(checker.getRootSymbols(propertySymbol), cb) || type.symbol && recur(type.symbol);
173234
173276
  }));
173235
173277
  }
173236
173278
  }
@@ -181926,6 +181968,11 @@ var SmartIndenter;
181926
181968
  return false;
181927
181969
  }
181928
181970
  break;
181971
+ case 258 /* TryStatement */:
181972
+ if (childKind === 241 /* Block */) {
181973
+ return false;
181974
+ }
181975
+ break;
181929
181976
  }
181930
181977
  return indentByDefault;
181931
181978
  }
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.8.0-pr-61144-2",
5
+ "version": "5.9.0-pr-60898-5",
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.3",
43
+ "@dprint/typescript": "0.93.4",
44
44
  "@esfx/canceltoken": "^1.0.0",
45
- "@eslint/js": "^9.17.0",
46
- "@octokit/rest": "^21.0.2",
45
+ "@eslint/js": "^9.20.0",
46
+ "@octokit/rest": "^21.1.1",
47
47
  "@types/chai": "^4.3.20",
48
- "@types/diff": "^5.2.3",
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.18.1",
56
- "@typescript-eslint/type-utils": "^8.18.1",
57
- "@typescript-eslint/utils": "^8.18.1",
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
- "chalk": "^4.1.2",
62
- "chokidar": "^3.6.0",
63
- "diff": "^5.2.0",
64
- "dprint": "^0.47.6",
65
- "esbuild": "^0.24.0",
66
- "eslint": "^9.17.0",
61
+ "chokidar": "^4.0.3",
62
+ "diff": "^7.0.0",
63
+ "dprint": "^0.49.0",
64
+ "esbuild": "^0.25.0",
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.1",
68
+ "fast-xml-parser": "^4.5.2",
70
69
  "glob": "^10.4.5",
71
- "globals": "^15.13.0",
70
+ "globals": "^15.15.0",
72
71
  "hereby": "^1.10.0",
73
72
  "jsonc-parser": "^3.3.1",
74
- "knip": "^5.41.0",
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.11.4",
77
+ "monocart-coverage-reports": "^2.12.1",
79
78
  "ms": "^2.1.3",
80
- "playwright": "^1.49.1",
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.2",
84
- "typescript-eslint": "^8.18.1",
83
+ "typescript": "^5.7.3",
84
+ "typescript-eslint": "^8.24.1",
85
85
  "which": "^3.0.1"
86
86
  },
87
87
  "overrides": {