@typescript-deploys/pr-build 6.0.0-pr-62093-21 → 6.0.0-pr-62350-6

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
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "6.0";
21
- var version = `${versionMajorMinor}.0-insiders.20250820`;
21
+ var version = `${versionMajorMinor}.0-insiders.20250903`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -6995,7 +6995,7 @@ var Diagnostics = {
6995
6995
  The_root_value_of_a_0_file_must_be_an_object: diag(5092, 1 /* Error */, "The_root_value_of_a_0_file_must_be_an_object_5092", "The root value of a '{0}' file must be an object."),
6996
6996
  Compiler_option_0_may_only_be_used_with_build: diag(5093, 1 /* Error */, "Compiler_option_0_may_only_be_used_with_build_5093", "Compiler option '--{0}' may only be used with '--build'."),
6997
6997
  Compiler_option_0_may_not_be_used_with_build: diag(5094, 1 /* Error */, "Compiler_option_0_may_not_be_used_with_build_5094", "Compiler option '--{0}' may not be used with '--build'."),
6998
- Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later: diag(5095, 1 /* Error */, "Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later_5095", "Option '{0}' can only be used when 'module' is set to 'preserve' or to 'es2015' or later."),
6998
+ Option_0_can_only_be_used_when_module_is_set_to_preserve_commonjs_or_es2015_or_later: diag(5095, 1 /* Error */, "Option_0_can_only_be_used_when_module_is_set_to_preserve_commonjs_or_es2015_or_later_5095", "Option '{0}' can only be used when 'module' is set to 'preserve', 'commonjs', or 'es2015' or later."),
6999
6999
  Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set: diag(5096, 1 /* Error */, "Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set_5096", "Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set."),
7000
7000
  An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled: diag(5097, 1 /* Error */, "An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled_5097", "An import path can only end with a '{0}' extension when 'allowImportingTsExtensions' is enabled."),
7001
7001
  Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler: diag(5098, 1 /* Error */, "Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098", "Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'."),
@@ -14890,6 +14890,22 @@ function isVariableDeclarationInitializedToBareOrAccessedRequire(node) {
14890
14890
  function isBindingElementOfBareOrAccessedRequire(node) {
14891
14891
  return isBindingElement(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(node.parent.parent);
14892
14892
  }
14893
+ function getModuleSpecifierOfBareOrAccessedRequire(node) {
14894
+ if (isVariableDeclarationInitializedToRequire(node)) {
14895
+ return node.initializer.arguments[0];
14896
+ }
14897
+ if (isVariableDeclarationInitializedToBareOrAccessedRequire(node)) {
14898
+ const leftmost = getLeftmostAccessExpression(node.initializer);
14899
+ if (isRequireCall(
14900
+ leftmost,
14901
+ /*requireStringLiteralLikeArgument*/
14902
+ true
14903
+ )) {
14904
+ return leftmost.arguments[0];
14905
+ }
14906
+ }
14907
+ return void 0;
14908
+ }
14893
14909
  function isVariableDeclarationInitializedWithRequireHelper(node, allowAccessedRequire) {
14894
14910
  return isVariableDeclaration(node) && !!node.initializer && isRequireCall(
14895
14911
  allowAccessedRequire ? getLeftmostAccessExpression(node.initializer) : node.initializer,
@@ -17966,9 +17982,6 @@ var _computedOptions = createComputedCompilerOptions({
17966
17982
  let moduleResolution = compilerOptions.moduleResolution;
17967
17983
  if (moduleResolution === void 0) {
17968
17984
  switch (_computedOptions.module.computeValue(compilerOptions)) {
17969
- case 1 /* CommonJS */:
17970
- moduleResolution = 2 /* Node10 */;
17971
- break;
17972
17985
  case 100 /* Node16 */:
17973
17986
  case 101 /* Node18 */:
17974
17987
  case 102 /* Node20 */:
@@ -17977,6 +17990,7 @@ var _computedOptions = createComputedCompilerOptions({
17977
17990
  case 199 /* NodeNext */:
17978
17991
  moduleResolution = 99 /* NodeNext */;
17979
17992
  break;
17993
+ case 1 /* CommonJS */:
17980
17994
  case 200 /* Preserve */:
17981
17995
  moduleResolution = 100 /* Bundler */;
17982
17996
  break;
@@ -49409,11 +49423,7 @@ function createTypeChecker(host) {
49409
49423
  return ambientModule;
49410
49424
  }
49411
49425
  const currentSourceFile = getSourceFileOfNode(location);
49412
- const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _a.name) || ((_b = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _b.argument.literal) || (isVariableDeclaration(location) && location.initializer && isRequireCall(
49413
- location.initializer,
49414
- /*requireStringLiteralLikeArgument*/
49415
- true
49416
- ) ? location.initializer.arguments[0] : void 0) || ((_c = findAncestor(location, isImportCall)) == null ? void 0 : _c.arguments[0]) || ((_d = findAncestor(location, or(isImportDeclaration, isJSDocImportTag, isExportDeclaration))) == null ? void 0 : _d.moduleSpecifier) || ((_e = findAncestor(location, isExternalModuleImportEqualsDeclaration)) == null ? void 0 : _e.moduleReference.expression);
49426
+ const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _a.name) || ((_b = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _b.argument.literal) || isVariableDeclarationInitializedToBareOrAccessedRequire(location) && getModuleSpecifierOfBareOrAccessedRequire(location) || ((_c = findAncestor(location, isImportCall)) == null ? void 0 : _c.arguments[0]) || ((_d = findAncestor(location, or(isImportDeclaration, isJSDocImportTag, isExportDeclaration))) == null ? void 0 : _d.moduleSpecifier) || ((_e = findAncestor(location, isExternalModuleImportEqualsDeclaration)) == null ? void 0 : _e.moduleReference.expression);
49417
49427
  const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? host.getModeForUsageLocation(currentSourceFile, contextSpecifier) : host.getDefaultResolutionModeForFile(currentSourceFile);
49418
49428
  const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
49419
49429
  const resolvedModule = (_f = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _f.resolvedModule;
@@ -55712,21 +55722,21 @@ function createTypeChecker(host) {
55712
55722
  function isErrorType(type) {
55713
55723
  return type === errorType || !!(type.flags & 1 /* Any */ && type.aliasSymbol);
55714
55724
  }
55715
- function getTypeForBindingElementParent(node, checkMode) {
55716
- if (checkMode !== 0 /* Normal */) {
55717
- return getTypeForVariableLikeDeclaration(
55718
- node,
55719
- /*includeOptionality*/
55720
- false,
55721
- checkMode
55722
- );
55725
+ function getTypeForBindingElementParent(node) {
55726
+ const grandparent = node.parent.parent;
55727
+ const rootParameter = tryGetRootParameterDeclaration(node);
55728
+ if (rootParameter) {
55729
+ const symbol = getSymbolOfDeclaration(grandparent);
55730
+ const contextualParameterType = symbol && getSymbolLinks(symbol).type;
55731
+ if (contextualParameterType) {
55732
+ return contextualParameterType;
55733
+ }
55723
55734
  }
55724
- const symbol = getSymbolOfDeclaration(node);
55725
- return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(
55726
- node,
55735
+ return getTypeForVariableLikeDeclaration(
55736
+ grandparent,
55727
55737
  /*includeOptionality*/
55728
55738
  false,
55729
- checkMode
55739
+ node.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */
55730
55740
  );
55731
55741
  }
55732
55742
  function getRestType(source, properties, symbol) {
@@ -55831,8 +55841,7 @@ function createTypeChecker(host) {
55831
55841
  return type.flags & (128 /* StringLiteral */ | 256 /* NumberLiteral */) ? "" + type.value : void 0;
55832
55842
  }
55833
55843
  function getTypeForBindingElement(declaration) {
55834
- const checkMode = declaration.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */;
55835
- const parentType = getTypeForBindingElementParent(declaration.parent.parent, checkMode);
55844
+ const parentType = getTypeForBindingElementParent(declaration);
55836
55845
  return parentType && getBindingElementTypeFromParentType(
55837
55846
  declaration,
55838
55847
  parentType,
@@ -62559,7 +62568,7 @@ function createTypeChecker(host) {
62559
62568
  context.nonFixingMapper = combineTypeMappers(context.nonFixingMapper, mapper);
62560
62569
  }
62561
62570
  if (!checkTypeDeferred) {
62562
- inferTypes(context.inferences, checkType, extendsType, 1024 /* NoConstraints */ | 2048 /* AlwaysStrict */);
62571
+ inferTypes(context.inferences, checkType, extendsType, 512 /* NoConstraints */ | 1024 /* AlwaysStrict */);
62563
62572
  }
62564
62573
  combinedMapper = mapper ? combineTypeMappers(context.mapper, mapper) : context.mapper;
62565
62574
  }
@@ -66246,7 +66255,7 @@ function createTypeChecker(host) {
66246
66255
  0 /* None */,
66247
66256
  isRelatedToWorker
66248
66257
  );
66249
- inferTypes(ctx.inferences, target2.extendsType, sourceExtends, 1024 /* NoConstraints */ | 2048 /* AlwaysStrict */);
66258
+ inferTypes(ctx.inferences, target2.extendsType, sourceExtends, 512 /* NoConstraints */ | 1024 /* AlwaysStrict */);
66250
66259
  sourceExtends = instantiateType(sourceExtends, ctx.mapper);
66251
66260
  mapper = ctx.mapper;
66252
66261
  }
@@ -68511,7 +68520,7 @@ function createTypeChecker(host) {
68511
68520
  function inferTypes(inferences, originalSource, originalTarget, priority = 0 /* None */, contravariant = false) {
68512
68521
  let bivariant = false;
68513
68522
  let propagationType;
68514
- let inferencePriority = 4096 /* MaxValue */;
68523
+ let inferencePriority = 2048 /* MaxValue */;
68515
68524
  let visited;
68516
68525
  let sourceStack;
68517
68526
  let targetStack;
@@ -68586,18 +68595,13 @@ function createTypeChecker(host) {
68586
68595
  if (candidate === blockedStringType) {
68587
68596
  return;
68588
68597
  }
68589
- const combinedPriority = priority | (inference.individualPriority || 0 /* None */);
68590
- if (inference.priority === void 0 || priority < (inference.priority & ~512 /* DistributiveConditional */)) {
68598
+ if (inference.priority === void 0 || priority < inference.priority) {
68591
68599
  inference.candidates = void 0;
68592
68600
  inference.contraCandidates = void 0;
68593
68601
  inference.topLevel = true;
68594
- inference.priority = combinedPriority;
68602
+ inference.priority = priority;
68595
68603
  }
68596
- if (priority === (inference.priority & ~512 /* DistributiveConditional */)) {
68597
- if (inference.priority > combinedPriority) {
68598
- inference.priority = combinedPriority;
68599
- clearCachedInferences(inferences);
68600
- }
68604
+ if (priority === inference.priority) {
68601
68605
  if (contravariant && !bivariant) {
68602
68606
  if (!contains(inference.contraCandidates, candidate)) {
68603
68607
  inference.contraCandidates = append(inference.contraCandidates, candidate);
@@ -68679,7 +68683,7 @@ function createTypeChecker(host) {
68679
68683
  if (isGenericMappedType(source) && isGenericMappedType(target)) {
68680
68684
  invokeOnce(source, target, inferFromGenericMappedTypes);
68681
68685
  }
68682
- if (!(priority & 1024 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */))) {
68686
+ if (!(priority & 512 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */))) {
68683
68687
  const apparentSource = getApparentType(source);
68684
68688
  if (apparentSource !== source && !(apparentSource.flags & (524288 /* Object */ | 2097152 /* Intersection */))) {
68685
68689
  return inferFromTypes(apparentSource, target);
@@ -68718,7 +68722,7 @@ function createTypeChecker(host) {
68718
68722
  }
68719
68723
  (visited || (visited = /* @__PURE__ */ new Map())).set(key, -1 /* Circularity */);
68720
68724
  const saveInferencePriority = inferencePriority;
68721
- inferencePriority = 4096 /* MaxValue */;
68725
+ inferencePriority = 2048 /* MaxValue */;
68722
68726
  const saveExpandingFlags = expandingFlags;
68723
68727
  (sourceStack ?? (sourceStack = [])).push(source);
68724
68728
  (targetStack ?? (targetStack = [])).push(target);
@@ -68768,7 +68772,7 @@ function createTypeChecker(host) {
68768
68772
  contravariant = !contravariant;
68769
68773
  }
68770
68774
  function inferFromContravariantTypesIfStrictFunctionTypes(source, target) {
68771
- if (strictFunctionTypes || priority & 2048 /* AlwaysStrict */) {
68775
+ if (strictFunctionTypes || priority & 1024 /* AlwaysStrict */) {
68772
68776
  inferFromContravariantTypes(source, target);
68773
68777
  } else {
68774
68778
  inferFromTypes(source, target);
@@ -68809,7 +68813,7 @@ function createTypeChecker(host) {
68809
68813
  } else {
68810
68814
  for (let i = 0; i < sources.length; i++) {
68811
68815
  const saveInferencePriority = inferencePriority;
68812
- inferencePriority = 4096 /* MaxValue */;
68816
+ inferencePriority = 2048 /* MaxValue */;
68813
68817
  inferFromTypes(sources[i], t);
68814
68818
  if (inferencePriority === priority) matched[i] = true;
68815
68819
  inferenceCircularity = inferenceCircularity || inferencePriority === -1 /* Circularity */;
@@ -68888,11 +68892,6 @@ function createTypeChecker(host) {
68888
68892
  return false;
68889
68893
  }
68890
68894
  function inferToConditionalType(source, target) {
68891
- const info = target.root.isDistributive ? getInferenceInfoForType(getActualTypeVariable(target.checkType)) : void 0;
68892
- const saveIndividualPriority = info == null ? void 0 : info.individualPriority;
68893
- if (info) {
68894
- info.individualPriority = (info.individualPriority || 0 /* None */) | 512 /* DistributiveConditional */;
68895
- }
68896
68895
  if (source.flags & 16777216 /* Conditional */) {
68897
68896
  inferFromTypes(source.checkType, target.checkType);
68898
68897
  inferFromTypes(source.extendsType, target.extendsType);
@@ -68902,9 +68901,6 @@ function createTypeChecker(host) {
68902
68901
  const targetTypes = [getTrueTypeFromConditionalType(target), getFalseTypeFromConditionalType(target)];
68903
68902
  inferToMultipleTypesWithPriority(source, targetTypes, target.flags, contravariant ? 64 /* ContravariantConditional */ : 0);
68904
68903
  }
68905
- if (info) {
68906
- info.individualPriority = saveIndividualPriority;
68907
- }
68908
68904
  }
68909
68905
  function inferToTemplateLiteralType(source, target) {
68910
68906
  const matches = inferTypesFromTemplateLiteralType(source, target);
@@ -69145,14 +69141,14 @@ function createTypeChecker(host) {
69145
69141
  return candidates;
69146
69142
  }
69147
69143
  function getContravariantInference(inference) {
69148
- return inference.priority & 928 /* PriorityImpliesCombination */ ? getIntersectionType(inference.contraCandidates) : getCommonSubtype(inference.contraCandidates);
69144
+ return inference.priority & 416 /* PriorityImpliesCombination */ ? getIntersectionType(inference.contraCandidates) : getCommonSubtype(inference.contraCandidates);
69149
69145
  }
69150
69146
  function getCovariantInference(inference, signature) {
69151
69147
  const candidates = unionObjectAndArrayLiteralCandidates(inference.candidates);
69152
69148
  const primitiveConstraint = hasPrimitiveConstraint(inference.typeParameter) || isConstTypeVariable(inference.typeParameter);
69153
69149
  const widenLiteralTypes = !primitiveConstraint && inference.topLevel && (inference.isFixed || !isTypeParameterAtTopLevelInReturnType(signature, inference.typeParameter));
69154
69150
  const baseCandidates = primitiveConstraint ? sameMap(candidates, getRegularTypeOfLiteralType) : widenLiteralTypes ? sameMap(candidates, getWidenedLiteralType) : candidates;
69155
- const unwidenedType = inference.priority & 928 /* PriorityImpliesCombination */ ? getUnionType(baseCandidates, 2 /* Subtype */) : getCommonSupertype(baseCandidates);
69151
+ const unwidenedType = inference.priority & 416 /* PriorityImpliesCombination */ ? getUnionType(baseCandidates, 2 /* Subtype */) : getCommonSupertype(baseCandidates);
69156
69152
  return getWidenedType(unwidenedType);
69157
69153
  }
69158
69154
  function getInferredType(context, index) {
@@ -71866,22 +71862,22 @@ function createTypeChecker(host) {
71866
71862
  const type = getTypeOfSymbol(symbol);
71867
71863
  const declaration = symbol.valueDeclaration;
71868
71864
  if (declaration) {
71869
- if (isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) {
71865
+ if (isBindingElement(declaration) && !declaration.initializer && declaration.parent.elements.length >= 2) {
71870
71866
  const parent = declaration.parent.parent;
71871
71867
  const rootDeclaration = getRootDeclaration(parent);
71872
71868
  if (rootDeclaration.kind === 261 /* VariableDeclaration */ && getCombinedNodeFlagsCached(rootDeclaration) & 6 /* Constant */ || rootDeclaration.kind === 170 /* Parameter */) {
71873
71869
  const links = getNodeLinks(parent);
71874
71870
  if (!(links.flags & 4194304 /* InCheckIdentifier */)) {
71875
71871
  links.flags |= 4194304 /* InCheckIdentifier */;
71876
- const parentType = getTypeForBindingElementParent(parent, 0 /* Normal */);
71877
- const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType);
71872
+ const parentType = getTypeForBindingElementParent(declaration);
71873
+ const parentNarrowableType = parentType && getNarrowableTypeForReference(parentType, location);
71878
71874
  links.flags &= ~4194304 /* InCheckIdentifier */;
71879
- if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(rootDeclaration.kind === 170 /* Parameter */ && isSomeSymbolAssigned(rootDeclaration))) {
71875
+ if (parentNarrowableType && parentNarrowableType.flags & 1048576 /* Union */ && !(rootDeclaration.kind === 170 /* Parameter */ && isSomeSymbolAssigned(rootDeclaration))) {
71880
71876
  const pattern = declaration.parent;
71881
71877
  const narrowedType = getFlowTypeOfReference(
71882
71878
  pattern,
71883
- parentTypeConstraint,
71884
- parentTypeConstraint,
71879
+ parentNarrowableType,
71880
+ parentNarrowableType,
71885
71881
  /*flowContainer*/
71886
71882
  void 0,
71887
71883
  location.flowNode
@@ -83220,8 +83216,7 @@ function createTypeChecker(host) {
83220
83216
  checkComputedPropertyName(node.propertyName);
83221
83217
  }
83222
83218
  const parent = node.parent.parent;
83223
- const parentCheckMode = node.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */;
83224
- const parentType = getTypeForBindingElementParent(parent, parentCheckMode);
83219
+ const parentType = getTypeForBindingElementParent(node);
83225
83220
  const name = node.propertyName || node.name;
83226
83221
  if (parentType && !isBindingPattern(name)) {
83227
83222
  const exprType = getLiteralTypeFromPropertyName(name);
@@ -124458,8 +124453,8 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
124458
124453
  if (options.customConditions && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
124459
124454
  createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "customConditions");
124460
124455
  }
124461
- if (moduleResolution === 100 /* Bundler */ && !emitModuleKindIsNonNodeESM(moduleKind) && moduleKind !== 200 /* Preserve */) {
124462
- createOptionValueDiagnostic("moduleResolution", Diagnostics.Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later, "bundler");
124456
+ if (moduleResolution === 100 /* Bundler */ && !emitModuleKindIsNonNodeESM(moduleKind) && moduleKind !== 200 /* Preserve */ && moduleKind !== 1 /* CommonJS */) {
124457
+ createOptionValueDiagnostic("moduleResolution", Diagnostics.Option_0_can_only_be_used_when_module_is_set_to_preserve_commonjs_or_es2015_or_later, "bundler");
124463
124458
  }
124464
124459
  if (ModuleKind[moduleKind] && (100 /* Node16 */ <= moduleKind && moduleKind <= 199 /* NodeNext */) && !(3 /* Node16 */ <= moduleResolution && moduleResolution <= 99 /* NodeNext */)) {
124465
124460
  const moduleKindName = ModuleKind[moduleKind];
@@ -124506,7 +124501,7 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
124506
124501
  function getIgnoreDeprecationsVersion() {
124507
124502
  const ignoreDeprecations = options.ignoreDeprecations;
124508
124503
  if (ignoreDeprecations) {
124509
- if (ignoreDeprecations === "5.0") {
124504
+ if (ignoreDeprecations === "5.0" || ignoreDeprecations === "6.0") {
124510
124505
  return new Version(ignoreDeprecations);
124511
124506
  }
124512
124507
  reportInvalidIgnoreDeprecations();
@@ -124615,6 +124610,11 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
124615
124610
  );
124616
124611
  }
124617
124612
  });
124613
+ checkDeprecations("6.0", "7.0", createDiagnostic, (createDeprecatedDiagnostic) => {
124614
+ if (options.moduleResolution === 2 /* Node10 */) {
124615
+ createDeprecatedDiagnostic("moduleResolution", "node10");
124616
+ }
124617
+ });
124618
124618
  }
124619
124619
  function verifyDeprecatedProjectReference(ref, parentFile, index) {
124620
124620
  function createDiagnostic(_name, _value, _useInstead, message, ...args) {
@@ -2530,6 +2530,7 @@ declare namespace ts {
2530
2530
  Node = "node",
2531
2531
  /** @deprecated Renamed to `Node10` */
2532
2532
  NodeJs = "node",
2533
+ /** @deprecated */
2533
2534
  Node10 = "node10",
2534
2535
  Node16 = "node16",
2535
2536
  NodeNext = "nodenext",
@@ -6893,11 +6894,10 @@ declare namespace ts {
6893
6894
  ContravariantConditional = 64,
6894
6895
  ReturnType = 128,
6895
6896
  LiteralKeyof = 256,
6896
- DistributiveConditional = 512,
6897
- NoConstraints = 1024,
6898
- AlwaysStrict = 2048,
6899
- MaxValue = 4096,
6900
- PriorityImpliesCombination = 928,
6897
+ NoConstraints = 512,
6898
+ AlwaysStrict = 1024,
6899
+ MaxValue = 2048,
6900
+ PriorityImpliesCombination = 416,
6901
6901
  Circularity = -1,
6902
6902
  }
6903
6903
  interface FileExtensionInfo {
@@ -6959,6 +6959,9 @@ declare namespace ts {
6959
6959
  * Use the new name or consider switching to a modern module resolution target.
6960
6960
  */
6961
6961
  NodeJs = 2,
6962
+ /**
6963
+ * @deprecated
6964
+ */
6962
6965
  Node10 = 2,
6963
6966
  Node16 = 3,
6964
6967
  NodeNext = 99,
package/lib/typescript.js CHANGED
@@ -881,6 +881,7 @@ __export(typescript_exports, {
881
881
  getModuleInstanceState: () => getModuleInstanceState,
882
882
  getModuleNameStringLiteralAt: () => getModuleNameStringLiteralAt,
883
883
  getModuleSpecifierEndingPreference: () => getModuleSpecifierEndingPreference,
884
+ getModuleSpecifierOfBareOrAccessedRequire: () => getModuleSpecifierOfBareOrAccessedRequire,
884
885
  getModuleSpecifierResolverHost: () => getModuleSpecifierResolverHost,
885
886
  getNameForExportedSymbol: () => getNameForExportedSymbol,
886
887
  getNameFromImportAttribute: () => getNameFromImportAttribute,
@@ -2285,7 +2286,7 @@ module.exports = __toCommonJS(typescript_exports);
2285
2286
 
2286
2287
  // src/compiler/corePublic.ts
2287
2288
  var versionMajorMinor = "6.0";
2288
- var version = `${versionMajorMinor}.0-insiders.20250820`;
2289
+ var version = `${versionMajorMinor}.0-insiders.20250903`;
2289
2290
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2290
2291
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2291
2292
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -6641,11 +6642,10 @@ var InferencePriority = /* @__PURE__ */ ((InferencePriority2) => {
6641
6642
  InferencePriority2[InferencePriority2["ContravariantConditional"] = 64] = "ContravariantConditional";
6642
6643
  InferencePriority2[InferencePriority2["ReturnType"] = 128] = "ReturnType";
6643
6644
  InferencePriority2[InferencePriority2["LiteralKeyof"] = 256] = "LiteralKeyof";
6644
- InferencePriority2[InferencePriority2["DistributiveConditional"] = 512] = "DistributiveConditional";
6645
- InferencePriority2[InferencePriority2["NoConstraints"] = 1024] = "NoConstraints";
6646
- InferencePriority2[InferencePriority2["AlwaysStrict"] = 2048] = "AlwaysStrict";
6647
- InferencePriority2[InferencePriority2["MaxValue"] = 4096] = "MaxValue";
6648
- InferencePriority2[InferencePriority2["PriorityImpliesCombination"] = 928] = "PriorityImpliesCombination";
6645
+ InferencePriority2[InferencePriority2["NoConstraints"] = 512] = "NoConstraints";
6646
+ InferencePriority2[InferencePriority2["AlwaysStrict"] = 1024] = "AlwaysStrict";
6647
+ InferencePriority2[InferencePriority2["MaxValue"] = 2048] = "MaxValue";
6648
+ InferencePriority2[InferencePriority2["PriorityImpliesCombination"] = 416] = "PriorityImpliesCombination";
6649
6649
  InferencePriority2[InferencePriority2["Circularity"] = -1] = "Circularity";
6650
6650
  return InferencePriority2;
6651
6651
  })(InferencePriority || {});
@@ -10382,7 +10382,7 @@ var Diagnostics = {
10382
10382
  The_root_value_of_a_0_file_must_be_an_object: diag(5092, 1 /* Error */, "The_root_value_of_a_0_file_must_be_an_object_5092", "The root value of a '{0}' file must be an object."),
10383
10383
  Compiler_option_0_may_only_be_used_with_build: diag(5093, 1 /* Error */, "Compiler_option_0_may_only_be_used_with_build_5093", "Compiler option '--{0}' may only be used with '--build'."),
10384
10384
  Compiler_option_0_may_not_be_used_with_build: diag(5094, 1 /* Error */, "Compiler_option_0_may_not_be_used_with_build_5094", "Compiler option '--{0}' may not be used with '--build'."),
10385
- Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later: diag(5095, 1 /* Error */, "Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later_5095", "Option '{0}' can only be used when 'module' is set to 'preserve' or to 'es2015' or later."),
10385
+ Option_0_can_only_be_used_when_module_is_set_to_preserve_commonjs_or_es2015_or_later: diag(5095, 1 /* Error */, "Option_0_can_only_be_used_when_module_is_set_to_preserve_commonjs_or_es2015_or_later_5095", "Option '{0}' can only be used when 'module' is set to 'preserve', 'commonjs', or 'es2015' or later."),
10386
10386
  Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set: diag(5096, 1 /* Error */, "Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set_5096", "Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set."),
10387
10387
  An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled: diag(5097, 1 /* Error */, "An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled_5097", "An import path can only end with a '{0}' extension when 'allowImportingTsExtensions' is enabled."),
10388
10388
  Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler: diag(5098, 1 /* Error */, "Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098", "Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'."),
@@ -18581,6 +18581,22 @@ function isVariableDeclarationInitializedToBareOrAccessedRequire(node) {
18581
18581
  function isBindingElementOfBareOrAccessedRequire(node) {
18582
18582
  return isBindingElement(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(node.parent.parent);
18583
18583
  }
18584
+ function getModuleSpecifierOfBareOrAccessedRequire(node) {
18585
+ if (isVariableDeclarationInitializedToRequire(node)) {
18586
+ return node.initializer.arguments[0];
18587
+ }
18588
+ if (isVariableDeclarationInitializedToBareOrAccessedRequire(node)) {
18589
+ const leftmost = getLeftmostAccessExpression(node.initializer);
18590
+ if (isRequireCall(
18591
+ leftmost,
18592
+ /*requireStringLiteralLikeArgument*/
18593
+ true
18594
+ )) {
18595
+ return leftmost.arguments[0];
18596
+ }
18597
+ }
18598
+ return void 0;
18599
+ }
18584
18600
  function isVariableDeclarationInitializedWithRequireHelper(node, allowAccessedRequire) {
18585
18601
  return isVariableDeclaration(node) && !!node.initializer && isRequireCall(
18586
18602
  allowAccessedRequire ? getLeftmostAccessExpression(node.initializer) : node.initializer,
@@ -21922,9 +21938,6 @@ var _computedOptions = createComputedCompilerOptions({
21922
21938
  let moduleResolution = compilerOptions.moduleResolution;
21923
21939
  if (moduleResolution === void 0) {
21924
21940
  switch (_computedOptions.module.computeValue(compilerOptions)) {
21925
- case 1 /* CommonJS */:
21926
- moduleResolution = 2 /* Node10 */;
21927
- break;
21928
21941
  case 100 /* Node16 */:
21929
21942
  case 101 /* Node18 */:
21930
21943
  case 102 /* Node20 */:
@@ -21933,6 +21946,7 @@ var _computedOptions = createComputedCompilerOptions({
21933
21946
  case 199 /* NodeNext */:
21934
21947
  moduleResolution = 99 /* NodeNext */;
21935
21948
  break;
21949
+ case 1 /* CommonJS */:
21936
21950
  case 200 /* Preserve */:
21937
21951
  moduleResolution = 100 /* Bundler */;
21938
21952
  break;
@@ -54018,11 +54032,7 @@ function createTypeChecker(host) {
54018
54032
  return ambientModule;
54019
54033
  }
54020
54034
  const currentSourceFile = getSourceFileOfNode(location);
54021
- const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _a.name) || ((_b = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _b.argument.literal) || (isVariableDeclaration(location) && location.initializer && isRequireCall(
54022
- location.initializer,
54023
- /*requireStringLiteralLikeArgument*/
54024
- true
54025
- ) ? location.initializer.arguments[0] : void 0) || ((_c = findAncestor(location, isImportCall)) == null ? void 0 : _c.arguments[0]) || ((_d = findAncestor(location, or(isImportDeclaration, isJSDocImportTag, isExportDeclaration))) == null ? void 0 : _d.moduleSpecifier) || ((_e = findAncestor(location, isExternalModuleImportEqualsDeclaration)) == null ? void 0 : _e.moduleReference.expression);
54035
+ const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _a.name) || ((_b = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _b.argument.literal) || isVariableDeclarationInitializedToBareOrAccessedRequire(location) && getModuleSpecifierOfBareOrAccessedRequire(location) || ((_c = findAncestor(location, isImportCall)) == null ? void 0 : _c.arguments[0]) || ((_d = findAncestor(location, or(isImportDeclaration, isJSDocImportTag, isExportDeclaration))) == null ? void 0 : _d.moduleSpecifier) || ((_e = findAncestor(location, isExternalModuleImportEqualsDeclaration)) == null ? void 0 : _e.moduleReference.expression);
54026
54036
  const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? host.getModeForUsageLocation(currentSourceFile, contextSpecifier) : host.getDefaultResolutionModeForFile(currentSourceFile);
54027
54037
  const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
54028
54038
  const resolvedModule = (_f = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _f.resolvedModule;
@@ -60321,21 +60331,21 @@ function createTypeChecker(host) {
60321
60331
  function isErrorType(type) {
60322
60332
  return type === errorType || !!(type.flags & 1 /* Any */ && type.aliasSymbol);
60323
60333
  }
60324
- function getTypeForBindingElementParent(node, checkMode) {
60325
- if (checkMode !== 0 /* Normal */) {
60326
- return getTypeForVariableLikeDeclaration(
60327
- node,
60328
- /*includeOptionality*/
60329
- false,
60330
- checkMode
60331
- );
60334
+ function getTypeForBindingElementParent(node) {
60335
+ const grandparent = node.parent.parent;
60336
+ const rootParameter = tryGetRootParameterDeclaration(node);
60337
+ if (rootParameter) {
60338
+ const symbol = getSymbolOfDeclaration(grandparent);
60339
+ const contextualParameterType = symbol && getSymbolLinks(symbol).type;
60340
+ if (contextualParameterType) {
60341
+ return contextualParameterType;
60342
+ }
60332
60343
  }
60333
- const symbol = getSymbolOfDeclaration(node);
60334
- return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(
60335
- node,
60344
+ return getTypeForVariableLikeDeclaration(
60345
+ grandparent,
60336
60346
  /*includeOptionality*/
60337
60347
  false,
60338
- checkMode
60348
+ node.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */
60339
60349
  );
60340
60350
  }
60341
60351
  function getRestType(source, properties, symbol) {
@@ -60440,8 +60450,7 @@ function createTypeChecker(host) {
60440
60450
  return type.flags & (128 /* StringLiteral */ | 256 /* NumberLiteral */) ? "" + type.value : void 0;
60441
60451
  }
60442
60452
  function getTypeForBindingElement(declaration) {
60443
- const checkMode = declaration.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */;
60444
- const parentType = getTypeForBindingElementParent(declaration.parent.parent, checkMode);
60453
+ const parentType = getTypeForBindingElementParent(declaration);
60445
60454
  return parentType && getBindingElementTypeFromParentType(
60446
60455
  declaration,
60447
60456
  parentType,
@@ -67168,7 +67177,7 @@ function createTypeChecker(host) {
67168
67177
  context.nonFixingMapper = combineTypeMappers(context.nonFixingMapper, mapper);
67169
67178
  }
67170
67179
  if (!checkTypeDeferred) {
67171
- inferTypes(context.inferences, checkType, extendsType, 1024 /* NoConstraints */ | 2048 /* AlwaysStrict */);
67180
+ inferTypes(context.inferences, checkType, extendsType, 512 /* NoConstraints */ | 1024 /* AlwaysStrict */);
67172
67181
  }
67173
67182
  combinedMapper = mapper ? combineTypeMappers(context.mapper, mapper) : context.mapper;
67174
67183
  }
@@ -70855,7 +70864,7 @@ function createTypeChecker(host) {
70855
70864
  0 /* None */,
70856
70865
  isRelatedToWorker
70857
70866
  );
70858
- inferTypes(ctx.inferences, target2.extendsType, sourceExtends, 1024 /* NoConstraints */ | 2048 /* AlwaysStrict */);
70867
+ inferTypes(ctx.inferences, target2.extendsType, sourceExtends, 512 /* NoConstraints */ | 1024 /* AlwaysStrict */);
70859
70868
  sourceExtends = instantiateType(sourceExtends, ctx.mapper);
70860
70869
  mapper = ctx.mapper;
70861
70870
  }
@@ -73120,7 +73129,7 @@ function createTypeChecker(host) {
73120
73129
  function inferTypes(inferences, originalSource, originalTarget, priority = 0 /* None */, contravariant = false) {
73121
73130
  let bivariant = false;
73122
73131
  let propagationType;
73123
- let inferencePriority = 4096 /* MaxValue */;
73132
+ let inferencePriority = 2048 /* MaxValue */;
73124
73133
  let visited;
73125
73134
  let sourceStack;
73126
73135
  let targetStack;
@@ -73195,18 +73204,13 @@ function createTypeChecker(host) {
73195
73204
  if (candidate === blockedStringType) {
73196
73205
  return;
73197
73206
  }
73198
- const combinedPriority = priority | (inference.individualPriority || 0 /* None */);
73199
- if (inference.priority === void 0 || priority < (inference.priority & ~512 /* DistributiveConditional */)) {
73207
+ if (inference.priority === void 0 || priority < inference.priority) {
73200
73208
  inference.candidates = void 0;
73201
73209
  inference.contraCandidates = void 0;
73202
73210
  inference.topLevel = true;
73203
- inference.priority = combinedPriority;
73211
+ inference.priority = priority;
73204
73212
  }
73205
- if (priority === (inference.priority & ~512 /* DistributiveConditional */)) {
73206
- if (inference.priority > combinedPriority) {
73207
- inference.priority = combinedPriority;
73208
- clearCachedInferences(inferences);
73209
- }
73213
+ if (priority === inference.priority) {
73210
73214
  if (contravariant && !bivariant) {
73211
73215
  if (!contains(inference.contraCandidates, candidate)) {
73212
73216
  inference.contraCandidates = append(inference.contraCandidates, candidate);
@@ -73288,7 +73292,7 @@ function createTypeChecker(host) {
73288
73292
  if (isGenericMappedType(source) && isGenericMappedType(target)) {
73289
73293
  invokeOnce(source, target, inferFromGenericMappedTypes);
73290
73294
  }
73291
- if (!(priority & 1024 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */))) {
73295
+ if (!(priority & 512 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */))) {
73292
73296
  const apparentSource = getApparentType(source);
73293
73297
  if (apparentSource !== source && !(apparentSource.flags & (524288 /* Object */ | 2097152 /* Intersection */))) {
73294
73298
  return inferFromTypes(apparentSource, target);
@@ -73327,7 +73331,7 @@ function createTypeChecker(host) {
73327
73331
  }
73328
73332
  (visited || (visited = /* @__PURE__ */ new Map())).set(key, -1 /* Circularity */);
73329
73333
  const saveInferencePriority = inferencePriority;
73330
- inferencePriority = 4096 /* MaxValue */;
73334
+ inferencePriority = 2048 /* MaxValue */;
73331
73335
  const saveExpandingFlags = expandingFlags;
73332
73336
  (sourceStack ?? (sourceStack = [])).push(source);
73333
73337
  (targetStack ?? (targetStack = [])).push(target);
@@ -73377,7 +73381,7 @@ function createTypeChecker(host) {
73377
73381
  contravariant = !contravariant;
73378
73382
  }
73379
73383
  function inferFromContravariantTypesIfStrictFunctionTypes(source, target) {
73380
- if (strictFunctionTypes || priority & 2048 /* AlwaysStrict */) {
73384
+ if (strictFunctionTypes || priority & 1024 /* AlwaysStrict */) {
73381
73385
  inferFromContravariantTypes(source, target);
73382
73386
  } else {
73383
73387
  inferFromTypes(source, target);
@@ -73418,7 +73422,7 @@ function createTypeChecker(host) {
73418
73422
  } else {
73419
73423
  for (let i = 0; i < sources.length; i++) {
73420
73424
  const saveInferencePriority = inferencePriority;
73421
- inferencePriority = 4096 /* MaxValue */;
73425
+ inferencePriority = 2048 /* MaxValue */;
73422
73426
  inferFromTypes(sources[i], t);
73423
73427
  if (inferencePriority === priority) matched[i] = true;
73424
73428
  inferenceCircularity = inferenceCircularity || inferencePriority === -1 /* Circularity */;
@@ -73497,11 +73501,6 @@ function createTypeChecker(host) {
73497
73501
  return false;
73498
73502
  }
73499
73503
  function inferToConditionalType(source, target) {
73500
- const info = target.root.isDistributive ? getInferenceInfoForType(getActualTypeVariable(target.checkType)) : void 0;
73501
- const saveIndividualPriority = info == null ? void 0 : info.individualPriority;
73502
- if (info) {
73503
- info.individualPriority = (info.individualPriority || 0 /* None */) | 512 /* DistributiveConditional */;
73504
- }
73505
73504
  if (source.flags & 16777216 /* Conditional */) {
73506
73505
  inferFromTypes(source.checkType, target.checkType);
73507
73506
  inferFromTypes(source.extendsType, target.extendsType);
@@ -73511,9 +73510,6 @@ function createTypeChecker(host) {
73511
73510
  const targetTypes = [getTrueTypeFromConditionalType(target), getFalseTypeFromConditionalType(target)];
73512
73511
  inferToMultipleTypesWithPriority(source, targetTypes, target.flags, contravariant ? 64 /* ContravariantConditional */ : 0);
73513
73512
  }
73514
- if (info) {
73515
- info.individualPriority = saveIndividualPriority;
73516
- }
73517
73513
  }
73518
73514
  function inferToTemplateLiteralType(source, target) {
73519
73515
  const matches = inferTypesFromTemplateLiteralType(source, target);
@@ -73754,14 +73750,14 @@ function createTypeChecker(host) {
73754
73750
  return candidates;
73755
73751
  }
73756
73752
  function getContravariantInference(inference) {
73757
- return inference.priority & 928 /* PriorityImpliesCombination */ ? getIntersectionType(inference.contraCandidates) : getCommonSubtype(inference.contraCandidates);
73753
+ return inference.priority & 416 /* PriorityImpliesCombination */ ? getIntersectionType(inference.contraCandidates) : getCommonSubtype(inference.contraCandidates);
73758
73754
  }
73759
73755
  function getCovariantInference(inference, signature) {
73760
73756
  const candidates = unionObjectAndArrayLiteralCandidates(inference.candidates);
73761
73757
  const primitiveConstraint = hasPrimitiveConstraint(inference.typeParameter) || isConstTypeVariable(inference.typeParameter);
73762
73758
  const widenLiteralTypes = !primitiveConstraint && inference.topLevel && (inference.isFixed || !isTypeParameterAtTopLevelInReturnType(signature, inference.typeParameter));
73763
73759
  const baseCandidates = primitiveConstraint ? sameMap(candidates, getRegularTypeOfLiteralType) : widenLiteralTypes ? sameMap(candidates, getWidenedLiteralType) : candidates;
73764
- const unwidenedType = inference.priority & 928 /* PriorityImpliesCombination */ ? getUnionType(baseCandidates, 2 /* Subtype */) : getCommonSupertype(baseCandidates);
73760
+ const unwidenedType = inference.priority & 416 /* PriorityImpliesCombination */ ? getUnionType(baseCandidates, 2 /* Subtype */) : getCommonSupertype(baseCandidates);
73765
73761
  return getWidenedType(unwidenedType);
73766
73762
  }
73767
73763
  function getInferredType(context, index) {
@@ -76475,22 +76471,22 @@ function createTypeChecker(host) {
76475
76471
  const type = getTypeOfSymbol(symbol);
76476
76472
  const declaration = symbol.valueDeclaration;
76477
76473
  if (declaration) {
76478
- if (isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) {
76474
+ if (isBindingElement(declaration) && !declaration.initializer && declaration.parent.elements.length >= 2) {
76479
76475
  const parent2 = declaration.parent.parent;
76480
76476
  const rootDeclaration = getRootDeclaration(parent2);
76481
76477
  if (rootDeclaration.kind === 261 /* VariableDeclaration */ && getCombinedNodeFlagsCached(rootDeclaration) & 6 /* Constant */ || rootDeclaration.kind === 170 /* Parameter */) {
76482
76478
  const links = getNodeLinks(parent2);
76483
76479
  if (!(links.flags & 4194304 /* InCheckIdentifier */)) {
76484
76480
  links.flags |= 4194304 /* InCheckIdentifier */;
76485
- const parentType = getTypeForBindingElementParent(parent2, 0 /* Normal */);
76486
- const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType);
76481
+ const parentType = getTypeForBindingElementParent(declaration);
76482
+ const parentNarrowableType = parentType && getNarrowableTypeForReference(parentType, location);
76487
76483
  links.flags &= ~4194304 /* InCheckIdentifier */;
76488
- if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(rootDeclaration.kind === 170 /* Parameter */ && isSomeSymbolAssigned(rootDeclaration))) {
76484
+ if (parentNarrowableType && parentNarrowableType.flags & 1048576 /* Union */ && !(rootDeclaration.kind === 170 /* Parameter */ && isSomeSymbolAssigned(rootDeclaration))) {
76489
76485
  const pattern = declaration.parent;
76490
76486
  const narrowedType = getFlowTypeOfReference(
76491
76487
  pattern,
76492
- parentTypeConstraint,
76493
- parentTypeConstraint,
76488
+ parentNarrowableType,
76489
+ parentNarrowableType,
76494
76490
  /*flowContainer*/
76495
76491
  void 0,
76496
76492
  location.flowNode
@@ -87829,8 +87825,7 @@ function createTypeChecker(host) {
87829
87825
  checkComputedPropertyName(node.propertyName);
87830
87826
  }
87831
87827
  const parent2 = node.parent.parent;
87832
- const parentCheckMode = node.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */;
87833
- const parentType = getTypeForBindingElementParent(parent2, parentCheckMode);
87828
+ const parentType = getTypeForBindingElementParent(node);
87834
87829
  const name = node.propertyName || node.name;
87835
87830
  if (parentType && !isBindingPattern(name)) {
87836
87831
  const exprType = getLiteralTypeFromPropertyName(name);
@@ -129306,8 +129301,8 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
129306
129301
  if (options.customConditions && !moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
129307
129302
  createDiagnosticForOptionName(Diagnostics.Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler, "customConditions");
129308
129303
  }
129309
- if (moduleResolution === 100 /* Bundler */ && !emitModuleKindIsNonNodeESM(moduleKind) && moduleKind !== 200 /* Preserve */) {
129310
- createOptionValueDiagnostic("moduleResolution", Diagnostics.Option_0_can_only_be_used_when_module_is_set_to_preserve_or_to_es2015_or_later, "bundler");
129304
+ if (moduleResolution === 100 /* Bundler */ && !emitModuleKindIsNonNodeESM(moduleKind) && moduleKind !== 200 /* Preserve */ && moduleKind !== 1 /* CommonJS */) {
129305
+ createOptionValueDiagnostic("moduleResolution", Diagnostics.Option_0_can_only_be_used_when_module_is_set_to_preserve_commonjs_or_es2015_or_later, "bundler");
129311
129306
  }
129312
129307
  if (ModuleKind[moduleKind] && (100 /* Node16 */ <= moduleKind && moduleKind <= 199 /* NodeNext */) && !(3 /* Node16 */ <= moduleResolution && moduleResolution <= 99 /* NodeNext */)) {
129313
129308
  const moduleKindName = ModuleKind[moduleKind];
@@ -129354,7 +129349,7 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
129354
129349
  function getIgnoreDeprecationsVersion() {
129355
129350
  const ignoreDeprecations = options.ignoreDeprecations;
129356
129351
  if (ignoreDeprecations) {
129357
- if (ignoreDeprecations === "5.0") {
129352
+ if (ignoreDeprecations === "5.0" || ignoreDeprecations === "6.0") {
129358
129353
  return new Version(ignoreDeprecations);
129359
129354
  }
129360
129355
  reportInvalidIgnoreDeprecations();
@@ -129463,6 +129458,11 @@ function createProgram(_rootNamesOrOptions, _options, _host, _oldProgram, _confi
129463
129458
  );
129464
129459
  }
129465
129460
  });
129461
+ checkDeprecations("6.0", "7.0", createDiagnostic, (createDeprecatedDiagnostic) => {
129462
+ if (options.moduleResolution === 2 /* Node10 */) {
129463
+ createDeprecatedDiagnostic("moduleResolution", "node10");
129464
+ }
129465
+ });
129466
129466
  }
129467
129467
  function verifyDeprecatedProjectReference(ref, parentFile, index) {
129468
129468
  function createDiagnostic(_name, _value, _useInstead, message, ...args) {
@@ -169459,9 +169459,6 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
169459
169459
  return charactersFuzzyMatchInString(symbolName2, lowerCaseTokenText);
169460
169460
  },
169461
169461
  (info, symbolName2, isFromAmbientModule, exportMapKey) => {
169462
- if (detailsEntryId && !some(info, (i) => detailsEntryId.source === stripQuotes(i.moduleSymbol.name))) {
169463
- return;
169464
- }
169465
169462
  info = filter(info, isImportableExportInfo);
169466
169463
  if (!info.length) {
169467
169464
  return;
@@ -169472,6 +169469,9 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
169472
169469
  if (result !== "skipped") {
169473
169470
  ({ exportInfo: exportInfo2 = info[0], moduleSpecifier } = result);
169474
169471
  }
169472
+ if (detailsEntryId && (detailsEntryId.source !== moduleSpecifier && !some(info, (i) => detailsEntryId.source === stripQuotes(i.moduleSymbol.name)))) {
169473
+ return;
169474
+ }
169475
169475
  const isDefaultExport = exportInfo2.exportKind === 1 /* Default */;
169476
169476
  const symbol = isDefaultExport && getLocalSymbolForExportDefault(Debug.checkDefined(exportInfo2.symbol)) || Debug.checkDefined(exportInfo2.symbol);
169477
169477
  pushAutoImportSymbol(symbol, {
@@ -171562,7 +171562,7 @@ function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, mode, p
171562
171562
  if (tryFileExists(host, packageFile)) {
171563
171563
  const packageJson = readJson(packageFile, host);
171564
171564
  const fragmentSubpath = components.join("/") + (components.length && hasTrailingDirectorySeparator(fragment) ? "/" : "");
171565
- exportsOrImportsLookup(
171565
+ if (exportsOrImportsLookup(
171566
171566
  packageJson.exports,
171567
171567
  fragmentSubpath,
171568
171568
  packageDirectory,
@@ -171570,8 +171570,9 @@ function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, mode, p
171570
171570
  true,
171571
171571
  /*isImports*/
171572
171572
  false
171573
- );
171574
- return;
171573
+ )) {
171574
+ return;
171575
+ }
171575
171576
  }
171576
171577
  return nodeModulesDirectoryOrImportsLookup(ancestor);
171577
171578
  };
@@ -171582,7 +171583,7 @@ function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, mode, p
171582
171583
  return arrayFrom(result.values());
171583
171584
  function exportsOrImportsLookup(lookupTable, fragment2, baseDirectory, isExports, isImports) {
171584
171585
  if (typeof lookupTable !== "object" || lookupTable === null) {
171585
- return;
171586
+ return lookupTable !== void 0;
171586
171587
  }
171587
171588
  const keys = getOwnKeys(lookupTable);
171588
171589
  const conditions = getConditions(compilerOptions, mode);
@@ -171606,6 +171607,7 @@ function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, mode, p
171606
171607
  },
171607
171608
  comparePatternKeys
171608
171609
  );
171610
+ return true;
171609
171611
  }
171610
171612
  }
171611
171613
  function getPatternFromFirstMatchingCondition(target, conditions) {
@@ -184105,6 +184107,7 @@ __export(ts_exports2, {
184105
184107
  getModuleInstanceState: () => getModuleInstanceState,
184106
184108
  getModuleNameStringLiteralAt: () => getModuleNameStringLiteralAt,
184107
184109
  getModuleSpecifierEndingPreference: () => getModuleSpecifierEndingPreference,
184110
+ getModuleSpecifierOfBareOrAccessedRequire: () => getModuleSpecifierOfBareOrAccessedRequire,
184108
184111
  getModuleSpecifierResolverHost: () => getModuleSpecifierResolverHost,
184109
184112
  getNameForExportedSymbol: () => getNameForExportedSymbol,
184110
184113
  getNameFromImportAttribute: () => getNameFromImportAttribute,
@@ -198866,6 +198869,7 @@ if (typeof console !== "undefined") {
198866
198869
  getModuleInstanceState,
198867
198870
  getModuleNameStringLiteralAt,
198868
198871
  getModuleSpecifierEndingPreference,
198872
+ getModuleSpecifierOfBareOrAccessedRequire,
198869
198873
  getModuleSpecifierResolverHost,
198870
198874
  getNameForExportedSymbol,
198871
198875
  getNameFromImportAttribute,
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": "6.0.0-pr-62093-21",
5
+ "version": "6.0.0-pr-62350-6",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [