@typescript-deploys/pr-build 6.0.0-pr-62825-9 → 6.0.0-pr-62876-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
@@ -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.20251205`;
21
+ var version = `${versionMajorMinor}.0-insiders.20251211`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -13019,13 +13019,6 @@ function getTokenPosOfNode(node, sourceFile, includeJsDoc) {
13019
13019
  isInJSDoc(node)
13020
13020
  );
13021
13021
  }
13022
- function getNonModifierTokenPosOfNode(node, sourceFile) {
13023
- const lastModifier = !nodeIsMissing(node) && canHaveModifiers(node) && node.modifiers ? last(node.modifiers) : void 0;
13024
- if (!lastModifier) {
13025
- return getTokenPosOfNode(node, sourceFile);
13026
- }
13027
- return skipTrivia((sourceFile || getSourceFileOfNode(node)).text, lastModifier.end);
13028
- }
13029
13022
  function getSourceTextOfNodeFromSourceFile(sourceFile, node, includeTrivia = false) {
13030
13023
  return getTextOfNodeFromSourceText(sourceFile.text, node, includeTrivia);
13031
13024
  }
@@ -14267,12 +14260,15 @@ function forEachYieldExpression(body, visitor) {
14267
14260
  function traverse(node) {
14268
14261
  switch (node.kind) {
14269
14262
  case 230 /* YieldExpression */:
14270
- visitor(node);
14263
+ const value = visitor(node);
14264
+ if (value) {
14265
+ return value;
14266
+ }
14271
14267
  const operand = node.expression;
14272
- if (operand) {
14273
- traverse(operand);
14268
+ if (!operand) {
14269
+ return;
14274
14270
  }
14275
- return;
14271
+ return traverse(operand);
14276
14272
  case 267 /* EnumDeclaration */:
14277
14273
  case 265 /* InterfaceDeclaration */:
14278
14274
  case 268 /* ModuleDeclaration */:
@@ -14281,11 +14277,10 @@ function forEachYieldExpression(body, visitor) {
14281
14277
  default:
14282
14278
  if (isFunctionLike(node)) {
14283
14279
  if (node.name && node.name.kind === 168 /* ComputedPropertyName */) {
14284
- traverse(node.name.expression);
14285
- return;
14280
+ return traverse(node.name.expression);
14286
14281
  }
14287
14282
  } else if (!isPartOfTypeNode(node)) {
14288
- forEachChild(node, traverse);
14283
+ return forEachChild(node, traverse);
14289
14284
  }
14290
14285
  }
14291
14286
  }
@@ -19129,7 +19124,7 @@ function hasContextSensitiveParameters(node) {
19129
19124
  if (node.kind !== 220 /* ArrowFunction */) {
19130
19125
  const parameter = firstOrUndefined(node.parameters);
19131
19126
  if (!(parameter && parameterIsThisKeyword(parameter))) {
19132
- return true;
19127
+ return !!(node.flags & 256 /* ContainsThis */);
19133
19128
  }
19134
19129
  }
19135
19130
  }
@@ -40023,7 +40018,7 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
40023
40018
  const affectingLocations = [];
40024
40019
  let features = getNodeResolutionFeatures(options);
40025
40020
  if (resolutionMode !== void 0) {
40026
- features |= 30 /* AllFeatures */;
40021
+ features |= 94 /* AllFeatures */;
40027
40022
  }
40028
40023
  const moduleResolution = getEmitModuleResolutionKind(options);
40029
40024
  if (resolutionMode === 99 /* ESNext */ && (3 /* Node16 */ <= moduleResolution && moduleResolution <= 99 /* NodeNext */)) {
@@ -40178,10 +40173,10 @@ function getNodeResolutionFeatures(options) {
40178
40173
  features = 30 /* Node16Default */;
40179
40174
  break;
40180
40175
  case 99 /* NodeNext */:
40181
- features = 30 /* NodeNextDefault */;
40176
+ features = 94 /* NodeNextDefault */;
40182
40177
  break;
40183
40178
  case 100 /* Bundler */:
40184
- features = 30 /* BundlerDefault */;
40179
+ features = 94 /* BundlerDefault */;
40185
40180
  break;
40186
40181
  }
40187
40182
  if (options.resolvePackageJsonExports) {
@@ -40764,7 +40759,7 @@ function node16ModuleNameResolver(moduleName, containingFile, compilerOptions, h
40764
40759
  }
40765
40760
  function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
40766
40761
  return nodeNextModuleNameResolverWorker(
40767
- 30 /* NodeNextDefault */,
40762
+ 94 /* NodeNextDefault */,
40768
40763
  moduleName,
40769
40764
  containingFile,
40770
40765
  compilerOptions,
@@ -40843,11 +40838,11 @@ function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, hos
40843
40838
  } else {
40844
40839
  extensions = getResolveJsonModule(compilerOptions) ? 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */ | 8 /* Json */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */;
40845
40840
  }
40846
- return nodeModuleNameResolverWorker(conditions ? 30 /* AllFeatures */ : 0 /* None */, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, !!isConfigLookup, redirectedReference, conditions);
40841
+ return nodeModuleNameResolverWorker(conditions ? 94 /* AllFeatures */ : 0 /* None */, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, !!isConfigLookup, redirectedReference, conditions);
40847
40842
  }
40848
40843
  function nodeNextJsonConfigResolver(moduleName, containingFile, host) {
40849
40844
  return nodeModuleNameResolverWorker(
40850
- 30 /* NodeNextDefault */,
40845
+ 94 /* NodeNextDefault */,
40851
40846
  moduleName,
40852
40847
  getDirectoryPath(containingFile),
40853
40848
  { moduleResolution: 99 /* NodeNext */ },
@@ -40920,7 +40915,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
40920
40915
  const diagnosticState = {
40921
40916
  ...state,
40922
40917
  compilerOptions: diagnosticsCompilerOptions,
40923
- features: 30 /* BundlerDefault */,
40918
+ features: 94 /* BundlerDefault */,
40924
40919
  conditions: getConditions(diagnosticsCompilerOptions),
40925
40920
  reportDiagnostic: noop
40926
40921
  };
@@ -41456,7 +41451,7 @@ function loadModuleFromExports(scope, extensions, subpath, state, cache, redirec
41456
41451
  }
41457
41452
  function loadModuleFromImports(extensions, moduleName, directory, state, cache, redirectedReference) {
41458
41453
  var _a, _b;
41459
- if (moduleName === "#" || startsWith(moduleName, "#/")) {
41454
+ if (moduleName === "#" || startsWith(moduleName, "#/") && !(state.features & 64 /* ImportsPatternRoot */)) {
41460
41455
  if (state.traceEnabled) {
41461
41456
  trace(state.host, Diagnostics.Invalid_import_specifier_0_has_no_possible_resolutions, moduleName);
41462
41457
  }
@@ -42683,6 +42678,7 @@ function createBinder() {
42683
42678
  const saveExceptionTarget = currentExceptionTarget;
42684
42679
  const saveActiveLabelList = activeLabelList;
42685
42680
  const saveHasExplicitReturn = hasExplicitReturn;
42681
+ const saveSeenThisKeyword = seenThisKeyword;
42686
42682
  const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 1024 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 176 /* ClassStaticBlockDeclaration */;
42687
42683
  if (!isImmediatelyInvoked) {
42688
42684
  currentFlow = createFlowNode(
@@ -42702,13 +42698,17 @@ function createBinder() {
42702
42698
  currentContinueTarget = void 0;
42703
42699
  activeLabelList = void 0;
42704
42700
  hasExplicitReturn = false;
42701
+ seenThisKeyword = false;
42705
42702
  bindChildren(node);
42706
- node.flags &= ~5632 /* ReachabilityAndEmitFlags */;
42703
+ node.flags &= ~(5632 /* ReachabilityAndEmitFlags */ | 256 /* ContainsThis */);
42707
42704
  if (!(currentFlow.flags & 1 /* Unreachable */) && containerFlags & 8 /* IsFunctionLike */ && nodeIsPresent(node.body)) {
42708
42705
  node.flags |= 512 /* HasImplicitReturn */;
42709
42706
  if (hasExplicitReturn) node.flags |= 1024 /* HasExplicitReturn */;
42710
42707
  node.endFlowNode = currentFlow;
42711
42708
  }
42709
+ if (seenThisKeyword) {
42710
+ node.flags |= 256 /* ContainsThis */;
42711
+ }
42712
42712
  if (node.kind === 308 /* SourceFile */) {
42713
42713
  node.flags |= emitFlags;
42714
42714
  node.endFlowNode = currentFlow;
@@ -42729,11 +42729,14 @@ function createBinder() {
42729
42729
  currentExceptionTarget = saveExceptionTarget;
42730
42730
  activeLabelList = saveActiveLabelList;
42731
42731
  hasExplicitReturn = saveHasExplicitReturn;
42732
+ seenThisKeyword = node.kind === 220 /* ArrowFunction */ ? saveSeenThisKeyword || seenThisKeyword : saveSeenThisKeyword;
42732
42733
  } else if (containerFlags & 64 /* IsInterface */) {
42734
+ const saveSeenThisKeyword = seenThisKeyword;
42733
42735
  seenThisKeyword = false;
42734
42736
  bindChildren(node);
42735
42737
  Debug.assertNotNode(node, isIdentifier);
42736
42738
  node.flags = seenThisKeyword ? node.flags | 256 /* ContainsThis */ : node.flags & ~256 /* ContainsThis */;
42739
+ seenThisKeyword = saveSeenThisKeyword;
42737
42740
  } else {
42738
42741
  bindChildren(node);
42739
42742
  }
@@ -44213,6 +44216,9 @@ function createBinder() {
44213
44216
  }
44214
44217
  // falls through
44215
44218
  case 110 /* ThisKeyword */:
44219
+ if (node.kind === 110 /* ThisKeyword */) {
44220
+ seenThisKeyword = true;
44221
+ }
44216
44222
  if (currentFlow && (isExpression(node) || parent.kind === 305 /* ShorthandPropertyAssignment */)) {
44217
44223
  node.flowNode = currentFlow;
44218
44224
  }
@@ -45080,6 +45086,8 @@ function getContainerFlags(node) {
45080
45086
  // falls through
45081
45087
  case 177 /* Constructor */:
45082
45088
  case 263 /* FunctionDeclaration */:
45089
+ case 176 /* ClassStaticBlockDeclaration */:
45090
+ return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
45083
45091
  case 174 /* MethodSignature */:
45084
45092
  case 180 /* CallSignature */:
45085
45093
  case 324 /* JSDocSignature */:
@@ -45087,17 +45095,14 @@ function getContainerFlags(node) {
45087
45095
  case 185 /* FunctionType */:
45088
45096
  case 181 /* ConstructSignature */:
45089
45097
  case 186 /* ConstructorType */:
45090
- case 176 /* ClassStaticBlockDeclaration */:
45091
- return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
45098
+ return 1 /* IsContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
45092
45099
  case 352 /* JSDocImportTag */:
45093
- return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */;
45100
+ return 1 /* IsContainer */ | 32 /* HasLocals */;
45094
45101
  case 219 /* FunctionExpression */:
45095
45102
  case 220 /* ArrowFunction */:
45096
45103
  return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */;
45097
45104
  case 269 /* ModuleBlock */:
45098
45105
  return 4 /* IsControlFlowContainer */;
45099
- case 173 /* PropertyDeclaration */:
45100
- return node.initializer ? 4 /* IsControlFlowContainer */ : 0;
45101
45106
  case 300 /* CatchClause */:
45102
45107
  case 249 /* ForStatement */:
45103
45108
  case 250 /* ForInStatement */:
@@ -46585,7 +46590,7 @@ function createTypeChecker(host) {
46585
46590
  if (!node) {
46586
46591
  return void 0;
46587
46592
  }
46588
- if (contextFlags & 4 /* Completions */) {
46593
+ if (contextFlags & 4 /* IgnoreNodeInferences */) {
46589
46594
  return runWithInferenceBlockedFromSourceNode(node, () => getContextualType(node, contextFlags));
46590
46595
  }
46591
46596
  return getContextualType(node, contextFlags);
@@ -61876,7 +61881,7 @@ function createTypeChecker(host) {
61876
61881
  }
61877
61882
  function getIndexType(type, indexFlags = 0 /* None */) {
61878
61883
  type = getReducedType(type);
61879
- return isNoInferType(type) ? getNoInferType(getIndexType(type.baseType, indexFlags)) : shouldDeferIndexType(type, indexFlags) ? getIndexTypeForGenericType(type, indexFlags) : type.flags & 1048576 /* Union */ ? getIntersectionType(map(type.types, (t) => getIndexType(t, indexFlags))) : type.flags & 2097152 /* Intersection */ ? getUnionType(map(type.types, (t) => getIndexType(t, indexFlags))) : getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, indexFlags) : type === wildcardType || type === silentNeverType ? type : type.flags & 2 /* Unknown */ ? neverType : type.flags & (1 /* Any */ | 131072 /* Never */) ? stringNumberSymbolType : getLiteralTypeFromProperties(type, (indexFlags & 2 /* NoIndexSignatures */ ? 128 /* StringLiteral */ : 402653316 /* StringLike */) | (indexFlags & 1 /* StringsOnly */ ? 0 : 296 /* NumberLike */ | 12288 /* ESSymbolLike */), indexFlags === 0 /* None */);
61884
+ return isNoInferType(type) ? getNoInferType(getIndexType(type.baseType, indexFlags)) : shouldDeferIndexType(type, indexFlags) ? getIndexTypeForGenericType(type, indexFlags) : type.flags & 1048576 /* Union */ ? getIntersectionType(map(type.types, (t) => getIndexType(t, indexFlags))) : type.flags & 2097152 /* Intersection */ ? getUnionType(map(type.types, (t) => getIndexType(t, indexFlags))) : getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, indexFlags) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : type.flags & (1 /* Any */ | 131072 /* Never */) ? stringNumberSymbolType : getLiteralTypeFromProperties(type, (indexFlags & 2 /* NoIndexSignatures */ ? 128 /* StringLiteral */ : 402653316 /* StringLike */) | (indexFlags & 1 /* StringsOnly */ ? 0 : 296 /* NumberLike */ | 12288 /* ESSymbolLike */), indexFlags === 0 /* None */);
61880
61885
  }
61881
61886
  function getExtractStringType(type) {
61882
61887
  const extractTypeAlias = getGlobalExtractSymbol();
@@ -63710,7 +63715,8 @@ function createTypeChecker(host) {
63710
63715
  const { initializer } = node;
63711
63716
  return !!initializer && isContextSensitive(initializer);
63712
63717
  }
63713
- case 295 /* JsxExpression */: {
63718
+ case 295 /* JsxExpression */:
63719
+ case 230 /* YieldExpression */: {
63714
63720
  const { expression } = node;
63715
63721
  return !!expression && isContextSensitive(expression);
63716
63722
  }
@@ -63718,7 +63724,7 @@ function createTypeChecker(host) {
63718
63724
  return false;
63719
63725
  }
63720
63726
  function isContextSensitiveFunctionLikeDeclaration(node) {
63721
- return hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node);
63727
+ return hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node) || hasContextSensitiveYieldExpression(node);
63722
63728
  }
63723
63729
  function hasContextSensitiveReturnExpression(node) {
63724
63730
  if (node.typeParameters || getEffectiveReturnTypeNode(node) || !node.body) {
@@ -63729,6 +63735,9 @@ function createTypeChecker(host) {
63729
63735
  }
63730
63736
  return !!forEachReturnStatement(node.body, (statement) => !!statement.expression && isContextSensitive(statement.expression));
63731
63737
  }
63738
+ function hasContextSensitiveYieldExpression(node) {
63739
+ return !!(getFunctionFlags(node) & 1 /* Generator */ && node.body && forEachYieldExpression(node.body, isContextSensitive));
63740
+ }
63732
63741
  function isContextSensitiveFunctionOrObjectLiteralMethod(func) {
63733
63742
  return (isFunctionExpressionOrArrowFunction(func) || isObjectLiteralMethod(func)) && isContextSensitiveFunctionLikeDeclaration(func);
63734
63743
  }
@@ -73276,11 +73285,16 @@ function createTypeChecker(host) {
73276
73285
  if (contextualType && maybeTypeOfKind(contextualType, 465829888 /* Instantiable */)) {
73277
73286
  const inferenceContext = getInferenceContext(node);
73278
73287
  if (inferenceContext && contextFlags & 1 /* Signature */ && some(inferenceContext.inferences, hasInferenceCandidatesOrDefault)) {
73279
- return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
73288
+ const type = instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
73289
+ if (!(type.flags & 3 /* AnyOrUnknown */)) {
73290
+ return type;
73291
+ }
73280
73292
  }
73281
73293
  if (inferenceContext == null ? void 0 : inferenceContext.returnMapper) {
73282
73294
  const type = instantiateInstantiableTypes(contextualType, inferenceContext.returnMapper);
73283
- return type.flags & 1048576 /* Union */ && containsType(type.types, regularFalseType) && containsType(type.types, regularTrueType) ? filterType(type, (t) => t !== regularFalseType && t !== regularTrueType) : type;
73295
+ if (!(type.flags & 3 /* AnyOrUnknown */)) {
73296
+ return type.flags & 1048576 /* Union */ && containsType(type.types, regularFalseType) && containsType(type.types, regularTrueType) ? filterType(type, (t) => t !== regularFalseType && t !== regularTrueType) : type;
73297
+ }
73284
73298
  }
73285
73299
  }
73286
73300
  return contextualType;
@@ -73462,7 +73476,7 @@ function createTypeChecker(host) {
73462
73476
  ), getNameFromImportAttribute(node));
73463
73477
  }
73464
73478
  function getContextualJsxElementAttributesType(node, contextFlags) {
73465
- if (isJsxOpeningElement(node) && contextFlags !== 4 /* Completions */) {
73479
+ if (isJsxOpeningElement(node) && contextFlags !== 4 /* IgnoreNodeInferences */) {
73466
73480
  const index = findContextualNode(
73467
73481
  node.parent,
73468
73482
  /*includeCaches*/
@@ -85708,13 +85722,8 @@ function createTypeChecker(host) {
85708
85722
  }
85709
85723
  if (isIdentifier(node.name)) {
85710
85724
  checkCollisionsForDeclarationName(node, node.name);
85711
- if (!(node.flags & (32 /* Namespace */ | 2048 /* GlobalAugmentation */))) {
85712
- const sourceFile = getSourceFileOfNode(node);
85713
- const pos = getNonModifierTokenPosOfNode(node);
85714
- const span = getSpanOfTokenAtPosition(sourceFile, pos);
85715
- suggestionDiagnostics.add(
85716
- createFileDiagnostic(sourceFile, span.start, span.length, Diagnostics.A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead)
85717
- );
85725
+ if (!(node.flags & (32 /* Namespace */ | 2048 /* GlobalAugmentation */ | 33554432 /* Ambient */))) {
85726
+ error(node.name, Diagnostics.A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead);
85718
85727
  }
85719
85728
  }
85720
85729
  checkExportsOnMergedDeclarations(node);
package/lib/typescript.js CHANGED
@@ -913,7 +913,6 @@ __export(typescript_exports, {
913
913
  getNonAugmentationDeclaration: () => getNonAugmentationDeclaration,
914
914
  getNonDecoratorTokenPosOfNode: () => getNonDecoratorTokenPosOfNode,
915
915
  getNonIncrementalBuildInfoRoots: () => getNonIncrementalBuildInfoRoots,
916
- getNonModifierTokenPosOfNode: () => getNonModifierTokenPosOfNode,
917
916
  getNormalizedAbsolutePath: () => getNormalizedAbsolutePath,
918
917
  getNormalizedAbsolutePathWithoutRoot: () => getNormalizedAbsolutePathWithoutRoot,
919
918
  getNormalizedPathComponents: () => getNormalizedPathComponents,
@@ -2286,7 +2285,7 @@ module.exports = __toCommonJS(typescript_exports);
2286
2285
 
2287
2286
  // src/compiler/corePublic.ts
2288
2287
  var versionMajorMinor = "6.0";
2289
- var version = `${versionMajorMinor}.0-insiders.20251205`;
2288
+ var version = `${versionMajorMinor}.0-insiders.20251211`;
2290
2289
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2291
2290
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2292
2291
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -6169,7 +6168,7 @@ var ContextFlags = /* @__PURE__ */ ((ContextFlags3) => {
6169
6168
  ContextFlags3[ContextFlags3["None"] = 0] = "None";
6170
6169
  ContextFlags3[ContextFlags3["Signature"] = 1] = "Signature";
6171
6170
  ContextFlags3[ContextFlags3["NoConstraints"] = 2] = "NoConstraints";
6172
- ContextFlags3[ContextFlags3["Completions"] = 4] = "Completions";
6171
+ ContextFlags3[ContextFlags3["IgnoreNodeInferences"] = 4] = "IgnoreNodeInferences";
6173
6172
  ContextFlags3[ContextFlags3["SkipBindingPatterns"] = 8] = "SkipBindingPatterns";
6174
6173
  return ContextFlags3;
6175
6174
  })(ContextFlags || {});
@@ -16667,13 +16666,6 @@ function getNonDecoratorTokenPosOfNode(node, sourceFile) {
16667
16666
  }
16668
16667
  return skipTrivia((sourceFile || getSourceFileOfNode(node)).text, lastDecorator.end);
16669
16668
  }
16670
- function getNonModifierTokenPosOfNode(node, sourceFile) {
16671
- const lastModifier = !nodeIsMissing(node) && canHaveModifiers(node) && node.modifiers ? last(node.modifiers) : void 0;
16672
- if (!lastModifier) {
16673
- return getTokenPosOfNode(node, sourceFile);
16674
- }
16675
- return skipTrivia((sourceFile || getSourceFileOfNode(node)).text, lastModifier.end);
16676
- }
16677
16669
  function getSourceTextOfNodeFromSourceFile(sourceFile, node, includeTrivia = false) {
16678
16670
  return getTextOfNodeFromSourceText(sourceFile.text, node, includeTrivia);
16679
16671
  }
@@ -17972,12 +17964,15 @@ function forEachYieldExpression(body, visitor) {
17972
17964
  function traverse(node) {
17973
17965
  switch (node.kind) {
17974
17966
  case 230 /* YieldExpression */:
17975
- visitor(node);
17967
+ const value = visitor(node);
17968
+ if (value) {
17969
+ return value;
17970
+ }
17976
17971
  const operand = node.expression;
17977
- if (operand) {
17978
- traverse(operand);
17972
+ if (!operand) {
17973
+ return;
17979
17974
  }
17980
- return;
17975
+ return traverse(operand);
17981
17976
  case 267 /* EnumDeclaration */:
17982
17977
  case 265 /* InterfaceDeclaration */:
17983
17978
  case 268 /* ModuleDeclaration */:
@@ -17986,11 +17981,10 @@ function forEachYieldExpression(body, visitor) {
17986
17981
  default:
17987
17982
  if (isFunctionLike(node)) {
17988
17983
  if (node.name && node.name.kind === 168 /* ComputedPropertyName */) {
17989
- traverse(node.name.expression);
17990
- return;
17984
+ return traverse(node.name.expression);
17991
17985
  }
17992
17986
  } else if (!isPartOfTypeNode(node)) {
17993
- forEachChild(node, traverse);
17987
+ return forEachChild(node, traverse);
17994
17988
  }
17995
17989
  }
17996
17990
  }
@@ -23137,7 +23131,7 @@ function hasContextSensitiveParameters(node) {
23137
23131
  if (node.kind !== 220 /* ArrowFunction */) {
23138
23132
  const parameter = firstOrUndefined(node.parameters);
23139
23133
  if (!(parameter && parameterIsThisKeyword(parameter))) {
23140
- return true;
23134
+ return !!(node.flags & 256 /* ContainsThis */);
23141
23135
  }
23142
23136
  }
23143
23137
  }
@@ -44381,7 +44375,7 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
44381
44375
  const affectingLocations = [];
44382
44376
  let features = getNodeResolutionFeatures(options);
44383
44377
  if (resolutionMode !== void 0) {
44384
- features |= 30 /* AllFeatures */;
44378
+ features |= 94 /* AllFeatures */;
44385
44379
  }
44386
44380
  const moduleResolution = getEmitModuleResolutionKind(options);
44387
44381
  if (resolutionMode === 99 /* ESNext */ && (3 /* Node16 */ <= moduleResolution && moduleResolution <= 99 /* NodeNext */)) {
@@ -44536,10 +44530,10 @@ function getNodeResolutionFeatures(options) {
44536
44530
  features = 30 /* Node16Default */;
44537
44531
  break;
44538
44532
  case 99 /* NodeNext */:
44539
- features = 30 /* NodeNextDefault */;
44533
+ features = 94 /* NodeNextDefault */;
44540
44534
  break;
44541
44535
  case 100 /* Bundler */:
44542
- features = 30 /* BundlerDefault */;
44536
+ features = 94 /* BundlerDefault */;
44543
44537
  break;
44544
44538
  }
44545
44539
  if (options.resolvePackageJsonExports) {
@@ -45139,10 +45133,11 @@ var NodeResolutionFeatures = /* @__PURE__ */ ((NodeResolutionFeatures2) => {
45139
45133
  NodeResolutionFeatures2[NodeResolutionFeatures2["SelfName"] = 4] = "SelfName";
45140
45134
  NodeResolutionFeatures2[NodeResolutionFeatures2["Exports"] = 8] = "Exports";
45141
45135
  NodeResolutionFeatures2[NodeResolutionFeatures2["ExportsPatternTrailers"] = 16] = "ExportsPatternTrailers";
45142
- NodeResolutionFeatures2[NodeResolutionFeatures2["AllFeatures"] = 30] = "AllFeatures";
45136
+ NodeResolutionFeatures2[NodeResolutionFeatures2["ImportsPatternRoot"] = 64] = "ImportsPatternRoot";
45137
+ NodeResolutionFeatures2[NodeResolutionFeatures2["AllFeatures"] = 94] = "AllFeatures";
45143
45138
  NodeResolutionFeatures2[NodeResolutionFeatures2["Node16Default"] = 30] = "Node16Default";
45144
- NodeResolutionFeatures2[NodeResolutionFeatures2["NodeNextDefault"] = 30 /* AllFeatures */] = "NodeNextDefault";
45145
- NodeResolutionFeatures2[NodeResolutionFeatures2["BundlerDefault"] = 30] = "BundlerDefault";
45139
+ NodeResolutionFeatures2[NodeResolutionFeatures2["NodeNextDefault"] = 94 /* AllFeatures */] = "NodeNextDefault";
45140
+ NodeResolutionFeatures2[NodeResolutionFeatures2["BundlerDefault"] = 94] = "BundlerDefault";
45146
45141
  NodeResolutionFeatures2[NodeResolutionFeatures2["EsmMode"] = 32] = "EsmMode";
45147
45142
  return NodeResolutionFeatures2;
45148
45143
  })(NodeResolutionFeatures || {});
@@ -45160,7 +45155,7 @@ function node16ModuleNameResolver(moduleName, containingFile, compilerOptions, h
45160
45155
  }
45161
45156
  function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
45162
45157
  return nodeNextModuleNameResolverWorker(
45163
- 30 /* NodeNextDefault */,
45158
+ 94 /* NodeNextDefault */,
45164
45159
  moduleName,
45165
45160
  containingFile,
45166
45161
  compilerOptions,
@@ -45239,11 +45234,11 @@ function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, hos
45239
45234
  } else {
45240
45235
  extensions = getResolveJsonModule(compilerOptions) ? 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */ | 8 /* Json */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */;
45241
45236
  }
45242
- return nodeModuleNameResolverWorker(conditions ? 30 /* AllFeatures */ : 0 /* None */, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, !!isConfigLookup, redirectedReference, conditions);
45237
+ return nodeModuleNameResolverWorker(conditions ? 94 /* AllFeatures */ : 0 /* None */, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, !!isConfigLookup, redirectedReference, conditions);
45243
45238
  }
45244
45239
  function nodeNextJsonConfigResolver(moduleName, containingFile, host) {
45245
45240
  return nodeModuleNameResolverWorker(
45246
- 30 /* NodeNextDefault */,
45241
+ 94 /* NodeNextDefault */,
45247
45242
  moduleName,
45248
45243
  getDirectoryPath(containingFile),
45249
45244
  { moduleResolution: 99 /* NodeNext */ },
@@ -45316,7 +45311,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
45316
45311
  const diagnosticState = {
45317
45312
  ...state,
45318
45313
  compilerOptions: diagnosticsCompilerOptions,
45319
- features: 30 /* BundlerDefault */,
45314
+ features: 94 /* BundlerDefault */,
45320
45315
  conditions: getConditions(diagnosticsCompilerOptions),
45321
45316
  reportDiagnostic: noop
45322
45317
  };
@@ -45966,7 +45961,7 @@ function loadModuleFromExports(scope, extensions, subpath, state, cache, redirec
45966
45961
  }
45967
45962
  function loadModuleFromImports(extensions, moduleName, directory, state, cache, redirectedReference) {
45968
45963
  var _a, _b;
45969
- if (moduleName === "#" || startsWith(moduleName, "#/")) {
45964
+ if (moduleName === "#" || startsWith(moduleName, "#/") && !(state.features & 64 /* ImportsPatternRoot */)) {
45970
45965
  if (state.traceEnabled) {
45971
45966
  trace(state.host, Diagnostics.Invalid_import_specifier_0_has_no_possible_resolutions, moduleName);
45972
45967
  }
@@ -47211,6 +47206,7 @@ function createBinder() {
47211
47206
  const saveExceptionTarget = currentExceptionTarget;
47212
47207
  const saveActiveLabelList = activeLabelList;
47213
47208
  const saveHasExplicitReturn = hasExplicitReturn;
47209
+ const saveSeenThisKeyword = seenThisKeyword;
47214
47210
  const isImmediatelyInvoked = containerFlags & 16 /* IsFunctionExpression */ && !hasSyntacticModifier(node, 1024 /* Async */) && !node.asteriskToken && !!getImmediatelyInvokedFunctionExpression(node) || node.kind === 176 /* ClassStaticBlockDeclaration */;
47215
47211
  if (!isImmediatelyInvoked) {
47216
47212
  currentFlow = createFlowNode(
@@ -47230,13 +47226,17 @@ function createBinder() {
47230
47226
  currentContinueTarget = void 0;
47231
47227
  activeLabelList = void 0;
47232
47228
  hasExplicitReturn = false;
47229
+ seenThisKeyword = false;
47233
47230
  bindChildren(node);
47234
- node.flags &= ~5632 /* ReachabilityAndEmitFlags */;
47231
+ node.flags &= ~(5632 /* ReachabilityAndEmitFlags */ | 256 /* ContainsThis */);
47235
47232
  if (!(currentFlow.flags & 1 /* Unreachable */) && containerFlags & 8 /* IsFunctionLike */ && nodeIsPresent(node.body)) {
47236
47233
  node.flags |= 512 /* HasImplicitReturn */;
47237
47234
  if (hasExplicitReturn) node.flags |= 1024 /* HasExplicitReturn */;
47238
47235
  node.endFlowNode = currentFlow;
47239
47236
  }
47237
+ if (seenThisKeyword) {
47238
+ node.flags |= 256 /* ContainsThis */;
47239
+ }
47240
47240
  if (node.kind === 308 /* SourceFile */) {
47241
47241
  node.flags |= emitFlags;
47242
47242
  node.endFlowNode = currentFlow;
@@ -47257,11 +47257,14 @@ function createBinder() {
47257
47257
  currentExceptionTarget = saveExceptionTarget;
47258
47258
  activeLabelList = saveActiveLabelList;
47259
47259
  hasExplicitReturn = saveHasExplicitReturn;
47260
+ seenThisKeyword = node.kind === 220 /* ArrowFunction */ ? saveSeenThisKeyword || seenThisKeyword : saveSeenThisKeyword;
47260
47261
  } else if (containerFlags & 64 /* IsInterface */) {
47262
+ const saveSeenThisKeyword = seenThisKeyword;
47261
47263
  seenThisKeyword = false;
47262
47264
  bindChildren(node);
47263
47265
  Debug.assertNotNode(node, isIdentifier);
47264
47266
  node.flags = seenThisKeyword ? node.flags | 256 /* ContainsThis */ : node.flags & ~256 /* ContainsThis */;
47267
+ seenThisKeyword = saveSeenThisKeyword;
47265
47268
  } else {
47266
47269
  bindChildren(node);
47267
47270
  }
@@ -48741,6 +48744,9 @@ function createBinder() {
48741
48744
  }
48742
48745
  // falls through
48743
48746
  case 110 /* ThisKeyword */:
48747
+ if (node.kind === 110 /* ThisKeyword */) {
48748
+ seenThisKeyword = true;
48749
+ }
48744
48750
  if (currentFlow && (isExpression(node) || parent2.kind === 305 /* ShorthandPropertyAssignment */)) {
48745
48751
  node.flowNode = currentFlow;
48746
48752
  }
@@ -49608,6 +49614,8 @@ function getContainerFlags(node) {
49608
49614
  // falls through
49609
49615
  case 177 /* Constructor */:
49610
49616
  case 263 /* FunctionDeclaration */:
49617
+ case 176 /* ClassStaticBlockDeclaration */:
49618
+ return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
49611
49619
  case 174 /* MethodSignature */:
49612
49620
  case 180 /* CallSignature */:
49613
49621
  case 324 /* JSDocSignature */:
@@ -49615,17 +49623,14 @@ function getContainerFlags(node) {
49615
49623
  case 185 /* FunctionType */:
49616
49624
  case 181 /* ConstructSignature */:
49617
49625
  case 186 /* ConstructorType */:
49618
- case 176 /* ClassStaticBlockDeclaration */:
49619
- return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
49626
+ return 1 /* IsContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */;
49620
49627
  case 352 /* JSDocImportTag */:
49621
- return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */;
49628
+ return 1 /* IsContainer */ | 32 /* HasLocals */;
49622
49629
  case 219 /* FunctionExpression */:
49623
49630
  case 220 /* ArrowFunction */:
49624
49631
  return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */;
49625
49632
  case 269 /* ModuleBlock */:
49626
49633
  return 4 /* IsControlFlowContainer */;
49627
- case 173 /* PropertyDeclaration */:
49628
- return node.initializer ? 4 /* IsControlFlowContainer */ : 0;
49629
49634
  case 300 /* CatchClause */:
49630
49635
  case 249 /* ForStatement */:
49631
49636
  case 250 /* ForInStatement */:
@@ -51213,7 +51218,7 @@ function createTypeChecker(host) {
51213
51218
  if (!node) {
51214
51219
  return void 0;
51215
51220
  }
51216
- if (contextFlags & 4 /* Completions */) {
51221
+ if (contextFlags & 4 /* IgnoreNodeInferences */) {
51217
51222
  return runWithInferenceBlockedFromSourceNode(node, () => getContextualType2(node, contextFlags));
51218
51223
  }
51219
51224
  return getContextualType2(node, contextFlags);
@@ -66504,7 +66509,7 @@ function createTypeChecker(host) {
66504
66509
  }
66505
66510
  function getIndexType(type, indexFlags = 0 /* None */) {
66506
66511
  type = getReducedType(type);
66507
- return isNoInferType(type) ? getNoInferType(getIndexType(type.baseType, indexFlags)) : shouldDeferIndexType(type, indexFlags) ? getIndexTypeForGenericType(type, indexFlags) : type.flags & 1048576 /* Union */ ? getIntersectionType(map(type.types, (t) => getIndexType(t, indexFlags))) : type.flags & 2097152 /* Intersection */ ? getUnionType(map(type.types, (t) => getIndexType(t, indexFlags))) : getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, indexFlags) : type === wildcardType || type === silentNeverType ? type : type.flags & 2 /* Unknown */ ? neverType : type.flags & (1 /* Any */ | 131072 /* Never */) ? stringNumberSymbolType : getLiteralTypeFromProperties(type, (indexFlags & 2 /* NoIndexSignatures */ ? 128 /* StringLiteral */ : 402653316 /* StringLike */) | (indexFlags & 1 /* StringsOnly */ ? 0 : 296 /* NumberLike */ | 12288 /* ESSymbolLike */), indexFlags === 0 /* None */);
66512
+ return isNoInferType(type) ? getNoInferType(getIndexType(type.baseType, indexFlags)) : shouldDeferIndexType(type, indexFlags) ? getIndexTypeForGenericType(type, indexFlags) : type.flags & 1048576 /* Union */ ? getIntersectionType(map(type.types, (t) => getIndexType(t, indexFlags))) : type.flags & 2097152 /* Intersection */ ? getUnionType(map(type.types, (t) => getIndexType(t, indexFlags))) : getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, indexFlags) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : type.flags & (1 /* Any */ | 131072 /* Never */) ? stringNumberSymbolType : getLiteralTypeFromProperties(type, (indexFlags & 2 /* NoIndexSignatures */ ? 128 /* StringLiteral */ : 402653316 /* StringLike */) | (indexFlags & 1 /* StringsOnly */ ? 0 : 296 /* NumberLike */ | 12288 /* ESSymbolLike */), indexFlags === 0 /* None */);
66508
66513
  }
66509
66514
  function getExtractStringType(type) {
66510
66515
  const extractTypeAlias = getGlobalExtractSymbol();
@@ -68338,7 +68343,8 @@ function createTypeChecker(host) {
68338
68343
  const { initializer } = node;
68339
68344
  return !!initializer && isContextSensitive(initializer);
68340
68345
  }
68341
- case 295 /* JsxExpression */: {
68346
+ case 295 /* JsxExpression */:
68347
+ case 230 /* YieldExpression */: {
68342
68348
  const { expression } = node;
68343
68349
  return !!expression && isContextSensitive(expression);
68344
68350
  }
@@ -68346,7 +68352,7 @@ function createTypeChecker(host) {
68346
68352
  return false;
68347
68353
  }
68348
68354
  function isContextSensitiveFunctionLikeDeclaration(node) {
68349
- return hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node);
68355
+ return hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node) || hasContextSensitiveYieldExpression(node);
68350
68356
  }
68351
68357
  function hasContextSensitiveReturnExpression(node) {
68352
68358
  if (node.typeParameters || getEffectiveReturnTypeNode(node) || !node.body) {
@@ -68357,6 +68363,9 @@ function createTypeChecker(host) {
68357
68363
  }
68358
68364
  return !!forEachReturnStatement(node.body, (statement) => !!statement.expression && isContextSensitive(statement.expression));
68359
68365
  }
68366
+ function hasContextSensitiveYieldExpression(node) {
68367
+ return !!(getFunctionFlags(node) & 1 /* Generator */ && node.body && forEachYieldExpression(node.body, isContextSensitive));
68368
+ }
68360
68369
  function isContextSensitiveFunctionOrObjectLiteralMethod(func) {
68361
68370
  return (isFunctionExpressionOrArrowFunction(func) || isObjectLiteralMethod(func)) && isContextSensitiveFunctionLikeDeclaration(func);
68362
68371
  }
@@ -77904,11 +77913,16 @@ function createTypeChecker(host) {
77904
77913
  if (contextualType && maybeTypeOfKind(contextualType, 465829888 /* Instantiable */)) {
77905
77914
  const inferenceContext = getInferenceContext(node);
77906
77915
  if (inferenceContext && contextFlags & 1 /* Signature */ && some(inferenceContext.inferences, hasInferenceCandidatesOrDefault)) {
77907
- return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
77916
+ const type = instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
77917
+ if (!(type.flags & 3 /* AnyOrUnknown */)) {
77918
+ return type;
77919
+ }
77908
77920
  }
77909
77921
  if (inferenceContext == null ? void 0 : inferenceContext.returnMapper) {
77910
77922
  const type = instantiateInstantiableTypes(contextualType, inferenceContext.returnMapper);
77911
- return type.flags & 1048576 /* Union */ && containsType(type.types, regularFalseType) && containsType(type.types, regularTrueType) ? filterType(type, (t) => t !== regularFalseType && t !== regularTrueType) : type;
77923
+ if (!(type.flags & 3 /* AnyOrUnknown */)) {
77924
+ return type.flags & 1048576 /* Union */ && containsType(type.types, regularFalseType) && containsType(type.types, regularTrueType) ? filterType(type, (t) => t !== regularFalseType && t !== regularTrueType) : type;
77925
+ }
77912
77926
  }
77913
77927
  }
77914
77928
  return contextualType;
@@ -78090,7 +78104,7 @@ function createTypeChecker(host) {
78090
78104
  ), getNameFromImportAttribute(node));
78091
78105
  }
78092
78106
  function getContextualJsxElementAttributesType(node, contextFlags) {
78093
- if (isJsxOpeningElement(node) && contextFlags !== 4 /* Completions */) {
78107
+ if (isJsxOpeningElement(node) && contextFlags !== 4 /* IgnoreNodeInferences */) {
78094
78108
  const index = findContextualNode(
78095
78109
  node.parent,
78096
78110
  /*includeCaches*/
@@ -90336,13 +90350,8 @@ function createTypeChecker(host) {
90336
90350
  }
90337
90351
  if (isIdentifier(node.name)) {
90338
90352
  checkCollisionsForDeclarationName(node, node.name);
90339
- if (!(node.flags & (32 /* Namespace */ | 2048 /* GlobalAugmentation */))) {
90340
- const sourceFile = getSourceFileOfNode(node);
90341
- const pos = getNonModifierTokenPosOfNode(node);
90342
- const span = getSpanOfTokenAtPosition(sourceFile, pos);
90343
- suggestionDiagnostics.add(
90344
- createFileDiagnostic(sourceFile, span.start, span.length, Diagnostics.A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead)
90345
- );
90353
+ if (!(node.flags & (32 /* Namespace */ | 2048 /* GlobalAugmentation */ | 33554432 /* Ambient */))) {
90354
+ error2(node.name, Diagnostics.A_namespace_declaration_should_not_be_declared_using_the_module_keyword_Please_use_the_namespace_keyword_instead);
90346
90355
  }
90347
90356
  }
90348
90357
  checkExportsOnMergedDeclarations(node);
@@ -168924,7 +168933,7 @@ function getContextualType(previousToken, position, sourceFile, checker) {
168924
168933
  return argInfo ? checker.getContextualTypeForArgumentAtIndex(argInfo.invocation, argInfo.argumentIndex) : isEqualityOperatorKind(previousToken.kind) && isBinaryExpression(parent2) && isEqualityOperatorKind(parent2.operatorToken.kind) ? (
168925
168934
  // completion at `x ===/**/` should be for the right side
168926
168935
  checker.getTypeAtLocation(parent2.left)
168927
- ) : checker.getContextualType(previousToken, 4 /* Completions */) || checker.getContextualType(previousToken);
168936
+ ) : checker.getContextualType(previousToken, 4 /* IgnoreNodeInferences */) || checker.getContextualType(previousToken);
168928
168937
  }
168929
168938
  }
168930
168939
  function getFirstSymbolInChain(symbol, enclosingDeclaration, checker) {
@@ -169429,7 +169438,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
169429
169438
  const jsxContainer = tryGetContainingJsxElement(contextToken);
169430
169439
  const attrsType = jsxContainer && typeChecker.getContextualType(jsxContainer.attributes);
169431
169440
  if (!attrsType) return 0 /* Continue */;
169432
- const completionsType = jsxContainer && typeChecker.getContextualType(jsxContainer.attributes, 4 /* Completions */);
169441
+ const completionsType = jsxContainer && typeChecker.getContextualType(jsxContainer.attributes, 4 /* IgnoreNodeInferences */);
169433
169442
  symbols = concatenate(symbols, filterJsxAttributes(getPropertiesForObjectExpression(attrsType, completionsType, jsxContainer.attributes, typeChecker), jsxContainer.attributes.properties));
169434
169443
  setSortTextToOptionalMember();
169435
169444
  completionKind = 3 /* MemberLike */;
@@ -169856,7 +169865,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
169856
169865
  }
169857
169866
  return 0 /* Continue */;
169858
169867
  }
169859
- const completionsType = typeChecker.getContextualType(objectLikeContainer, 4 /* Completions */);
169868
+ const completionsType = typeChecker.getContextualType(objectLikeContainer, 4 /* IgnoreNodeInferences */);
169860
169869
  const hasStringIndexType = (completionsType || instantiatedType).getStringIndexType();
169861
169870
  const hasNumberIndextype = (completionsType || instantiatedType).getNumberIndexType();
169862
169871
  isNewIdentifierLocation = !!hasStringIndexType || !!hasNumberIndextype;
@@ -171153,7 +171162,15 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, program,
171153
171162
  if (isObjectLiteralExpression(parent2.parent) && parent2.name === node) {
171154
171163
  return stringLiteralCompletionsForObjectLiteral(typeChecker, parent2.parent);
171155
171164
  }
171156
- return fromContextualType() || fromContextualType(0 /* None */);
171165
+ if (findAncestor(parent2.parent, isCallLikeExpression)) {
171166
+ const uniques2 = /* @__PURE__ */ new Set();
171167
+ const stringLiteralTypes = concatenate(
171168
+ getStringLiteralTypes(typeChecker.getContextualType(node, 0 /* None */), uniques2),
171169
+ getStringLiteralTypes(typeChecker.getContextualType(node, 4 /* IgnoreNodeInferences */), uniques2)
171170
+ );
171171
+ return toStringLiteralCompletionsFromTypes(stringLiteralTypes);
171172
+ }
171173
+ return fromContextualType(0 /* None */);
171157
171174
  case 213 /* ElementAccessExpression */: {
171158
171175
  const { expression, argumentExpression } = parent2;
171159
171176
  if (node === skipParentheses(argumentExpression)) {
@@ -171249,14 +171266,13 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, program,
171249
171266
  return void 0;
171250
171267
  }
171251
171268
  }
171252
- function fromContextualType(contextFlags = 4 /* Completions */) {
171253
- const types = getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker, contextFlags));
171254
- if (!types.length) {
171255
- return;
171256
- }
171257
- return { kind: 2 /* Types */, types, isNewIdentifier: false };
171269
+ function fromContextualType(contextFlags = 4 /* IgnoreNodeInferences */) {
171270
+ return toStringLiteralCompletionsFromTypes(getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker, contextFlags)));
171258
171271
  }
171259
171272
  }
171273
+ function toStringLiteralCompletionsFromTypes(types) {
171274
+ return types.length ? { kind: 2 /* Types */, types, isNewIdentifier: false } : void 0;
171275
+ }
171260
171276
  function walkUpParentheses(node) {
171261
171277
  switch (node.kind) {
171262
171278
  case 197 /* ParenthesizedType */:
@@ -171299,7 +171315,7 @@ function stringLiteralCompletionsFromProperties(type) {
171299
171315
  function stringLiteralCompletionsForObjectLiteral(checker, objectLiteralExpression) {
171300
171316
  const contextualType = checker.getContextualType(objectLiteralExpression);
171301
171317
  if (!contextualType) return void 0;
171302
- const completionsType = checker.getContextualType(objectLiteralExpression, 4 /* Completions */);
171318
+ const completionsType = checker.getContextualType(objectLiteralExpression, 4 /* IgnoreNodeInferences */);
171303
171319
  const symbols = getPropertiesForObjectExpression(
171304
171320
  contextualType,
171305
171321
  completionsType,
@@ -174594,13 +174610,29 @@ function getDefinitionFromObjectLiteralElement(typeChecker, node) {
174594
174610
  if (element) {
174595
174611
  const contextualType = element && typeChecker.getContextualType(element.parent);
174596
174612
  if (contextualType) {
174597
- return flatMap(getPropertySymbolsFromContextualType(
174613
+ let properties = getPropertySymbolsFromContextualType(
174598
174614
  element,
174599
174615
  typeChecker,
174600
174616
  contextualType,
174601
174617
  /*unionSymbolOk*/
174602
174618
  false
174603
- ), (propertySymbol) => getDefinitionFromSymbol(typeChecker, propertySymbol, node));
174619
+ );
174620
+ if (some(properties, (p) => !!(p.valueDeclaration && isObjectLiteralExpression(p.valueDeclaration.parent) && isObjectLiteralElementLike(p.valueDeclaration) && p.valueDeclaration.name === node))) {
174621
+ const withoutNodeInferencesType = typeChecker.getContextualType(element.parent, 4 /* IgnoreNodeInferences */);
174622
+ if (withoutNodeInferencesType) {
174623
+ const withoutNodeInferencesProperties = getPropertySymbolsFromContextualType(
174624
+ element,
174625
+ typeChecker,
174626
+ withoutNodeInferencesType,
174627
+ /*unionSymbolOk*/
174628
+ false
174629
+ );
174630
+ if (withoutNodeInferencesProperties.length) {
174631
+ properties = withoutNodeInferencesProperties;
174632
+ }
174633
+ }
174634
+ }
174635
+ return flatMap(properties, (propertySymbol) => getDefinitionFromSymbol(typeChecker, propertySymbol, node));
174604
174636
  }
174605
174637
  }
174606
174638
  return emptyArray;
@@ -184270,7 +184302,6 @@ __export(ts_exports2, {
184270
184302
  getNonAugmentationDeclaration: () => getNonAugmentationDeclaration,
184271
184303
  getNonDecoratorTokenPosOfNode: () => getNonDecoratorTokenPosOfNode,
184272
184304
  getNonIncrementalBuildInfoRoots: () => getNonIncrementalBuildInfoRoots,
184273
- getNonModifierTokenPosOfNode: () => getNonModifierTokenPosOfNode,
184274
184305
  getNormalizedAbsolutePath: () => getNormalizedAbsolutePath,
184275
184306
  getNormalizedAbsolutePathWithoutRoot: () => getNormalizedAbsolutePathWithoutRoot,
184276
184307
  getNormalizedPathComponents: () => getNormalizedPathComponents,
@@ -199032,7 +199063,6 @@ if (typeof console !== "undefined") {
199032
199063
  getNonAugmentationDeclaration,
199033
199064
  getNonDecoratorTokenPosOfNode,
199034
199065
  getNonIncrementalBuildInfoRoots,
199035
- getNonModifierTokenPosOfNode,
199036
199066
  getNormalizedAbsolutePath,
199037
199067
  getNormalizedAbsolutePathWithoutRoot,
199038
199068
  getNormalizedPathComponents,
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-62825-9",
5
+ "version": "6.0.0-pr-62876-5",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [