@typescript-deploys/pr-build 5.2.0-pr-54507-7 → 5.2.0-pr-54546-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/typescript.js CHANGED
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.2";
38
- version = `${versionMajorMinor}.0-insiders.20230602`;
38
+ version = `${versionMajorMinor}.0-insiders.20230605`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -7452,6 +7452,7 @@ ${lanes.join("\n")}
7452
7452
  The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate: diag(2210, 1 /* Error */, "The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_roo_2210", "The project root is ambiguous, but is required to resolve import map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."),
7453
7453
  Add_extends_constraint: diag(2211, 3 /* Message */, "Add_extends_constraint_2211", "Add `extends` constraint."),
7454
7454
  Add_extends_constraint_to_all_type_parameters: diag(2212, 3 /* Message */, "Add_extends_constraint_to_all_type_parameters_2212", "Add `extends` constraint to all type parameters"),
7455
+ The_project_root_is_ambiguous_but_is_required_to_determine_the_module_format_of_output_js_files_Supply_the_rootDir_compiler_option_to_disambiguate: diag(2213, 1 /* Error */, "The_project_root_is_ambiguous_but_is_required_to_determine_the_module_format_of_output_js_files_Supp_2213", "The project root is ambiguous, but is required to determine the module format of output '.js' files. Supply the `rootDir` compiler option to disambiguate."),
7455
7456
  Duplicate_identifier_0: diag(2300, 1 /* Error */, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."),
7456
7457
  Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2301, 1 /* Error */, "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),
7457
7458
  Static_members_cannot_reference_class_type_parameters: diag(2302, 1 /* Error */, "Static_members_cannot_reference_class_type_parameters_2302", "Static members cannot reference class type parameters."),
@@ -45382,9 +45383,9 @@ ${lanes.join("\n")}
45382
45383
  candidatesOutArray,
45383
45384
  /*argumentCount*/
45384
45385
  void 0,
45385
- 32 /* IsForStringLiteralArgumentCompletions */
45386
+ 64 /* IsForStringLiteralArgumentCompletions */
45386
45387
  )),
45387
- getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */)),
45388
+ getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 32 /* IsForSignatureHelp */)),
45388
45389
  getExpandedParameters,
45389
45390
  hasEffectiveRestParameter,
45390
45391
  containsArgumentsReference,
@@ -53339,7 +53340,7 @@ ${lanes.join("\n")}
53339
53340
  return type.flags & (128 /* StringLiteral */ | 256 /* NumberLiteral */) ? "" + type.value : void 0;
53340
53341
  }
53341
53342
  function getTypeForBindingElement(declaration) {
53342
- const checkMode = declaration.dotDotDotToken ? 64 /* RestBindingElement */ : 0 /* Normal */;
53343
+ const checkMode = declaration.dotDotDotToken ? 128 /* RestBindingElement */ : 0 /* Normal */;
53343
53344
  const parentType = getTypeForBindingElementParent(declaration.parent.parent, checkMode);
53344
53345
  return parentType && getBindingElementTypeFromParentType(declaration, parentType);
53345
53346
  }
@@ -68239,7 +68240,7 @@ ${lanes.join("\n")}
68239
68240
  return type.flags & 2097152 /* Intersection */ ? some(type.types, isGenericTypeWithoutNullableConstraint) : !!(type.flags & 465829888 /* Instantiable */ && !maybeTypeOfKind(getBaseConstraintOrType(type), 98304 /* Nullable */));
68240
68241
  }
