@typescript-deploys/pr-build 5.3.0-pr-55273-3 → 5.3.0-pr-55020-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/typescript.js CHANGED
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.3";
38
- version = `${versionMajorMinor}.0-insiders.20230811`;
38
+ version = `${versionMajorMinor}.0-insiders.20230816`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -14026,16 +14026,14 @@ ${lanes.join("\n")}
14026
14026
  const start = skipTrivia(sourceFile.text, nodes.pos);
14027
14027
  return createFileDiagnosticFromMessageChain(sourceFile, start, nodes.end - start, messageChain, relatedInformation);
14028
14028
  }
14029
- function assertDiagnosticLocation(file, start, length2) {
14029
+ function assertDiagnosticLocation(sourceText, start, length2) {
14030
14030
  Debug.assertGreaterThanOrEqual(start, 0);
14031
14031
  Debug.assertGreaterThanOrEqual(length2, 0);
14032
- if (file) {
14033
- Debug.assertLessThanOrEqual(start, file.text.length);
14034
- Debug.assertLessThanOrEqual(start + length2, file.text.length);
14035
- }
14032
+ Debug.assertLessThanOrEqual(start, sourceText.length);
14033
+ Debug.assertLessThanOrEqual(start + length2, sourceText.length);
14036
14034
  }
14037
14035
  function createFileDiagnosticFromMessageChain(file, start, length2, messageChain, relatedInformation) {
14038
- assertDiagnosticLocation(file, start, length2);
14036
+ assertDiagnosticLocation(file.text, start, length2);
14039
14037
  return {
14040
14038
  file,
14041
14039
  start,
@@ -14904,8 +14902,8 @@ ${lanes.join("\n")}
14904
14902
  return forStatement.initializer === node && forStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forStatement.condition === node || forStatement.incrementor === node;
14905
14903
  case 249 /* ForInStatement */:
14906
14904
  case 250 /* ForOfStatement */:
14907
- const forInStatement = parent2;
14908
- return forInStatement.initializer === node && forInStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forInStatement.expression === node;
14905
+ const forInOrOfStatement = parent2;
14906
+ return forInOrOfStatement.initializer === node && forInOrOfStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forInOrOfStatement.expression === node;
14909
14907
  case 216 /* TypeAssertionExpression */:
14910
14908
  case 234 /* AsExpression */:
14911
14909
  return node === parent2.expression;
@@ -15595,20 +15593,23 @@ ${lanes.join("\n")}
15595
15593
  function hasTypeArguments(node) {
15596
15594
  return !!node.typeArguments;
15597
15595
  }
15598
- function getAssignmentTargetKind(node) {
15596
+ function getAssignmentTarget(node) {
15599
15597
  let parent2 = node.parent;
15600
15598
  while (true) {
15601
15599
  switch (parent2.kind) {
15602
15600
  case 226 /* BinaryExpression */:
15603
- const binaryOperator = parent2.operatorToken.kind;
15604
- return isAssignmentOperator(binaryOperator) && parent2.left === node ? binaryOperator === 64 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */;
15601
+ const binaryExpression = parent2;
15602
+ const binaryOperator = binaryExpression.operatorToken.kind;
15603
+ return isAssignmentOperator(binaryOperator) && binaryExpression.left === node ? binaryExpression : void 0;
15605
15604
  case 224 /* PrefixUnaryExpression */:
15606
15605
  case 225 /* PostfixUnaryExpression */:
15607
- const unaryOperator = parent2.operator;
15608
- return unaryOperator === 46 /* PlusPlusToken */ || unaryOperator === 47 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */;
15606
+ const unaryExpression = parent2;
15607
+ const unaryOperator = unaryExpression.operator;
15608
+ return unaryOperator === 46 /* PlusPlusToken */ || unaryOperator === 47 /* MinusMinusToken */ ? unaryExpression : void 0;
15609
15609
  case 249 /* ForInStatement */:
15610
15610
  case 250 /* ForOfStatement */:
15611
- return parent2.initializer === node ? 1 /* Definite */ : 0 /* None */;
15611
+ const forInOrOfStatement = parent2;
15612
+ return forInOrOfStatement.initializer === node ? forInOrOfStatement : void 0;
15612
15613
  case 217 /* ParenthesizedExpression */:
15613
15614
  case 209 /* ArrayLiteralExpression */:
15614
15615
  case 230 /* SpreadElement */:
@@ -15620,24 +15621,53 @@ ${lanes.join("\n")}
15620
15621
  break;
15621
15622
  case 304 /* ShorthandPropertyAssignment */:
15622
15623
  if (parent2.name !== node) {
15623
- return 0 /* None */;
15624
+ return void 0;
15624
15625
  }
15625
15626
  node = parent2.parent;
15626
15627
  break;
15627
15628
  case 303 /* PropertyAssignment */:
15628
15629
  if (parent2.name === node) {
15629
- return 0 /* None */;
15630
+ return void 0;
15630
15631
  }
15631
15632
  node = parent2.parent;
15632
15633
  break;
15633
15634
  default:
15634
- return 0 /* None */;
15635
+ return void 0;
15635
15636
  }
15636
15637
  parent2 = node.parent;
15637
15638
  }
15638
15639
  }
15640
+ function getAssignmentTargetKind(node) {
15641
+ const target = getAssignmentTarget(node);
15642
+ if (!target) {
15643
+ return 0 /* None */;
15644
+ }
15645
+ switch (target.kind) {
15646
+ case 226 /* BinaryExpression */:
15647
+ const binaryOperator = target.operatorToken.kind;
15648
+ return binaryOperator === 64 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */;
15649
+ case 224 /* PrefixUnaryExpression */:
15650
+ case 225 /* PostfixUnaryExpression */:
15651
+ return 2 /* Compound */;
15652
+ case 249 /* ForInStatement */:
15653
+ case 250 /* ForOfStatement */:
15654
+ return 1 /* Definite */;
15655
+ }
15656
+ }
15639
15657
  function isAssignmentTarget(node) {
15640
- return getAssignmentTargetKind(node) !== 0 /* None */;
15658
+ return !!getAssignmentTarget(node);
15659
+ }
15660
+ function isCompoundLikeAssignment(assignment) {
15661
+ const right = skipParentheses(assignment.right);
15662
+ return right.kind === 226 /* BinaryExpression */ && isShiftOperatorOrHigher(right.operatorToken.kind);
15663
+ }
15664
+ function isInCompoundLikeAssignment(node) {
15665
+ const target = getAssignmentTarget(node);
15666
+ return !!target && isAssignmentExpression(
15667
+ target,
15668
+ /*excludeCompoundAssignment*/
15669
+ true
15670
+ ) && isCompoundLikeAssignment(target);
15641
15671
  }
15642
15672
  function isNodeWithPossibleHoistedDeclaration(node) {
15643
15673
  switch (node.kind) {
@@ -16341,8 +16371,11 @@ ${lanes.join("\n")}
16341
16371
  function escapeTemplateSubstitution(str) {
16342
16372
  return str.replace(templateSubstitutionRegExp, "\\${");
16343
16373
  }
16374
+ function containsInvalidEscapeFlag(node) {
16375
+ return !!((node.templateFlags || 0) & 2048 /* ContainsInvalidEscape */);
16376
+ }
16344
16377
  function hasInvalidEscape(template) {
16345
- return template && !!(isNoSubstitutionTemplateLiteral(template) ? template.templateFlags : template.head.templateFlags || some(template.templateSpans, (span) => !!span.literal.templateFlags));
16378
+ return template && !!(isNoSubstitutionTemplateLiteral(template) ? containsInvalidEscapeFlag(template) : containsInvalidEscapeFlag(template.head) || some(template.templateSpans, (span) => containsInvalidEscapeFlag(span.literal)));
16346
16379
  }
16347
16380
  function encodeUtf16EscapeSequence(charCode) {
16348
16381
  const hexCharCode = charCode.toString(16).toUpperCase();
@@ -17861,13 +17894,11 @@ ${lanes.join("\n")}
17861
17894
  function getLocaleSpecificMessage(message) {
17862
17895
  return localizedDiagnosticMessages && localizedDiagnosticMessages[message.key] || message.message;
17863
17896
  }
17864
- function createDetachedDiagnostic(fileName, start, length2, message, ...args) {
17865
- assertDiagnosticLocation(
17866
- /*file*/
17867
- void 0,
17868
- start,
17869
- length2
17870
- );
17897
+ function createDetachedDiagnostic(fileName, sourceText, start, length2, message, ...args) {
17898
+ if (start + length2 > sourceText.length) {
17899
+ length2 = sourceText.length - start;
17900
+ }
17901
+ assertDiagnosticLocation(sourceText, start, length2);
17871
17902
  let text = getLocaleSpecificMessage(message);
17872
17903
  if (some(args)) {
17873
17904
  text = formatStringFromArgs(text, args);
@@ -17923,7 +17954,7 @@ ${lanes.join("\n")}
17923
17954
  return diagnosticsWithLocation;
17924
17955
  }
17925
17956
  function createFileDiagnostic(file, start, length2, message, ...args) {
17926
- assertDiagnosticLocation(file, start, length2);
17957
+ assertDiagnosticLocation(file.text, start, length2);
17927
17958
  let text = getLocaleSpecificMessage(message);
17928
17959
  if (some(args)) {
17929
17960
  text = formatStringFromArgs(text, args);
@@ -29105,7 +29136,7 @@ ${lanes.join("\n")}
29105
29136
  }
29106
29137
  return sourceFile;
29107
29138
  function reportPragmaDiagnostic(pos, end, diagnostic) {
29108
- parseDiagnostics.push(createDetachedDiagnostic(fileName, pos, end, diagnostic));
29139
+ parseDiagnostics.push(createDetachedDiagnostic(fileName, sourceText, pos, end, diagnostic));
29109
29140
  }
29110
29141
  }
29111
29142
  let hasDeprecatedTag = false;
@@ -29345,7 +29376,7 @@ ${lanes.join("\n")}
29345
29376
  const lastError = lastOrUndefined(parseDiagnostics);
29346
29377
  let result;
29347
29378
  if (!lastError || start !== lastError.start) {
29348
- result = createDetachedDiagnostic(fileName, start, length2, message, ...args);
29379
+ result = createDetachedDiagnostic(fileName, sourceText, start, length2, message, ...args);
29349
29380
  parseDiagnostics.push(result);
29350
29381
  }
29351
29382
  parseErrorBeforeNextFinishedNode = true;
@@ -29573,7 +29604,7 @@ ${lanes.join("\n")}
29573
29604
  if (lastError) {
29574
29605
  addRelatedInfo(
29575
29606
  lastError,
29576
- createDetachedDiagnostic(fileName, openPosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, tokenToString(openKind), tokenToString(closeKind))
29607
+ createDetachedDiagnostic(fileName, sourceText, openPosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, tokenToString(openKind), tokenToString(closeKind))
29577
29608
  );
29578
29609
  }
29579
29610
  }
@@ -31172,7 +31203,7 @@ ${lanes.join("\n")}
31172
31203
  if (lastError && lastError.code === Diagnostics._0_expected.code) {
31173
31204
  addRelatedInfo(
31174
31205
  lastError,
31175
- createDetachedDiagnostic(fileName, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}")
31206
+ createDetachedDiagnostic(fileName, sourceText, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}")
31176
31207
  );
31177
31208
  }
31178
31209
  }
@@ -34289,7 +34320,7 @@ ${lanes.join("\n")}
34289
34320
  if (lastError && lastError.code === Diagnostics._0_expected.code) {
34290
34321
  addRelatedInfo(
34291
34322
  lastError,
34292
- createDetachedDiagnostic(fileName, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}")
34323
+ createDetachedDiagnostic(fileName, sourceText, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}")
34293
34324
  );
34294
34325
  }
34295
34326
  }
@@ -35268,7 +35299,7 @@ ${lanes.join("\n")}
35268
35299
  if (childTypeTag) {
35269
35300
  const lastError = parseErrorAtCurrentToken(Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);
35270
35301
  if (lastError) {
35271
- addRelatedInfo(lastError, createDetachedDiagnostic(fileName, 0, 0, Diagnostics.The_tag_was_first_specified_here));
35302
+ addRelatedInfo(lastError, createDetachedDiagnostic(fileName, sourceText, 0, 0, Diagnostics.The_tag_was_first_specified_here));
35272
35303
  }
35273
35304
  break;
35274
35305
  } else {
@@ -39602,9 +39633,8 @@ ${lanes.join("\n")}
39602
39633
  function getKeyForCompilerOptions(options, affectingOptionDeclarations) {
39603
39634
  return affectingOptionDeclarations.map((option) => compilerOptionValueToString(getCompilerOptionValue(options, option))).join("|") + `|${options.pathsBasePath}`;
39604
39635
  }
39605
- function createCacheWithRedirects(ownOptions) {
39636
+ function createCacheWithRedirects(ownOptions, optionsToRedirectsKey) {
39606
39637
  const redirectsMap = /* @__PURE__ */ new Map();
39607
- const optionsToRedirectsKey = /* @__PURE__ */ new Map();
39608
39638
  const redirectsKeyToMap = /* @__PURE__ */ new Map();
39609
39639
  let ownMap = /* @__PURE__ */ new Map();
39610
39640
  if (ownOptions)
@@ -39714,8 +39744,8 @@ ${lanes.join("\n")}
39714
39744
  }
39715
39745
  return result;
39716
39746
  }
39717
- function createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, options) {
39718
- const directoryToModuleNameMap = createCacheWithRedirects(options);
39747
+ function createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, options, optionsToRedirectsKey) {
39748
+ const directoryToModuleNameMap = createCacheWithRedirects(options, optionsToRedirectsKey);
39719
39749
  return {
39720
39750
  getFromDirectoryCache,
39721
39751
  getOrCreateCacheForDirectory,
@@ -39791,8 +39821,8 @@ ${lanes.join("\n")}
39791
39821
  function getOriginalOrResolvedTypeReferenceFileName(result) {
39792
39822
  return result.resolvedTypeReferenceDirective && (result.resolvedTypeReferenceDirective.originalPath || result.resolvedTypeReferenceDirective.resolvedFileName);
39793
39823
  }
39794
- function createNonRelativeNameResolutionCache(currentDirectory, getCanonicalFileName, options, getResolvedFileName) {
39795
- const moduleNameToDirectoryMap = createCacheWithRedirects(options);
39824
+ function createNonRelativeNameResolutionCache(currentDirectory, getCanonicalFileName, options, getResolvedFileName, optionsToRedirectsKey) {
39825
+ const moduleNameToDirectoryMap = createCacheWithRedirects(options, optionsToRedirectsKey);
39796
39826
  return {
39797
39827
  getFromNonRelativeNameCache,
39798
39828
  getOrCreateCacheForNonRelativeName,
@@ -39860,13 +39890,20 @@ ${lanes.join("\n")}
39860
39890
  }
39861
39891
  }
39862
39892
  }
39863
- function createModuleOrTypeReferenceResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache, getResolvedFileName) {
39864
- const perDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, options);
39893
+ function createModuleOrTypeReferenceResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache, getResolvedFileName, optionsToRedirectsKey) {
39894
+ optionsToRedirectsKey ?? (optionsToRedirectsKey = /* @__PURE__ */ new Map());
39895
+ const perDirectoryResolutionCache = createPerDirectoryResolutionCache(
39896
+ currentDirectory,
39897
+ getCanonicalFileName,
39898
+ options,
39899
+ optionsToRedirectsKey
39900
+ );
39865
39901
  const nonRelativeNameResolutionCache = createNonRelativeNameResolutionCache(
39866
39902
  currentDirectory,
39867
39903
  getCanonicalFileName,
39868
39904
  options,
39869
- getResolvedFileName
39905
+ getResolvedFileName,
39906
+ optionsToRedirectsKey
39870
39907
  );
39871
39908
  packageJsonInfoCache ?? (packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName));
39872
39909
  return {
@@ -39876,7 +39913,8 @@ ${lanes.join("\n")}
39876
39913
  clear: clear2,
39877
39914
  update,
39878
39915
  getPackageJsonInfoCache: () => packageJsonInfoCache,
39879
- clearAllExceptPackageJsonInfoCache
39916
+ clearAllExceptPackageJsonInfoCache,
39917
+ optionsToRedirectsKey
39880
39918
  };
39881
39919
  function clear2() {
39882
39920
  clearAllExceptPackageJsonInfoCache();
@@ -39891,24 +39929,26 @@ ${lanes.join("\n")}
39891
39929
  nonRelativeNameResolutionCache.update(options2);
39892
39930
  }
39893
39931
  }
39894
- function createModuleResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache) {
39932
+ function createModuleResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache, optionsToRedirectsKey) {
39895
39933
  const result = createModuleOrTypeReferenceResolutionCache(
39896
39934
  currentDirectory,
39897
39935
  getCanonicalFileName,
39898
39936
  options,
39899
39937
  packageJsonInfoCache,
39900
- getOriginalOrResolvedModuleFileName
39938
+ getOriginalOrResolvedModuleFileName,
39939
+ optionsToRedirectsKey
39901
39940
  );
39902
39941
  result.getOrCreateCacheForModuleName = (nonRelativeName, mode, redirectedReference) => result.getOrCreateCacheForNonRelativeName(nonRelativeName, mode, redirectedReference);
39903
39942
  return result;
39904
39943
  }
39905
- function createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache) {
39944
+ function createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache, optionsToRedirectsKey) {
39906
39945
  return createModuleOrTypeReferenceResolutionCache(
39907
39946
  currentDirectory,
39908
39947
  getCanonicalFileName,
39909
39948
  options,
39910
39949
  packageJsonInfoCache,
39911
- getOriginalOrResolvedTypeReferenceFileName
39950
+ getOriginalOrResolvedTypeReferenceFileName,
39951
+ optionsToRedirectsKey
39912
39952
  );
39913
39953
  }
39914
39954
  function getOptionsForLibraryResolution(options) {
@@ -51623,7 +51663,14 @@ ${lanes.join("\n")}
51623
51663
  }
51624
51664
  function isStringNamed(d) {
51625
51665
  const name = getNameOfDeclaration(d);
51626
- return !!name && isStringLiteral(name);
51666
+ if (!name) {
51667
+ return false;
51668
+ }
51669
+ if (isComputedPropertyName(name)) {
51670
+ const type = checkExpression(name.expression);
51671
+ return !!(type.flags & 402653316 /* StringLike */);
51672
+ }
51673
+ return isStringLiteral(name);
51627
51674
  }
51628
51675
  function isSingleQuotedStringNamed(d) {
51629
51676
  const name = getNameOfDeclaration(d);
@@ -54755,7 +54802,7 @@ ${lanes.join("\n")}
54755
54802
  return checkFlags & 2 /* SyntheticProperty */ ? checkFlags & 65536 /* DeferredType */ ? getWriteTypeOfSymbolWithDeferredType(symbol) || getTypeOfSymbolWithDeferredType(symbol) : (
54756
54803
  // NOTE: cast to TransientSymbol should be safe because only TransientSymbols can have CheckFlags.SyntheticProperty
54757
54804
  symbol.links.writeType || symbol.links.type
54758
- ) : getTypeOfSymbol(symbol);
54805
+ ) : removeMissingType(getTypeOfSymbol(symbol), !!(symbol.flags & 16777216 /* Optional */));
54759
54806
  }
54760
54807
  if (symbol.flags & 98304 /* Accessor */) {
54761
54808
  return checkFlags & 1 /* Instantiated */ ? getWriteTypeOfInstantiatedSymbol(symbol) : getWriteTypeOfAccessors(symbol);
@@ -65966,7 +66013,6 @@ ${lanes.join("\n")}
65966
66013
  let bivariant = false;
65967
66014
  let propagationType;
65968
66015
  let inferencePriority = 2048 /* MaxValue */;
65969
- let allowComplexConstraintInference = true;
65970
66016
  let visited;
65971
66017
  let sourceStack;
65972
66018
  let targetStack;
@@ -66121,8 +66167,7 @@ ${lanes.join("\n")}
66121
66167
  source = getReducedType(source);
66122
66168
  if (!(priority & 512 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */))) {
66123
66169
  const apparentSource = getApparentType(source);
66124
- if (apparentSource !== source && allowComplexConstraintInference && !(apparentSource.flags & (524288 /* Object */ | 2097152 /* Intersection */))) {
66125
- allowComplexConstraintInference = false;
66170
+ if (apparentSource !== source && !(apparentSource.flags & (524288 /* Object */ | 2097152 /* Intersection */))) {
66126
66171
  return inferFromTypes(apparentSource, target);
66127
66172
  }
66128
66173
  source = apparentSource;
@@ -67766,10 +67811,11 @@ ${lanes.join("\n")}
67766
67811
  const assignedType = getWidenedLiteralType(getInitialOrAssignedType(flow));
67767
67812
  return isTypeAssignableTo(assignedType, declaredType) ? assignedType : anyArrayType;
67768
67813
  }
67769
- if (declaredType.flags & 1048576 /* Union */) {
67770
- return getAssignmentReducedType(declaredType, getInitialOrAssignedType(flow));
67814
+ const t = isInCompoundLikeAssignment(node) ? getBaseTypeOfLiteralType(declaredType) : declaredType;
67815
+ if (t.flags & 1048576 /* Union */) {
67816
+ return getAssignmentReducedType(t, getInitialOrAssignedType(flow));
67771
67817
  }
67772
- return declaredType;
67818
+ return t;
67773
67819
  }
67774
67820
  if (containsMatchingReference(reference, node)) {
67775
67821
  if (!isReachableFlowNode(flow)) {
@@ -68632,7 +68678,15 @@ ${lanes.join("\n")}
68632
68678
  location = location.parent;
68633
68679
  }
68634
68680
  if (isExpressionNode(location) && (!isAssignmentTarget(location) || isWriteAccess(location))) {
68635
- const type = removeOptionalTypeMarker(getTypeOfExpression(location));
68681
+ const type = removeOptionalTypeMarker(
68682
+ isWriteAccess(location) && location.kind === 211 /* PropertyAccessExpression */ ? checkPropertyAccessExpression(
68683
+ location,
68684
+ /*checkMode*/
68685
+ void 0,
68686
+ /*writeOnly*/
68687
+ true
68688
+ ) : getTypeOfExpression(location)
68689
+ );
68636
68690
  if (getExportSymbolOfValueSymbolIfExported(getNodeLinks(location).resolvedSymbol) === symbol) {
68637
68691
  return type;
68638
68692
  }
@@ -68893,7 +68947,7 @@ ${lanes.join("\n")}
68893
68947
  const isAlias = localOrExportSymbol.flags & 2097152 /* Alias */;
68894
68948
  if (localOrExportSymbol.flags & 3 /* Variable */) {
68895
68949
  if (assignmentKind === 1 /* Definite */) {
68896
- return type;
68950
+ return isInCompoundLikeAssignment(node) ? getBaseTypeOfLiteralType(type) : type;
68897
68951
  }
68898
68952
  } else if (isAlias) {
68899
68953
  declaration = getDeclarationOfAliasSymbol(symbol);
@@ -69988,8 +70042,19 @@ ${lanes.join("\n")}
69988
70042
  contextualType,
69989
70043
  concatenate(
69990
70044
  map(
69991
- filter(node.properties, (p) => !!p.symbol && p.kind === 303 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName)),
69992
- (prop) => [() => getContextFreeTypeOfExpression(prop.initializer), prop.symbol.escapedName]
70045
+ filter(node.properties, (p) => {
70046
+ if (!p.symbol) {
70047
+ return false;
70048
+ }
70049
+ if (p.kind === 303 /* PropertyAssignment */) {
70050
+ return isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName);
70051
+ }
70052
+ if (p.kind === 304 /* ShorthandPropertyAssignment */) {
70053
+ return isDiscriminantProperty(contextualType, p.symbol.escapedName);
70054
+ }
70055
+ return false;
70056
+ }),
70057
+ (prop) => [() => getContextFreeTypeOfExpression(prop.kind === 303 /* PropertyAssignment */ ? prop.initializer : prop.name), prop.symbol.escapedName]
69993
70058
  ),
69994
70059
  map(
69995
70060
  filter(getPropertiesOfType(contextualType), (s) => {
@@ -118450,7 +118515,8 @@ ${lanes.join("\n")}
118450
118515
  getCanonicalFileName,
118451
118516
  /*options*/
118452
118517
  void 0,
118453
- moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache()
118518
+ moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache(),
118519
+ moduleResolutionCache == null ? void 0 : moduleResolutionCache.optionsToRedirectsKey
118454
118520
  );
118455
118521
  actualResolveTypeReferenceDirectiveNamesWorker = (typeDirectiveNames, containingFile, redirectedReference, options2, containingSourceFile) => loadWithModeAwareCache(
118456
118522
  typeDirectiveNames,
@@ -123658,7 +123724,8 @@ ${lanes.join("\n")}
123658
123724
  getCurrentDirectory(),
123659
123725
  resolutionHost.getCanonicalFileName,
123660
123726
  resolutionHost.getCompilationSettings(),
123661
- moduleResolutionCache.getPackageJsonInfoCache()
123727
+ moduleResolutionCache.getPackageJsonInfoCache(),
123728
+ moduleResolutionCache.optionsToRedirectsKey
123662
123729
  );
123663
123730
  const resolvedLibraries = /* @__PURE__ */ new Map();
123664
123731
  const libraryResolutionCache = createModuleResolutionCache(
@@ -126032,7 +126099,8 @@ ${lanes.join("\n")}
126032
126099
  compilerHost.getCanonicalFileName,
126033
126100
  /*options*/
126034
126101
  void 0,
126035
- moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache()
126102
+ moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache(),
126103
+ moduleResolutionCache == null ? void 0 : moduleResolutionCache.optionsToRedirectsKey
126036
126104
  );
126037
126105
  compilerHost.resolveTypeReferenceDirectiveReferences = (typeDirectiveNames, containingFile, redirectedReference, options2, containingSourceFile) => loadWithModeAwareCache(
126038
126106
  typeDirectiveNames,
@@ -146319,8 +146387,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
146319
146387
  });
146320
146388
 
146321
146389
  // src/services/codefixes/addNameToNamelessParameter.ts
146322
- function makeChange7(changeTracker, sourceFile, pos) {
146323
- const token = getTokenAtPosition(sourceFile, pos);
146390
+ function makeChange7(changeTracker, sourceFile, start) {
146391
+ const token = getTokenAtPosition(sourceFile, start);
146324
146392
  const param = token.parent;
146325
146393
  if (!isParameter(param)) {
146326
146394
  return Debug.fail("Tried to add a parameter name to a non-parameter: " + Debug.formatSyntaxKind(token.kind));
@@ -146328,20 +146396,34 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
146328
146396
  const i = param.parent.parameters.indexOf(param);
146329
146397
  Debug.assert(!param.type, "Tried to add a parameter name to a parameter that already had one.");
146330
146398
  Debug.assert(i > -1, "Parameter not found in parent parameter list.");
146331
- const typeNode = factory.createTypeReferenceNode(
146399
+ let end = param.name.getEnd();
146400
+ let typeNode = factory.createTypeReferenceNode(
146332
146401
  param.name,
146333
146402
  /*typeArguments*/
146334
146403
  void 0
146335
146404
  );
146405
+ let nextParam = tryGetNextParam(sourceFile, param);
146406
+ while (nextParam) {
146407
+ typeNode = factory.createArrayTypeNode(typeNode);
146408
+ end = nextParam.getEnd();
146409
+ nextParam = tryGetNextParam(sourceFile, nextParam);
146410
+ }
146336
146411
  const replacement = factory.createParameterDeclaration(
146337
146412
  param.modifiers,
146338
146413
  param.dotDotDotToken,
146339
146414
  "arg" + i,
146340
146415
  param.questionToken,
146341
- param.dotDotDotToken ? factory.createArrayTypeNode(typeNode) : typeNode,
146416
+ param.dotDotDotToken && !isArrayTypeNode(typeNode) ? factory.createArrayTypeNode(typeNode) : typeNode,
146342
146417
  param.initializer
146343
146418
  );
146344
- changeTracker.replaceNode(sourceFile, param, replacement);
146419
+ changeTracker.replaceRange(sourceFile, createRange(param.getStart(sourceFile), end), replacement);
146420
+ }
146421
+ function tryGetNextParam(sourceFile, param) {
146422
+ const nextToken = findNextToken(param.name, param.parent, sourceFile);
146423
+ if (nextToken && nextToken.kind === 23 /* OpenBracketToken */ && isArrayBindingPattern(nextToken.parent) && isParameter(nextToken.parent.parent)) {
146424
+ return nextToken.parent.parent;
146425
+ }
146426
+ return void 0;
146345
146427
  }
146346
146428
  var fixId7, errorCodes7;
146347
146429
  var init_addNameToNamelessParameter = __esm({
@@ -164231,11 +164313,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
164231
164313
  if (!signature || !candidates.length) {
164232
164314
  return;
164233
164315
  }
164234
- let signatureParamPos = 0;
164235
164316
  const sourceFile = shouldUseInteractiveInlayHints(preferences) ? expr.getSourceFile() : void 0;
164317
+ let signatureParamPos = 0;
164236
164318
  for (const originalArg of args) {
164237
164319
  const arg = skipParentheses(originalArg);
164238
164320
  if (shouldShowLiteralParameterNameHintsOnly(preferences) && !isHintableLiteral(arg)) {
164321
+ signatureParamPos++;
164239
164322
  continue;
164240
164323
  }
164241
164324
  let spreadArgs = 0;
@@ -184616,6 +184699,7 @@ ${e.message}`;
184616
184699
  isImportTypeNode: () => isImportTypeNode,
184617
184700
  isImportableFile: () => isImportableFile,
184618
184701
  isInComment: () => isInComment,
184702
+ isInCompoundLikeAssignment: () => isInCompoundLikeAssignment,
184619
184703
  isInExpressionContext: () => isInExpressionContext,
184620
184704
  isInJSDoc: () => isInJSDoc,
184621
184705
  isInJSFile: () => isInJSFile,
@@ -184909,6 +184993,7 @@ ${e.message}`;
184909
184993
  isSetAccessor: () => isSetAccessor,
184910
184994
  isSetAccessorDeclaration: () => isSetAccessorDeclaration,
184911
184995
  isShebangTrivia: () => isShebangTrivia,
184996
+ isShiftOperatorOrHigher: () => isShiftOperatorOrHigher,
184912
184997
  isShorthandAmbientModuleSymbol: () => isShorthandAmbientModuleSymbol,
184913
184998
  isShorthandPropertyAssignment: () => isShorthandPropertyAssignment,
184914
184999
  isSignedNumericLiteral: () => isSignedNumericLiteral,
@@ -187023,6 +187108,7 @@ ${e.message}`;
187023
187108
  isImportTypeNode: () => isImportTypeNode,
187024
187109
  isImportableFile: () => isImportableFile,
187025
187110
  isInComment: () => isInComment,
187111
+ isInCompoundLikeAssignment: () => isInCompoundLikeAssignment,
187026
187112
  isInExpressionContext: () => isInExpressionContext,
187027
187113
  isInJSDoc: () => isInJSDoc,
187028
187114
  isInJSFile: () => isInJSFile,
@@ -187316,6 +187402,7 @@ ${e.message}`;
187316
187402
  isSetAccessor: () => isSetAccessor,
187317
187403
  isSetAccessorDeclaration: () => isSetAccessorDeclaration,
187318
187404
  isShebangTrivia: () => isShebangTrivia,
187405
+ isShiftOperatorOrHigher: () => isShiftOperatorOrHigher,
187319
187406
  isShorthandAmbientModuleSymbol: () => isShorthandAmbientModuleSymbol,
187320
187407
  isShorthandPropertyAssignment: () => isShorthandPropertyAssignment,
187321
187408
  isSignedNumericLiteral: () => isSignedNumericLiteral,
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.3";
57
- var version = `${versionMajorMinor}.0-insiders.20230811`;
57
+ var version = `${versionMajorMinor}.0-insiders.20230816`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -10169,13 +10169,11 @@ function createDiagnosticForNodeInSourceFile(sourceFile, node, message, ...args)
10169
10169
  const span = getErrorSpanForNode(sourceFile, node);
10170
10170
  return createFileDiagnostic(sourceFile, span.start, span.length, message, ...args);
10171
10171
  }
10172
- function assertDiagnosticLocation(file, start, length2) {
10172
+ function assertDiagnosticLocation(sourceText, start, length2) {
10173
10173
  Debug.assertGreaterThanOrEqual(start, 0);
10174
10174
  Debug.assertGreaterThanOrEqual(length2, 0);
10175
- if (file) {
10176
- Debug.assertLessThanOrEqual(start, file.text.length);
10177
- Debug.assertLessThanOrEqual(start + length2, file.text.length);
10178
- }
10175
+ Debug.assertLessThanOrEqual(start, sourceText.length);
10176
+ Debug.assertLessThanOrEqual(start + length2, sourceText.length);
10179
10177
  }
10180
10178
  function getSpanOfTokenAtPosition(sourceFile, pos) {
10181
10179
  const scanner = createScanner(
@@ -10817,8 +10815,11 @@ function getBinaryOperatorPrecedence(kind) {
10817
10815
  }
10818
10816
  return -1;
10819
10817
  }
10818
+ function containsInvalidEscapeFlag(node) {
10819
+ return !!((node.templateFlags || 0) & 2048 /* ContainsInvalidEscape */);
10820
+ }
10820
10821
  function hasInvalidEscape(template) {
10821
- return template && !!(isNoSubstitutionTemplateLiteral(template) ? template.templateFlags : template.head.templateFlags || some(template.templateSpans, (span) => !!span.literal.templateFlags));
10822
+ return template && !!(isNoSubstitutionTemplateLiteral(template) ? containsInvalidEscapeFlag(template) : containsInvalidEscapeFlag(template.head) || some(template.templateSpans, (span) => containsInvalidEscapeFlag(span.literal)));
10822
10823
  }
10823
10824
  var escapedCharsMap = new Map(Object.entries({
10824
10825
  " ": "\\t",
@@ -11161,13 +11162,11 @@ var localizedDiagnosticMessages;
11161
11162
  function getLocaleSpecificMessage(message) {
11162
11163
  return localizedDiagnosticMessages && localizedDiagnosticMessages[message.key] || message.message;
11163
11164
  }
11164
- function createDetachedDiagnostic(fileName, start, length2, message, ...args) {
11165
- assertDiagnosticLocation(
11166
- /*file*/
11167
- void 0,
11168
- start,
11169
- length2
11170
- );
11165
+ function createDetachedDiagnostic(fileName, sourceText, start, length2, message, ...args) {
11166
+ if (start + length2 > sourceText.length) {
11167
+ length2 = sourceText.length - start;
11168
+ }
11169
+ assertDiagnosticLocation(sourceText, start, length2);
11171
11170
  let text = getLocaleSpecificMessage(message);
11172
11171
  if (some(args)) {
11173
11172
  text = formatStringFromArgs(text, args);
@@ -11223,7 +11222,7 @@ function attachFileToDiagnostics(diagnostics, file) {
11223
11222
  return diagnosticsWithLocation;
11224
11223
  }
11225
11224
  function createFileDiagnostic(file, start, length2, message, ...args) {
11226
- assertDiagnosticLocation(file, start, length2);
11225
+ assertDiagnosticLocation(file.text, start, length2);
11227
11226
  let text = getLocaleSpecificMessage(message);
11228
11227
  if (some(args)) {
11229
11228
  text = formatStringFromArgs(text, args);
@@ -18522,7 +18521,7 @@ var Parser;
18522
18521
  }
18523
18522
  return sourceFile;
18524
18523
  function reportPragmaDiagnostic(pos, end, diagnostic) {
18525
- parseDiagnostics.push(createDetachedDiagnostic(fileName, pos, end, diagnostic));
18524
+ parseDiagnostics.push(createDetachedDiagnostic(fileName, sourceText, pos, end, diagnostic));
18526
18525
  }
18527
18526
  }
18528
18527
  let hasDeprecatedTag = false;
@@ -18762,7 +18761,7 @@ var Parser;
18762
18761
  const lastError = lastOrUndefined(parseDiagnostics);
18763
18762
  let result;
18764
18763
  if (!lastError || start !== lastError.start) {
18765
- result = createDetachedDiagnostic(fileName, start, length2, message, ...args);
18764
+ result = createDetachedDiagnostic(fileName, sourceText, start, length2, message, ...args);
18766
18765
  parseDiagnostics.push(result);
18767
18766
  }
18768
18767
  parseErrorBeforeNextFinishedNode = true;
@@ -18990,7 +18989,7 @@ var Parser;
18990
18989
  if (lastError) {
18991
18990
  addRelatedInfo(
18992
18991
  lastError,
18993
- createDetachedDiagnostic(fileName, openPosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, tokenToString(openKind), tokenToString(closeKind))
18992
+ createDetachedDiagnostic(fileName, sourceText, openPosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, tokenToString(openKind), tokenToString(closeKind))
18994
18993
  );
18995
18994
  }
18996
18995
  }
@@ -20589,7 +20588,7 @@ var Parser;
20589
20588
  if (lastError && lastError.code === Diagnostics._0_expected.code) {
20590
20589
  addRelatedInfo(
20591
20590
  lastError,
20592
- createDetachedDiagnostic(fileName, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}")
20591
+ createDetachedDiagnostic(fileName, sourceText, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}")
20593
20592
  );
20594
20593
  }
20595
20594
  }
@@ -23706,7 +23705,7 @@ var Parser;
23706
23705
  if (lastError && lastError.code === Diagnostics._0_expected.code) {
23707
23706
  addRelatedInfo(
23708
23707
  lastError,
23709
- createDetachedDiagnostic(fileName, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}")
23708
+ createDetachedDiagnostic(fileName, sourceText, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}")
23710
23709
  );
23711
23710
  }
23712
23711
  }
@@ -24685,7 +24684,7 @@ var Parser;
24685
24684
  if (childTypeTag) {
24686
24685
  const lastError = parseErrorAtCurrentToken(Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);
24687
24686
  if (lastError) {
24688
- addRelatedInfo(lastError, createDetachedDiagnostic(fileName, 0, 0, Diagnostics.The_tag_was_first_specified_here));
24687
+ addRelatedInfo(lastError, createDetachedDiagnostic(fileName, sourceText, 0, 0, Diagnostics.The_tag_was_first_specified_here));
24689
24688
  }
24690
24689
  break;
24691
24690
  } else {