68241
68242
  function hasContextualTypeWithNoGenericTypes(node, checkMode) {
68242
- const contextualType = (isIdentifier(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node)) && !((isJsxOpeningElement(node.parent) || isJsxSelfClosingElement(node.parent)) && node.parent.tagName === node) && (checkMode && checkMode & 64 /* RestBindingElement */ ? getContextualType2(node, 8 /* SkipBindingPatterns */) : getContextualType2(
68243
+ const contextualType = (isIdentifier(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node)) && !((isJsxOpeningElement(node.parent) || isJsxSelfClosingElement(node.parent)) && node.parent.tagName === node) && (checkMode && checkMode & 128 /* RestBindingElement */ ? getContextualType2(node, 8 /* SkipBindingPatterns */) : getContextualType2(
68243
68244
  node,
68244
68245
  /*contextFlags*/
68245
68246
  void 0
@@ -68996,7 +68997,7 @@ ${lanes.join("\n")}
68996
68997
  function getContextualTypeForBindingElement(declaration, contextFlags) {
68997
68998
  const parent2 = declaration.parent.parent;
68998
68999
  const name = declaration.propertyName || declaration.name;
68999
- const parentType = getContextualTypeForVariableLikeDeclaration(parent2, contextFlags) || parent2.kind !== 207 /* BindingElement */ && parent2.initializer && checkDeclarationInitializer(parent2, declaration.dotDotDotToken ? 64 /* RestBindingElement */ : 0 /* Normal */);
69000
+ const parentType = getContextualTypeForVariableLikeDeclaration(parent2, contextFlags) || parent2.kind !== 207 /* BindingElement */ && parent2.initializer && checkDeclarationInitializer(parent2, declaration.dotDotDotToken ? 128 /* RestBindingElement */ : 0 /* Normal */);
69000
69001
  if (!parentType || isBindingPattern(name) || isComputedNonLiteralName(name))
69001
69002
  return void 0;
69002
69003
  if (parent2.name.kind === 206 /* ArrayBindingPattern */) {
@@ -70045,7 +70046,9 @@ ${lanes.join("\n")}
70045
70046
  elementTypes.push(undefinedOrMissingType);
70046
70047
  elementFlags.push(2 /* Optional */);
70047
70048
  } else {
70048
- const type = checkExpressionForMutableLocation(e, checkMode, forceTuple);
70049
+ const shouldAddAsIntraExpressionInferenceSite = inTupleContext && checkMode && checkMode & 2 /* Inferential */ && !(checkMode & (4 /* SkipContextSensitive */ | 16 /* SkipAddingIntraExpressionSites */)) && isContextSensitive(e);
70050
+ const elementCheckMode = (checkMode || 0 /* Normal */) | (shouldAddAsIntraExpressionInferenceSite ? 16 /* SkipAddingIntraExpressionSites */ : 0);
70051
+ const type = checkExpressionForMutableLocation(e, elementCheckMode, forceTuple);
70049
70052
  elementTypes.push(addOptionality(
70050
70053
  type,
70051
70054
  /*isProperty*/
@@ -70053,7 +70056,7 @@ ${lanes.join("\n")}
70053
70056
  hasOmittedExpression
70054
70057
  ));
70055
70058
  elementFlags.push(hasOmittedExpression ? 2 /* Optional */ : 1 /* Required */);
70056
- if (inTupleContext && checkMode && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && isContextSensitive(e)) {
70059
+ if (shouldAddAsIntraExpressionInferenceSite) {
70057
70060
  const inferenceContext = getInferenceContext(node);
70058
70061
  Debug.assert(inferenceContext);
70059
70062
  addIntraExpressionInferenceSite(inferenceContext, e, type);
@@ -70194,11 +70197,13 @@ ${lanes.join("\n")}
70194
70197
  let member = getSymbolOfDeclaration(memberDecl);
70195
70198
  const computedNameType = memberDecl.name && memberDecl.name.kind === 166 /* ComputedPropertyName */ ? checkComputedPropertyName(memberDecl.name) : void 0;
70196
70199
  if (memberDecl.kind === 302 /* PropertyAssignment */ || memberDecl.kind === 303 /* ShorthandPropertyAssignment */ || isObjectLiteralMethod(memberDecl)) {
70197
- let type = memberDecl.kind === 302 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, checkMode) : (
70200
+ const shouldAddAsIntraExpressionInferenceSite = contextualType && checkMode & 2 /* Inferential */ && !(checkMode & (4 /* SkipContextSensitive */ | 16 /* SkipAddingIntraExpressionSites */)) && (memberDecl.kind === 302 /* PropertyAssignment */ || memberDecl.kind === 173 /* MethodDeclaration */) && isContextSensitive(memberDecl);
70201
+ const propCheckMode = checkMode | (shouldAddAsIntraExpressionInferenceSite ? 16 /* SkipAddingIntraExpressionSites */ : 0);
70202
+ let type = memberDecl.kind === 302 /* PropertyAssignment */ ? checkPropertyAssignment(memberDecl, propCheckMode) : (
70198
70203
  // avoid resolving the left side of the ShorthandPropertyAssignment outside of the destructuring
70199
70204
  // for error recovery purposes. For example, if a user wrote `{ a = 100 }` instead of `{ a: 100 }`.
70200
70205
  // we don't want to say "could not find 'a'".
70201
- memberDecl.kind === 303 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, checkMode) : checkObjectLiteralMethod(memberDecl, checkMode)
70206
+ memberDecl.kind === 303 /* ShorthandPropertyAssignment */ ? checkExpressionForMutableLocation(!inDestructuringPattern && memberDecl.objectAssignmentInitializer ? memberDecl.objectAssignmentInitializer : memberDecl.name, propCheckMode) : checkObjectLiteralMethod(memberDecl, propCheckMode)
70202
70207
  );
70203
70208
  if (isInJavascript) {
70204
70209
  const jsDocType = getTypeForDeclarationFromJSDocComment(memberDecl);
@@ -70242,7 +70247,7 @@ ${lanes.join("\n")}
70242
70247
  prop.links.target = member;
70243
70248
  member = prop;
70244
70249
  allPropertiesTable == null ? void 0 : allPropertiesTable.set(prop.escapedName, prop);
70245
- if (contextualType && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && (memberDecl.kind === 302 /* PropertyAssignment */ || memberDecl.kind === 173 /* MethodDeclaration */) && isContextSensitive(memberDecl)) {
70250
+ if (shouldAddAsIntraExpressionInferenceSite) {
70246
70251
  const inferenceContext = getInferenceContext(node);
70247
70252
  Debug.assert(inferenceContext);
70248
70253
  const inferenceNode = memberDecl.kind === 302 /* PropertyAssignment */ ? memberDecl.initializer : memberDecl;
@@ -70415,7 +70420,9 @@ ${lanes.join("\n")}
70415
70420
  for (const attributeDecl of attributes.properties) {
70416
70421
  const member = attributeDecl.symbol;
70417
70422
  if (isJsxAttribute(attributeDecl)) {
70418
- const exprType = checkJsxAttribute(attributeDecl, checkMode);
70423
+ const shouldAddAsIntraExpressionInferenceSite = contextualType && checkMode & 2 /* Inferential */ && !(checkMode & (4 /* SkipContextSensitive */ | 16 /* SkipAddingIntraExpressionSites */)) && isContextSensitive(attributeDecl);
70424
+ const attributeCheckMode = checkMode | (shouldAddAsIntraExpressionInferenceSite ? 16 /* SkipAddingIntraExpressionSites */ : 0);
70425
+ const exprType = checkJsxAttribute(attributeDecl, attributeCheckMode);
70419
70426
  objectFlags |= getObjectFlags(exprType) & 458752 /* PropagatingFlags */;
70420
70427
  const attributeSymbol = createSymbol(4 /* Property */ | member.flags, member.escapedName);
70421
70428
  attributeSymbol.declarations = member.declarations;
@@ -70436,7 +70443,7 @@ ${lanes.join("\n")}
70436
70443
  addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText);
70437
70444
  }
70438
70445
  }
70439
- if (contextualType && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && isContextSensitive(attributeDecl)) {
70446
+ if (shouldAddAsIntraExpressionInferenceSite) {
70440
70447
  const inferenceContext = getInferenceContext(attributes);
70441
70448
  Debug.assert(inferenceContext);
70442
70449
  const inferenceNode = attributeDecl.initializer.expression;
@@ -72054,7 +72061,7 @@ ${lanes.join("\n")}
72054
72061
  }
72055
72062
  for (let i = 0; i < argCount; i++) {
72056
72063
  const arg = args[i];
72057
- if (arg.kind !== 231 /* OmittedExpression */ && !(checkMode & 32 /* IsForStringLiteralArgumentCompletions */ && hasSkipDirectInferenceFlag(arg))) {
72064
+ if (arg.kind !== 231 /* OmittedExpression */ && !(checkMode & 64 /* IsForStringLiteralArgumentCompletions */ && hasSkipDirectInferenceFlag(arg))) {
72058
72065
  const paramType = getTypeAtPosition(signature, i);
72059
72066
  if (couldContainTypeVariables(paramType)) {
72060
72067
  const argType = checkExpressionWithContextualType(arg, paramType, context, checkMode);
@@ -72667,12 +72674,12 @@ ${lanes.join("\n")}
72667
72674
  const args = getEffectiveCallArguments(node);
72668
72675
  const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters;
72669
72676
  let argCheckMode = !isDecorator2 && !isSingleNonGenericCandidate && some(args, isContextSensitive) ? 4 /* SkipContextSensitive */ : 0 /* Normal */;
72670
- argCheckMode |= checkMode & 32 /* IsForStringLiteralArgumentCompletions */;
72677
+ argCheckMode |= checkMode & 64 /* IsForStringLiteralArgumentCompletions */;
72671
72678
  let candidatesForArgumentError;
72672
72679
  let candidateForArgumentArityError;
72673
72680
  let candidateForTypeArgumentError;
72674
72681
  let result;
72675
- const signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 212 /* CallExpression */ && node.arguments.hasTrailingComma;
72682
+ const signatureHelpTrailingComma = !!(checkMode & 32 /* IsForSignatureHelp */) && node.kind === 212 /* CallExpression */ && node.arguments.hasTrailingComma;
72676
72683
  if (candidates.length > 1) {
72677
72684
  result = chooseOverload(candidates, subtypeRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma);
72678
72685
  }
@@ -72891,7 +72898,7 @@ ${lanes.join("\n")}
72891
72898
  continue;
72892
72899
  }
72893
72900
  if (argCheckMode) {
72894
- argCheckMode = checkMode & 32 /* IsForStringLiteralArgumentCompletions */;
72901
+ argCheckMode = checkMode & 64 /* IsForStringLiteralArgumentCompletions */;
72895
72902
  if (inferenceContext) {
72896
72903
  const typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext);
72897
72904
  checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext.inferredTypeParameters);
@@ -75969,7 +75976,7 @@ ${lanes.join("\n")}
75969
75976
  case 36 /* ExclamationEqualsToken */:
75970
75977
  case 37 /* EqualsEqualsEqualsToken */:
75971
75978
  case 38 /* ExclamationEqualsEqualsToken */:
75972
- if (!(checkMode && checkMode & 128 /* TypeOnly */)) {
75979
+ if (!(checkMode && checkMode & 256 /* TypeOnly */)) {
75973
75980
  if (isLiteralExpressionOfObject(left) || isLiteralExpressionOfObject(right)) {
75974
75981
  const eqType = operator === 35 /* EqualsEqualsToken */ || operator === 37 /* EqualsEqualsEqualsToken */;
75975
75982
  error(errorNode, Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value, eqType ? "false" : "true");
@@ -76628,7 +76635,7 @@ ${lanes.join("\n")}
76628
76635
  }
76629
76636
  }
76630
76637
  const startInvocationCount = flowInvocationCount;
76631
- const type = checkExpression(node, 128 /* TypeOnly */);
76638
+ const type = checkExpression(node, 256 /* TypeOnly */);
76632
76639
  if (flowInvocationCount !== startInvocationCount) {
76633
76640
  const cache = flowTypeCache || (flowTypeCache = []);
76634
76641
  cache[getNodeId(node)] = type;
@@ -79099,7 +79106,7 @@ ${lanes.join("\n")}
79099
79106
  checkComputedPropertyName(node.propertyName);
79100
79107
  }
79101
79108
  const parent2 = node.parent.parent;
79102
- const parentCheckMode = node.dotDotDotToken ? 64 /* RestBindingElement */ : 0 /* Normal */;
79109
+ const parentCheckMode = node.dotDotDotToken ? 128 /* RestBindingElement */ : 0 /* Normal */;
79103
79110
  const parentType = getTypeForBindingElementParent(parent2, parentCheckMode);
79104
79111
  const name = node.propertyName || node.name;
79105
79112
  if (parentType && !isBindingPattern(name)) {
@@ -85835,10 +85842,11 @@ ${lanes.join("\n")}
85835
85842
  CheckMode3[CheckMode3["Inferential"] = 2] = "Inferential";
85836
85843
  CheckMode3[CheckMode3["SkipContextSensitive"] = 4] = "SkipContextSensitive";
85837
85844
  CheckMode3[CheckMode3["SkipGenericFunctions"] = 8] = "SkipGenericFunctions";
85838
- CheckMode3[CheckMode3["IsForSignatureHelp"] = 16] = "IsForSignatureHelp";
85839
- CheckMode3[CheckMode3["IsForStringLiteralArgumentCompletions"] = 32] = "IsForStringLiteralArgumentCompletions";
85840
- CheckMode3[CheckMode3["RestBindingElement"] = 64] = "RestBindingElement";
85841
- CheckMode3[CheckMode3["TypeOnly"] = 128] = "TypeOnly";
85845
+ CheckMode3[CheckMode3["SkipAddingIntraExpressionSites"] = 16] = "SkipAddingIntraExpressionSites";
85846
+ CheckMode3[CheckMode3["IsForSignatureHelp"] = 32] = "IsForSignatureHelp";
85847
+ CheckMode3[CheckMode3["IsForStringLiteralArgumentCompletions"] = 64] = "IsForStringLiteralArgumentCompletions";
85848
+ CheckMode3[CheckMode3["RestBindingElement"] = 128] = "RestBindingElement";
85849
+ CheckMode3[CheckMode3["TypeOnly"] = 256] = "TypeOnly";
85842
85850
  return CheckMode3;
85843
85851
  })(CheckMode || {});
85844
85852
  SignatureCheckMode = /* @__PURE__ */ ((SignatureCheckMode3) => {
@@ -110079,6 +110087,15 @@ ${lanes.join("\n")}
110079
110087
  getDeclarationEmitExtensionForPath(inputFileName)
110080
110088
  );
110081
110089
  }
110090
+ function getOutputDeclarationFileNameWithoutConfigFile(inputFileName, options, ignoreCase, currentDirectory, getCommonSourceDirectory2) {
110091
+ const directory = options.declarationDir || options.outDir ? getNormalizedAbsolutePath(options.declarationDir || options.outDir, currentDirectory) : void 0;
110092
+ const outputPathWithoutChangedExtension = directory ? resolvePath(directory, getRelativePathFromDirectory(getCommonSourceDirectory2(), inputFileName, ignoreCase)) : inputFileName;
110093
+ const outputFileName = changeExtension(
110094
+ outputPathWithoutChangedExtension,
110095
+ getDeclarationEmitExtensionForPath(inputFileName)
110096
+ );
110097
+ return outputFileName;
110098
+ }
110082
110099
  function getOutputJSFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory2) {
110083
110100
  if (configFile.options.emitDeclarationOnly)
110084
110101
  return void 0;
@@ -110089,6 +110106,18 @@ ${lanes.join("\n")}
110089
110106
  );
110090
110107
  return !isJsonFile || comparePaths(inputFileName, outputFileName, Debug.checkDefined(configFile.options.configFilePath), ignoreCase) !== 0 /* EqualTo */ ? outputFileName : void 0;
110091
110108
  }
110109
+ function getOutputJSFileNameWithoutConfigFile(inputFileName, options, ignoreCase, currentDirectory, getCommonSourceDirectory2) {
110110
+ if (options.emitDeclarationOnly)
110111
+ return void 0;
110112
+ const isJsonFile = fileExtensionIs(inputFileName, ".json" /* Json */);
110113
+ const outDir = options.outDir ? getNormalizedAbsolutePath(options.outDir, currentDirectory) : void 0;
110114
+ const outputPathWithoutChangedExtension = outDir ? resolvePath(outDir, getRelativePathFromDirectory(getCommonSourceDirectory2(), inputFileName, ignoreCase)) : inputFileName;
110115
+ const outputFileName = changeExtension(
110116
+ outputPathWithoutChangedExtension,
110117
+ getOutputExtension(inputFileName, options)
110118
+ );
110119
+ return !isJsonFile || !options.configFilePath || comparePaths(inputFileName, outputFileName, options.configFilePath, ignoreCase) !== 0 /* EqualTo */ ? outputFileName : void 0;
110120
+ }
110092
110121
  function createAddOutput() {
110093
110122
  let outputs;
110094
110123
  return { addOutput, getOutputs };
@@ -116619,6 +116648,15 @@ ${lanes.join("\n")}
116619
116648
  return { impliedNodeFormat, packageJsonLocations, packageJsonScope };
116620
116649
  }
116621
116650
  }
116651
+ function moduleFormatNeedsPackageJsonLookup(fileName, options) {
116652
+ switch (getEmitModuleResolutionKind(options)) {
116653
+ case 3 /* Node16 */:
116654
+ case 99 /* NodeNext */:
116655
+ return fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */, ".ts" /* Ts */, ".tsx" /* Tsx */, ".js" /* Js */, ".jsx" /* Jsx */]);
116656
+ default:
116657
+ return false;
116658
+ }
116659
+ }
116622
116660
  function shouldProgramCreateNewSourceFiles(program, newOptions) {
116623
116661
  if (!program)
116624
116662
  return false;
@@ -116645,6 +116683,7 @@ ${lanes.join("\n")}
116645
116683
  let files;
116646
116684
  let symlinks;
116647
116685
  let commonSourceDirectory;
116686
+ let assumedCommonSourceDirectory;
116648
116687
  let typeChecker;
116649
116688
  let classifiableNames;
116650
116689
  const ambientModuleNameToUnmodifiedFileName = /* @__PURE__ */ new Map();
@@ -117136,6 +117175,9 @@ ${lanes.join("\n")}
117136
117175
  }
117137
117176
  return commonSourceDirectory;
117138
117177
  }
117178
+ function getAssumedCommonSourceDirectory() {
117179
+ return commonSourceDirectory ?? (assumedCommonSourceDirectory ?? (assumedCommonSourceDirectory = getCommonSourceDirectory(options, () => rootNames, host.getCurrentDirectory(), getCanonicalFileName)));
117180
+ }
117139
117181
  function getClassifiableNames() {
117140
117182
  var _a2;
117141
117183
  if (!classifiableNames) {
@@ -117359,7 +117401,7 @@ ${lanes.join("\n")}
117359
117401
  })(SeenPackageName || (SeenPackageName = {}));
117360
117402
  const seenPackageNames = /* @__PURE__ */ new Map();
117361
117403
  for (const oldSourceFile of oldSourceFiles) {
117362
- const sourceFileOptions = getCreateSourceFileOptions(oldSourceFile.fileName, moduleResolutionCache, host, options);
117404
+ const sourceFileOptions = getCreateSourceFileOptions(oldSourceFile.fileName);
117363
117405
  let newSourceFile = host.getSourceFileByPath ? host.getSourceFileByPath(
117364
117406
  oldSourceFile.fileName,
117365
117407
  oldSourceFile.resolvedPath,
@@ -118321,10 +118363,48 @@ ${lanes.join("\n")}
118321
118363
  (_b2 = tracing) == null ? void 0 : _b2.pop();
118322
118364
  return result;
118323
118365
  }
118324
- function getCreateSourceFileOptions(fileName, moduleResolutionCache2, host2, options2) {
118325
- const result = getImpliedNodeFormatForFileWorker(getNormalizedAbsolutePath(fileName, currentDirectory), moduleResolutionCache2 == null ? void 0 : moduleResolutionCache2.getPackageJsonInfoCache(), host2, options2);
118326
- const languageVersion = getEmitScriptTarget(options2);
118327
- const setExternalModuleIndicator2 = getSetExternalModuleIndicator(options2);
118366
+ function getImpliedNodeFormatForFile2(fileName) {
118367
+ let fileNameForModuleFormatDetection = getNormalizedAbsolutePath(fileName, currentDirectory);
118368
+ if (moduleFormatNeedsPackageJsonLookup(fileName, options)) {
118369
+ const projectReference = getResolvedProjectReferenceToRedirect(fileName);
118370
+ if (projectReference) {
118371
+ Debug.assert(useSourceOfProjectReferenceRedirect);
118372
+ fileNameForModuleFormatDetection = getOutputDeclarationFileName(
118373
+ fileNameForModuleFormatDetection,
118374
+ projectReference.commandLine,
118375
+ !host.useCaseSensitiveFileNames()
118376
+ ) || getOutputJSFileName(
118377
+ fileNameForModuleFormatDetection,
118378
+ projectReference.commandLine,
118379
+ !host.useCaseSensitiveFileNames()
118380
+ ) || fileNameForModuleFormatDetection;
118381
+ } else {
118382
+ fileNameForModuleFormatDetection = getOutputDeclarationFileNameWithoutConfigFile(
118383
+ fileNameForModuleFormatDetection,
118384
+ options,
118385
+ !host.useCaseSensitiveFileNames(),
118386
+ currentDirectory,
118387
+ getAssumedCommonSourceDirectory
118388
+ ) || getOutputJSFileNameWithoutConfigFile(
118389
+ fileNameForModuleFormatDetection,
118390
+ options,
118391
+ !host.useCaseSensitiveFileNames(),
118392
+ currentDirectory,
118393
+ getAssumedCommonSourceDirectory
118394
+ ) || fileNameForModuleFormatDetection;
118395
+ }
118396
+ }
118397
+ return getImpliedNodeFormatForFileWorker(
118398
+ fileNameForModuleFormatDetection,
118399
+ moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache(),
118400
+ host,
118401
+ options
118402
+ );
118403
+ }
118404
+ function getCreateSourceFileOptions(fileName) {
118405
+ const result = getImpliedNodeFormatForFile2(fileName);
118406
+ const languageVersion = getEmitScriptTarget(options);
118407
+ const setExternalModuleIndicator2 = getSetExternalModuleIndicator(options);
118328
118408
  return typeof result === "object" ? { ...result, languageVersion, setExternalModuleIndicator: setExternalModuleIndicator2 } : { languageVersion, impliedNodeFormat: result, setExternalModuleIndicator: setExternalModuleIndicator2 };
118329
118409
  }
118330
118410
  function findSourceFileWorker(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId) {
@@ -118396,7 +118476,7 @@ ${lanes.join("\n")}
118396
118476
  redirectedPath = toPath3(redirect);
118397
118477
  }
118398
118478
  }
118399
- const sourceFileOptions = getCreateSourceFileOptions(fileName, moduleResolutionCache, host, options);
118479
+ const sourceFileOptions = getCreateSourceFileOptions(fileName);
118400
118480
  const file = host.getSourceFile(
118401
118481
  fileName,
118402
118482
  sourceFileOptions,
@@ -119019,6 +119099,9 @@ ${lanes.join("\n")}
119019
119099
  createDiagnosticForOptionName(Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files, "outDir");
119020
119100
  }
119021
119101
  }
119102
+ if (assumedCommonSourceDirectory && assumedCommonSourceDirectory !== getCommonSourceDirectory2()) {
119103
+ programDiagnostics.add(createCompilerDiagnostic(Diagnostics.The_project_root_is_ambiguous_but_is_required_to_determine_the_module_format_of_output_js_files_Supply_the_rootDir_compiler_option_to_disambiguate));
119104
+ }
119022
119105
  if (options.useDefineForClassFields && languageVersion === 0 /* ES3 */) {
119023
119106
  createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_when_option_target_is_ES3, "useDefineForClassFields");
119024
119107
  }
@@ -162110,13 +162193,29 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
162110
162193
  if (!signature || !candidates.length) {
162111
162194
  return;
162112
162195
  }
162113
- for (let i = 0; i < args.length; ++i) {
162114
- const originalArg = args[i];
162196
+ let signatureParamPos = 0;
162197
+ for (const originalArg of args) {
162115
162198
  const arg = skipParentheses(originalArg);
162116
162199
  if (shouldShowLiteralParameterNameHintsOnly(preferences) && !isHintableLiteral(arg)) {
162117
162200
  continue;
162118
162201
  }
162119
- const identifierNameInfo = checker.getParameterIdentifierNameAtPosition(signature, i);
162202
+ let spreadArgs = 0;
162203
+ if (isSpreadElement(arg)) {
162204
+ const spreadType = checker.getTypeAtLocation(arg.expression);
162205
+ if (checker.isTupleType(spreadType)) {
162206
+ const { elementFlags, fixedLength } = spreadType.target;
162207
+ if (fixedLength === 0) {
162208
+ continue;
162209
+ }
162210
+ const firstOptionalIndex = findIndex(elementFlags, (f) => !(f & 1 /* Required */));
162211
+ const requiredArgs = firstOptionalIndex < 0 ? fixedLength : firstOptionalIndex;
162212
+ if (requiredArgs > 0) {
162213
+ spreadArgs = firstOptionalIndex < 0 ? fixedLength : firstOptionalIndex;
162214
+ }
162215
+ }
162216
+ }
162217
+ const identifierNameInfo = checker.getParameterIdentifierNameAtPosition(signature, signatureParamPos);
162218
+ signatureParamPos = signatureParamPos + (spreadArgs || 1);
162120
162219
  if (identifierNameInfo) {
162121
162220
  const [parameterName, isFirstVariadicArgument] = identifierNameInfo;
162122
162221
  const isParameterNameNotSameAsArgument = preferences.includeInlayParameterNameHintsWhenArgumentMatchesName || !identifierOrAccessExpressionPostfixMatchesParameterName(arg, parameterName);
@@ -170545,8 +170644,11 @@ ${options.prefix}` : "\n" : options.prefix
170545
170644
  getOriginalNodeId: () => getOriginalNodeId,
170546
170645
  getOriginalSourceFile: () => getOriginalSourceFile,
170547
170646
  getOutputDeclarationFileName: () => getOutputDeclarationFileName,
170647
+ getOutputDeclarationFileNameWithoutConfigFile: () => getOutputDeclarationFileNameWithoutConfigFile,
170548
170648
  getOutputExtension: () => getOutputExtension,
170549
170649
  getOutputFileNames: () => getOutputFileNames,
170650
+ getOutputJSFileName: () => getOutputJSFileName,
170651
+ getOutputJSFileNameWithoutConfigFile: () => getOutputJSFileNameWithoutConfigFile,
170550
170652
  getOutputPathsFor: () => getOutputPathsFor,
170551
170653
  getOutputPathsForBundle: () => getOutputPathsForBundle,
170552
170654
  getOwnEmitOutputFilePath: () => getOwnEmitOutputFilePath,
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.2";
57
- var version = `${versionMajorMinor}.0-insiders.20230602`;
57
+ var version = `${versionMajorMinor}.0-insiders.20230605`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -5512,6 +5512,7 @@ var Diagnostics = {
5512
5512
  The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate: diag(2210, 1 /* Error */, "The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_roo_2210", "The project root is ambiguous, but is required to resolve import map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."),
5513
5513
  Add_extends_constraint: diag(2211, 3 /* Message */, "Add_extends_constraint_2211", "Add `extends` constraint."),
5514
5514
  Add_extends_constraint_to_all_type_parameters: diag(2212, 3 /* Message */, "Add_extends_constraint_to_all_type_parameters_2212", "Add `extends` constraint to all type parameters"),
5515
+ The_project_root_is_ambiguous_but_is_required_to_determine_the_module_format_of_output_js_files_Supply_the_rootDir_compiler_option_to_disambiguate: diag(2213, 1 /* Error */, "The_project_root_is_ambiguous_but_is_required_to_determine_the_module_format_of_output_js_files_Supp_2213", "The project root is ambiguous, but is required to determine the module format of output '.js' files. Supply the `rootDir` compiler option to disambiguate."),
5515
5516
  Duplicate_identifier_0: diag(2300, 1 /* Error */, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."),
5516
5517
  Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2301, 1 /* Error */, "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),
5517
5518
  Static_members_cannot_reference_class_type_parameters: diag(2302, 1 /* Error */, "Static_members_cannot_reference_class_type_parameters_2302", "Static members cannot reference class type parameters."),
@@ -28918,10 +28919,11 @@ var CheckMode = /* @__PURE__ */ ((CheckMode3) => {
28918
28919
  CheckMode3[CheckMode3["Inferential"] = 2] = "Inferential";
28919
28920
  CheckMode3[CheckMode3["SkipContextSensitive"] = 4] = "SkipContextSensitive";
28920
28921
  CheckMode3[CheckMode3["SkipGenericFunctions"] = 8] = "SkipGenericFunctions";
28921
- CheckMode3[CheckMode3["IsForSignatureHelp"] = 16] = "IsForSignatureHelp";
28922
- CheckMode3[CheckMode3["IsForStringLiteralArgumentCompletions"] = 32] = "IsForStringLiteralArgumentCompletions";
28923
- CheckMode3[CheckMode3["RestBindingElement"] = 64] = "RestBindingElement";
28924
- CheckMode3[CheckMode3["TypeOnly"] = 128] = "TypeOnly";
28922
+ CheckMode3[CheckMode3["SkipAddingIntraExpressionSites"] = 16] = "SkipAddingIntraExpressionSites";
28923
+ CheckMode3[CheckMode3["IsForSignatureHelp"] = 32] = "IsForSignatureHelp";
28924
+ CheckMode3[CheckMode3["IsForStringLiteralArgumentCompletions"] = 64] = "IsForStringLiteralArgumentCompletions";
28925
+ CheckMode3[CheckMode3["RestBindingElement"] = 128] = "RestBindingElement";
28926
+ CheckMode3[CheckMode3["TypeOnly"] = 256] = "TypeOnly";
28925
28927
  return CheckMode3;
28926
28928
  })(CheckMode || {});
28927
28929
  var SignatureCheckMode = /* @__PURE__ */ ((SignatureCheckMode3) => {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@typescript-deploys/pr-build",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.2.0-pr-54507-7",
5
+ "version": "5.2.0-pr-54546-4",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -115,5 +115,5 @@
115
115
  "node": "20.1.0",
116
116
  "npm": "8.19.4"
117
117
  },
118
- "gitHead": "a50ac33a68c1cc4059ff2702e6f2e8e0dc227ea7"
118
+ "gitHead": "446ee953056bfa863934a25998e0655dfd8cbac3"
119
119
  }