@typescript-deploys/pr-build 5.7.0-pr-59736-2 → 5.7.0-pr-59860-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/tsc.js CHANGED
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.7";
21
- var version = `${versionMajorMinor}.0-insiders.20240827`;
21
+ var version = `${versionMajorMinor}.0-insiders.20240904`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -426,7 +426,10 @@ function deduplicateSorted(array, comparer) {
426
426
  for (let i = 1; i < array.length; i++) {
427
427
  const next = array[i];
428
428
  switch (comparer(next, last2)) {
429
+ // equality comparison
429
430
  case true:
431
+ // relational comparison
432
+ // falls through
430
433
  case 0 /* EqualTo */:
431
434
  continue;
432
435
  case -1 /* LessThan */:
@@ -1079,7 +1082,7 @@ function findBestPatternMatch(values, getPattern, candidate) {
1079
1082
  for (let i = 0; i < values.length; i++) {
1080
1083
  const v = values[i];
1081
1084
  const pattern = getPattern(v);
1082
- if (isPatternMatch(pattern, candidate) && pattern.prefix.length > longestMatchPrefixLength) {
1085
+ if (pattern.prefix.length > longestMatchPrefixLength && isPatternMatch(pattern, candidate)) {
1083
1086
  longestMatchPrefixLength = pattern.prefix.length;
1084
1087
  matchedValue = v;
1085
1088
  }
@@ -3285,10 +3288,11 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind4) => {
3285
3288
  SyntaxKind4[SyntaxKind4["JSDocImportTag"] = 351] = "JSDocImportTag";
3286
3289
  SyntaxKind4[SyntaxKind4["SyntaxList"] = 352] = "SyntaxList";
3287
3290
  SyntaxKind4[SyntaxKind4["NotEmittedStatement"] = 353] = "NotEmittedStatement";
3288
- SyntaxKind4[SyntaxKind4["PartiallyEmittedExpression"] = 354] = "PartiallyEmittedExpression";
3289
- SyntaxKind4[SyntaxKind4["CommaListExpression"] = 355] = "CommaListExpression";
3290
- SyntaxKind4[SyntaxKind4["SyntheticReferenceExpression"] = 356] = "SyntheticReferenceExpression";
3291
- SyntaxKind4[SyntaxKind4["Count"] = 357] = "Count";
3291
+ SyntaxKind4[SyntaxKind4["NotEmittedTypeElement"] = 354] = "NotEmittedTypeElement";
3292
+ SyntaxKind4[SyntaxKind4["PartiallyEmittedExpression"] = 355] = "PartiallyEmittedExpression";
3293
+ SyntaxKind4[SyntaxKind4["CommaListExpression"] = 356] = "CommaListExpression";
3294
+ SyntaxKind4[SyntaxKind4["SyntheticReferenceExpression"] = 357] = "SyntheticReferenceExpression";
3295
+ SyntaxKind4[SyntaxKind4["Count"] = 358] = "Count";
3292
3296
  SyntaxKind4[SyntaxKind4["FirstAssignment"] = 64 /* EqualsToken */] = "FirstAssignment";
3293
3297
  SyntaxKind4[SyntaxKind4["LastAssignment"] = 79 /* CaretEqualsToken */] = "LastAssignment";
3294
3298
  SyntaxKind4[SyntaxKind4["FirstCompoundAssignment"] = 65 /* PlusEqualsToken */] = "FirstCompoundAssignment";
@@ -4609,6 +4613,7 @@ function createSystemWatchFunctions({
4609
4613
  return generateWatchFileOptions(4 /* UseFsEvents */, 2 /* DynamicPriority */, options);
4610
4614
  case "UseFsEventsOnParentDirectory":
4611
4615
  useNonPollingWatchers2 = true;
4616
+ // fall through
4612
4617
  default:
4613
4618
  return useNonPollingWatchers2 ? (
4614
4619
  // Use notifications from FS to watch with falling back to fs.watchFile
@@ -8135,6 +8140,7 @@ function computeLineStarts(text) {
8135
8140
  if (text.charCodeAt(pos) === 10 /* lineFeed */) {
8136
8141
  pos++;
8137
8142
  }
8143
+ // falls through
8138
8144
  case 10 /* lineFeed */:
8139
8145
  result.push(lineStart);
8140
8146
  lineStart = pos;
@@ -8239,6 +8245,7 @@ function skipTrivia(text, pos, stopAfterLineBreak, stopAtComments, inJSDoc) {
8239
8245
  if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) {
8240
8246
  pos++;
8241
8247
  }
8248
+ // falls through
8242
8249
  case 10 /* lineFeed */:
8243
8250
  pos++;
8244
8251
  if (stopAfterLineBreak) {
@@ -8385,6 +8392,7 @@ function iterateCommentRanges(reduce, text, pos, trailing, cb, state, initial) {
8385
8392
  if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) {
8386
8393
  pos++;
8387
8394
  }
8395
+ // falls through
8388
8396
  case 10 /* lineFeed */:
8389
8397
  pos++;
8390
8398
  if (trailing) {
@@ -8950,12 +8958,16 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
8950
8958
  if (pos >= end || !isDigit(charCodeUnchecked(pos))) {
8951
8959
  return "\0";
8952
8960
  }
8961
+ // '\01', '\011'
8962
+ // falls through
8953
8963
  case 49 /* _1 */:
8954
8964
  case 50 /* _2 */:
8955
8965
  case 51 /* _3 */:
8956
8966
  if (pos < end && isOctalDigit(charCodeUnchecked(pos))) {
8957
8967
  pos++;
8958
8968
  }
8969
+ // '\17', '\177'
8970
+ // falls through
8959
8971
  case 52 /* _4 */:
8960
8972
  case 53 /* _5 */:
8961
8973
  case 54 /* _6 */:
@@ -9053,10 +9065,13 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
9053
9065
  }
9054
9066
  tokenFlags |= 4096 /* HexEscape */;
9055
9067
  return String.fromCharCode(parseInt(text.substring(start2 + 2, pos), 16));
9068
+ // when encountering a LineContinuation (i.e. a backslash and a line terminator sequence),
9069
+ // the line terminator is interpreted to be "the empty code unit sequence".
9056
9070
  case 13 /* carriageReturn */:
9057
9071
  if (pos < end && charCodeUnchecked(pos) === 10 /* lineFeed */) {
9058
9072
  pos++;
9059
9073
  }
9074
+ // falls through
9060
9075
  case 10 /* lineFeed */:
9061
9076
  case 8232 /* lineSeparator */:
9062
9077
  case 8233 /* paragraphSeparator */:
@@ -9487,6 +9502,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
9487
9502
  tokenFlags |= 256 /* OctalSpecifier */;
9488
9503
  return token = checkBigIntSuffix();
9489
9504
  }
9505
+ // falls through
9490
9506
  case 49 /* _1 */:
9491
9507
  case 50 /* _2 */:
9492
9508
  case 51 /* _3 */:
@@ -10006,6 +10022,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
10006
10022
  break;
10007
10023
  }
10008
10024
  }
10025
+ // falls through
10009
10026
  case 42 /* asterisk */:
10010
10027
  case 43 /* plus */:
10011
10028
  case 63 /* question */:
@@ -10036,6 +10053,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
10036
10053
  if (isInGroup) {
10037
10054
  return;
10038
10055
  }
10056
+ // falls through
10039
10057
  case 93 /* closeBracket */:
10040
10058
  case 125 /* closeBrace */:
10041
10059
  if (anyUnicodeModeOrNonAnnexB || ch === 41 /* closeParen */) {
@@ -10098,6 +10116,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
10098
10116
  error(Diagnostics.q_is_only_available_inside_character_class, pos - 2, 2);
10099
10117
  break;
10100
10118
  }
10119
+ // falls through
10101
10120
  default:
10102
10121
  Debug.assert(scanCharacterClassEscape() || scanDecimalEscape() || scanCharacterEscape(
10103
10122
  /*atomEscape*/
@@ -10235,6 +10254,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
10235
10254
  let start2 = pos;
10236
10255
  let operand;
10237
10256
  switch (text.slice(pos, pos + 2)) {
10257
+ // TODO: don't use slice
10238
10258
  case "--":
10239
10259
  case "&&":
10240
10260
  error(Diagnostics.Expected_a_class_set_operand);
@@ -10340,6 +10360,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
10340
10360
  }
10341
10361
  start2 = pos;
10342
10362
  switch (text.slice(pos, pos + 2)) {
10363
+ // TODO: don't use slice
10343
10364
  case "--":
10344
10365
  case "&&":
10345
10366
  error(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos, 2);
@@ -10437,6 +10458,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
10437
10458
  }
10438
10459
  }
10439
10460
  pos--;
10461
+ // falls through
10440
10462
  default:
10441
10463
  return scanClassSetCharacter();
10442
10464
  }
@@ -10583,6 +10605,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
10583
10605
  return true;
10584
10606
  case 80 /* P */:
10585
10607
  isCharacterComplement = true;
10608
+ // falls through
10586
10609
  case 112 /* p */:
10587
10610
  pos++;
10588
10611
  if (charCodeChecked(pos) === 123 /* openBrace */) {
@@ -10890,6 +10913,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
10890
10913
  if (charCodeUnchecked(pos) === 10 /* lineFeed */) {
10891
10914
  pos++;
10892
10915
  }
10916
+ // falls through
10893
10917
  case 10 /* lineFeed */:
10894
10918
  tokenFlags |= 1 /* PrecedingLineBreak */;
10895
10919
  return token = 4 /* NewLineTrivia */;
@@ -11094,28 +11118,33 @@ function isExternalModuleNameRelative(moduleName) {
11094
11118
  function sortAndDeduplicateDiagnostics(diagnostics) {
11095
11119
  return sortAndDeduplicate(diagnostics, compareDiagnostics, diagnosticsEqualityComparer);
11096
11120
  }
11121
+ var targetToLibMap = /* @__PURE__ */ new Map([
11122
+ [99 /* ESNext */, "lib.esnext.full.d.ts"],
11123
+ [10 /* ES2023 */, "lib.es2023.full.d.ts"],
11124
+ [9 /* ES2022 */, "lib.es2022.full.d.ts"],
11125
+ [8 /* ES2021 */, "lib.es2021.full.d.ts"],
11126
+ [7 /* ES2020 */, "lib.es2020.full.d.ts"],
11127
+ [6 /* ES2019 */, "lib.es2019.full.d.ts"],
11128
+ [5 /* ES2018 */, "lib.es2018.full.d.ts"],
11129
+ [4 /* ES2017 */, "lib.es2017.full.d.ts"],
11130
+ [3 /* ES2016 */, "lib.es2016.full.d.ts"],
11131
+ [2 /* ES2015 */, "lib.es6.d.ts"]
11132
+ // We don't use lib.es2015.full.d.ts due to breaking change.
11133
+ ]);
11097
11134
  function getDefaultLibFileName(options) {
11098
- switch (getEmitScriptTarget(options)) {
11135
+ const target = getEmitScriptTarget(options);
11136
+ switch (target) {
11099
11137
  case 99 /* ESNext */:
11100
- return "lib.esnext.full.d.ts";
11101
11138
  case 10 /* ES2023 */:
11102
- return "lib.es2023.full.d.ts";
11103
11139
  case 9 /* ES2022 */:
11104
- return "lib.es2022.full.d.ts";
11105
11140
  case 8 /* ES2021 */:
11106
- return "lib.es2021.full.d.ts";
11107
11141
  case 7 /* ES2020 */:
11108
- return "lib.es2020.full.d.ts";
11109
11142
  case 6 /* ES2019 */:
11110
- return "lib.es2019.full.d.ts";
11111
11143
  case 5 /* ES2018 */:
11112
- return "lib.es2018.full.d.ts";
11113
11144
  case 4 /* ES2017 */:
11114
- return "lib.es2017.full.d.ts";
11115
11145
  case 3 /* ES2016 */:
11116
- return "lib.es2016.full.d.ts";
11117
11146
  case 2 /* ES2015 */:
11118
- return "lib.es6.d.ts";
11147
+ return targetToLibMap.get(target);
11119
11148
  default:
11120
11149
  return "lib.d.ts";
11121
11150
  }
@@ -11915,7 +11944,7 @@ function isModifierLike(node) {
11915
11944
  }
11916
11945
  function isTypeElement(node) {
11917
11946
  const kind = node.kind;
11918
- return kind === 180 /* ConstructSignature */ || kind === 179 /* CallSignature */ || kind === 171 /* PropertySignature */ || kind === 173 /* MethodSignature */ || kind === 181 /* IndexSignature */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */;
11947
+ return kind === 180 /* ConstructSignature */ || kind === 179 /* CallSignature */ || kind === 171 /* PropertySignature */ || kind === 173 /* MethodSignature */ || kind === 181 /* IndexSignature */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 354 /* NotEmittedTypeElement */;
11919
11948
  }
11920
11949
  function isObjectLiteralElementLike(node) {
11921
11950
  const kind = node.kind;
@@ -11974,7 +12003,9 @@ function isObjectBindingOrAssignmentElement(node) {
11974
12003
  switch (node.kind) {
11975
12004
  case 208 /* BindingElement */:
11976
12005
  case 303 /* PropertyAssignment */:
12006
+ // AssignmentProperty
11977
12007
  case 304 /* ShorthandPropertyAssignment */:
12008
+ // AssignmentProperty
11978
12009
  case 305 /* SpreadAssignment */:
11979
12010
  return true;
11980
12011
  }
@@ -11992,11 +12023,17 @@ function isArrayBindingOrAssignmentElement(node) {
11992
12023
  switch (node.kind) {
11993
12024
  case 208 /* BindingElement */:
11994
12025
  case 232 /* OmittedExpression */:
12026
+ // Elision
11995
12027
  case 230 /* SpreadElement */:
12028
+ // AssignmentRestElement
11996
12029
  case 209 /* ArrayLiteralExpression */:
12030
+ // ArrayAssignmentPattern
11997
12031
  case 210 /* ObjectLiteralExpression */:
12032
+ // ObjectAssignmentPattern
11998
12033
  case 80 /* Identifier */:
12034
+ // DestructuringAssignmentTarget
11999
12035
  case 211 /* PropertyAccessExpression */:
12036
+ // DestructuringAssignmentTarget
12000
12037
  case 212 /* ElementAccessExpression */:
12001
12038
  return true;
12002
12039
  }
@@ -12057,6 +12094,7 @@ function isLeftHandSideExpressionKind(kind) {
12057
12094
  case 218 /* FunctionExpression */:
12058
12095
  case 80 /* Identifier */:
12059
12096
  case 81 /* PrivateIdentifier */:
12097
+ // technically this is only an Expression if it's in a `#field in expr` BinaryExpression
12060
12098
  case 14 /* RegularExpressionLiteral */:
12061
12099
  case 9 /* NumericLiteral */:
12062
12100
  case 10 /* BigIntLiteral */:
@@ -12072,6 +12110,7 @@ function isLeftHandSideExpressionKind(kind) {
12072
12110
  case 233 /* ExpressionWithTypeArguments */:
12073
12111
  case 236 /* MetaProperty */:
12074
12112
  case 102 /* ImportKeyword */:
12113
+ // technically this is only an Expression if it's in a CallExpression
12075
12114
  case 282 /* MissingDeclaration */:
12076
12115
  return true;
12077
12116
  default:
@@ -12118,8 +12157,8 @@ function isExpressionKind(kind) {
12118
12157
  case 230 /* SpreadElement */:
12119
12158
  case 234 /* AsExpression */:
12120
12159
  case 232 /* OmittedExpression */:
12121
- case 355 /* CommaListExpression */:
12122
- case 354 /* PartiallyEmittedExpression */:
12160
+ case 356 /* CommaListExpression */:
12161
+ case 355 /* PartiallyEmittedExpression */:
12123
12162
  case 238 /* SatisfiesExpression */:
12124
12163
  return true;
12125
12164
  default:
@@ -13738,6 +13777,8 @@ function getErrorSpanForNode(sourceFile, node) {
13738
13777
  }
13739
13778
  return getSpanOfTokenAtPosition(sourceFile, pos2);
13740
13779
  }
13780
+ // This list is a work in progress. Add missing node kinds to improve their error
13781
+ // spans.
13741
13782
  case 260 /* VariableDeclaration */:
13742
13783
  case 208 /* BindingElement */:
13743
13784
  case 263 /* ClassDeclaration */:
@@ -13909,6 +13950,8 @@ function isPartOfTypeNode(node) {
13909
13950
  return isPartOfTypeExpressionWithTypeArguments(node);
13910
13951
  case 168 /* TypeParameter */:
13911
13952
  return node.parent.kind === 200 /* MappedType */ || node.parent.kind === 195 /* InferType */;
13953
+ // Identifiers and qualified names may be type nodes, depending on their context. Climb
13954
+ // above them to find the lowest container
13912
13955
  case 80 /* Identifier */:
13913
13956
  if (node.parent.kind === 166 /* QualifiedName */ && node.parent.right === node) {
13914
13957
  node = node.parent;
@@ -13916,6 +13959,7 @@ function isPartOfTypeNode(node) {
13916
13959
  node = node.parent;
13917
13960
  }
13918
13961
  Debug.assert(node.kind === 80 /* Identifier */ || node.kind === 166 /* QualifiedName */ || node.kind === 211 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'.");
13962
+ // falls through
13919
13963
  case 166 /* QualifiedName */:
13920
13964
  case 211 /* PropertyAccessExpression */:
13921
13965
  case 110 /* ThisKeyword */: {
@@ -14181,6 +14225,7 @@ function getThisContainer(node, includeArrowFunctions, includeClassComputedPrope
14181
14225
  if (!includeArrowFunctions) {
14182
14226
  continue;
14183
14227
  }
14228
+ // falls through
14184
14229
  case 262 /* FunctionDeclaration */:
14185
14230
  case 218 /* FunctionExpression */:
14186
14231
  case 267 /* ModuleDeclaration */:
@@ -14203,6 +14248,8 @@ function getThisContainer(node, includeArrowFunctions, includeClassComputedPrope
14203
14248
  }
14204
14249
  function isThisContainerOrFunctionBlock(node) {
14205
14250
  switch (node.kind) {
14251
+ // Arrow functions use the same scope, but may do so in a "delayed" manner
14252
+ // For example, `const getThis = () => this` may be before a super() call in a derived constructor
14206
14253
  case 219 /* ArrowFunction */:
14207
14254
  case 262 /* FunctionDeclaration */:
14208
14255
  case 218 /* FunctionExpression */:
@@ -14269,6 +14316,7 @@ function getSuperContainer(node, stopOnFunctions) {
14269
14316
  if (!stopOnFunctions) {
14270
14317
  continue;
14271
14318
  }
14319
+ // falls through
14272
14320
  case 172 /* PropertyDeclaration */:
14273
14321
  case 171 /* PropertySignature */:
14274
14322
  case 174 /* MethodDeclaration */:
@@ -14322,6 +14370,7 @@ function getEntityNameFromTypeNode(node) {
14322
14370
  return node.typeName;
14323
14371
  case 233 /* ExpressionWithTypeArguments */:
14324
14372
  return isEntityNameExpression(node.expression) ? node.expression : void 0;
14373
+ // TODO(rbuckton): These aren't valid TypeNodes, but we treat them as such because of `isPartOfTypeNode`, which returns `true` for things that aren't `TypeNode`s.
14325
14374
  case 80 /* Identifier */:
14326
14375
  case 166 /* QualifiedName */:
14327
14376
  return node;
@@ -14486,6 +14535,7 @@ function isExpressionNode(node) {
14486
14535
  if (node.parent.kind === 186 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node)) {
14487
14536
  return true;
14488
14537
  }
14538
+ // falls through
14489
14539
  case 9 /* NumericLiteral */:
14490
14540
  case 10 /* BigIntLiteral */:
14491
14541
  case 11 /* StringLiteral */:
@@ -15490,6 +15540,7 @@ function getFunctionFlags(node) {
15490
15540
  if (node.asteriskToken) {
15491
15541
  flags |= 1 /* Generator */;
15492
15542
  }
15543
+ // falls through
15493
15544
  case 219 /* ArrowFunction */:
15494
15545
  if (hasSyntacticModifier(node, 1024 /* Async */)) {
15495
15546
  flags |= 2 /* Async */;
@@ -15724,7 +15775,7 @@ function getOperator(expression) {
15724
15775
  }
15725
15776
  function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
15726
15777
  switch (nodeKind) {
15727
- case 355 /* CommaListExpression */:
15778
+ case 356 /* CommaListExpression */:
15728
15779
  return 0 /* Comma */;
15729
15780
  case 230 /* SpreadElement */:
15730
15781
  return 1 /* Spread */;
@@ -15756,6 +15807,7 @@ function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
15756
15807
  default:
15757
15808
  return getBinaryOperatorPrecedence(operatorKind);
15758
15809
  }
15810
+ // TODO: Should prefix `++` and `--` be moved to the `Update` precedence?
15759
15811
  case 216 /* TypeAssertionExpression */:
15760
15812
  case 235 /* NonNullExpression */:
15761
15813
  case 224 /* PrefixUnaryExpression */:
@@ -17254,11 +17306,12 @@ function getLeftmostExpression(node, stopAtCallExpressions) {
17254
17306
  if (stopAtCallExpressions) {
17255
17307
  return node;
17256
17308
  }
17309
+ // falls through
17257
17310
  case 234 /* AsExpression */:
17258
17311
  case 212 /* ElementAccessExpression */:
17259
17312
  case 211 /* PropertyAccessExpression */:
17260
17313
  case 235 /* NonNullExpression */:
17261
- case 354 /* PartiallyEmittedExpression */:
17314
+ case 355 /* PartiallyEmittedExpression */:
17262
17315
  case 238 /* SatisfiesExpression */:
17263
17316
  node = node.expression;
17264
17317
  continue;
@@ -18398,8 +18451,33 @@ function tryParsePattern(pattern) {
18398
18451
  suffix: pattern.substr(indexOfStar + 1)
18399
18452
  };
18400
18453
  }
18454
+ var parsedPatternsCache = /* @__PURE__ */ new WeakMap();
18401
18455
  function tryParsePatterns(paths) {
18402
- return mapDefined(getOwnKeys(paths), (path) => tryParsePattern(path));
18456
+ let result = parsedPatternsCache.get(paths);
18457
+ if (result !== void 0) {
18458
+ return result;
18459
+ }
18460
+ let matchableStringSet;
18461
+ let patterns;
18462
+ const pathList = getOwnKeys(paths);
18463
+ for (const path of pathList) {
18464
+ const patternOrStr = tryParsePattern(path);
18465
+ if (patternOrStr === void 0) {
18466
+ continue;
18467
+ } else if (typeof patternOrStr === "string") {
18468
+ (matchableStringSet ?? (matchableStringSet = /* @__PURE__ */ new Set())).add(patternOrStr);
18469
+ } else {
18470
+ (patterns ?? (patterns = [])).push(patternOrStr);
18471
+ }
18472
+ }
18473
+ parsedPatternsCache.set(
18474
+ paths,
18475
+ result = {
18476
+ matchableStringSet,
18477
+ patterns
18478
+ }
18479
+ );
18480
+ return result;
18403
18481
  }
18404
18482
  function positionIsSynthesized(pos) {
18405
18483
  return !(pos >= 0);
@@ -18424,15 +18502,13 @@ var emptyFileSystemEntries = {
18424
18502
  files: emptyArray,
18425
18503
  directories: emptyArray
18426
18504
  };
18427
- function matchPatternOrExact(patternOrStrings, candidate) {
18428
- const patterns = [];
18429
- for (const patternOrString of patternOrStrings) {
18430
- if (patternOrString === candidate) {
18431
- return candidate;
18432
- }
18433
- if (!isString(patternOrString)) {
18434
- patterns.push(patternOrString);
18435
- }
18505
+ function matchPatternOrExact(parsedPatterns, candidate) {
18506
+ const { matchableStringSet, patterns } = parsedPatterns;
18507
+ if (matchableStringSet == null ? void 0 : matchableStringSet.has(candidate)) {
18508
+ return candidate;
18509
+ }
18510
+ if (patterns === void 0 || patterns.length === 0) {
18511
+ return void 0;
18436
18512
  }
18437
18513
  return findBestPatternMatch(patterns, (_) => _, candidate);
18438
18514
  }
@@ -18509,6 +18585,7 @@ function isJsonEqual(a, b) {
18509
18585
  function parsePseudoBigInt(stringValue) {
18510
18586
  let log2Base;
18511
18587
  switch (stringValue.charCodeAt(1)) {
18588
+ // "x" in "0x123"
18512
18589
  case 98 /* b */:
18513
18590
  case 66 /* B */:
18514
18591
  log2Base = 1;
@@ -18746,7 +18823,7 @@ function getContainingNodeArray(node) {
18746
18823
  return parent.types;
18747
18824
  case 189 /* TupleType */:
18748
18825
  case 209 /* ArrayLiteralExpression */:
18749
- case 355 /* CommaListExpression */:
18826
+ case 356 /* CommaListExpression */:
18750
18827
  case 275 /* NamedImports */:
18751
18828
  case 279 /* NamedExports */:
18752
18829
  return parent.elements;
@@ -19179,6 +19256,7 @@ function createNameResolver({
19179
19256
  switch (location.kind) {
19180
19257
  case 307 /* SourceFile */:
19181
19258
  if (!isExternalOrCommonJsModule(location)) break;
19259
+ // falls through
19182
19260
  case 267 /* ModuleDeclaration */:
19183
19261
  const moduleExports = ((_a = getSymbolOfDeclaration(location)) == null ? void 0 : _a.exports) || emptySymbols;
19184
19262
  if (location.kind === 307 /* SourceFile */ || isModuleDeclaration(location) && location.flags & 33554432 /* Ambient */ && !isGlobalScopeAugmentation(location)) {
@@ -19262,6 +19340,14 @@ function createNameResolver({
19262
19340
  }
19263
19341
  }
19264
19342
  break;
19343
+ // It is not legal to reference a class's own type parameters from a computed property name that
19344
+ // belongs to the class. For example:
19345
+ //
19346
+ // function foo<T>() { return '' }
19347
+ // class C<T> { // <-- Class's own type parameter T
19348
+ // [foo<T>()]() { } // <-- Reference to T from class's own computed property
19349
+ // }
19350
+ //
19265
19351
  case 167 /* ComputedPropertyName */:
19266
19352
  grandparent = location.parent.parent;
19267
19353
  if (isClassLike(grandparent) || grandparent.kind === 264 /* InterfaceDeclaration */) {
@@ -19277,6 +19363,7 @@ function createNameResolver({
19277
19363
  if (getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */) {
19278
19364
  break;
19279
19365
  }
19366
+ // falls through
19280
19367
  case 174 /* MethodDeclaration */:
19281
19368
  case 176 /* Constructor */:
19282
19369
  case 177 /* GetAccessor */:
@@ -19921,6 +20008,7 @@ function createParenthesizerRules(factory2) {
19921
20008
  function parenthesizeConstituentTypeOfUnionType(type) {
19922
20009
  switch (type.kind) {
19923
20010
  case 192 /* UnionType */:
20011
+ // Not strictly necessary, but a union containing a union should have been flattened
19924
20012
  case 193 /* IntersectionType */:
19925
20013
  return factory2.createParenthesizedType(type);
19926
20014
  }
@@ -20691,6 +20779,7 @@ function createNodeFactory(flags, baseFactory2) {
20691
20779
  createSyntheticExpression,
20692
20780
  createSyntaxList,
20693
20781
  createNotEmittedStatement,
20782
+ createNotEmittedTypeElement,
20694
20783
  createPartiallyEmittedExpression,
20695
20784
  updatePartiallyEmittedExpression,
20696
20785
  createCommaListExpression,
@@ -23717,7 +23806,7 @@ function createNodeFactory(flags, baseFactory2) {
23717
23806
  return node;
23718
23807
  }
23719
23808
  function createPartiallyEmittedExpression(expression, original) {
23720
- const node = createBaseNode(354 /* PartiallyEmittedExpression */);
23809
+ const node = createBaseNode(355 /* PartiallyEmittedExpression */);
23721
23810
  node.expression = expression;
23722
23811
  node.original = original;
23723
23812
  node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
@@ -23727,6 +23816,9 @@ function createNodeFactory(flags, baseFactory2) {
23727
23816
  function updatePartiallyEmittedExpression(node, expression) {
23728
23817
  return node.expression !== expression ? update(createPartiallyEmittedExpression(expression, node.original), node) : node;
23729
23818
  }
23819
+ function createNotEmittedTypeElement() {
23820
+ return createBaseNode(354 /* NotEmittedTypeElement */);
23821
+ }
23730
23822
  function flattenCommaElements(node) {
23731
23823
  if (nodeIsSynthesized(node) && !isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) {
23732
23824
  if (isCommaListExpression(node)) {
@@ -23739,7 +23831,7 @@ function createNodeFactory(flags, baseFactory2) {
23739
23831
  return node;
23740
23832
  }
23741
23833
  function createCommaListExpression(elements) {
23742
- const node = createBaseNode(355 /* CommaListExpression */);
23834
+ const node = createBaseNode(356 /* CommaListExpression */);
23743
23835
  node.elements = createNodeArray(sameFlatMap(elements, flattenCommaElements));
23744
23836
  node.transformFlags |= propagateChildrenFlags(node.elements);
23745
23837
  return node;
@@ -23748,7 +23840,7 @@ function createNodeFactory(flags, baseFactory2) {
23748
23840
  return node.elements !== elements ? update(createCommaListExpression(elements), node) : node;
23749
23841
  }
23750
23842
  function createSyntheticReferenceExpression(expression, thisArg) {
23751
- const node = createBaseNode(356 /* SyntheticReferenceExpression */);
23843
+ const node = createBaseNode(357 /* SyntheticReferenceExpression */);
23752
23844
  node.expression = expression;
23753
23845
  node.thisArg = thisArg;
23754
23846
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg);
@@ -23995,7 +24087,7 @@ function createNodeFactory(flags, baseFactory2) {
23995
24087
  return updateNonNullExpression(outerExpression, expression);
23996
24088
  case 233 /* ExpressionWithTypeArguments */:
23997
24089
  return updateExpressionWithTypeArguments(outerExpression, expression, outerExpression.typeArguments);
23998
- case 354 /* PartiallyEmittedExpression */:
24090
+ case 355 /* PartiallyEmittedExpression */:
23999
24091
  return updatePartiallyEmittedExpression(outerExpression, expression);
24000
24092
  }
24001
24093
  }
@@ -24540,7 +24632,7 @@ function getTransformFlagsSubtreeExclusions(kind) {
24540
24632
  case 216 /* TypeAssertionExpression */:
24541
24633
  case 238 /* SatisfiesExpression */:
24542
24634
  case 234 /* AsExpression */:
24543
- case 354 /* PartiallyEmittedExpression */:
24635
+ case 355 /* PartiallyEmittedExpression */:
24544
24636
  case 217 /* ParenthesizedExpression */:
24545
24637
  case 108 /* SuperKeyword */:
24546
24638
  return -2147483648 /* OuterExpressionExcludes */;
@@ -26181,10 +26273,10 @@ function isMetaProperty(node) {
26181
26273
  return node.kind === 236 /* MetaProperty */;
26182
26274
  }
26183
26275
  function isPartiallyEmittedExpression(node) {
26184
- return node.kind === 354 /* PartiallyEmittedExpression */;
26276
+ return node.kind === 355 /* PartiallyEmittedExpression */;
26185
26277
  }
26186
26278
  function isCommaListExpression(node) {
26187
- return node.kind === 355 /* CommaListExpression */;
26279
+ return node.kind === 356 /* CommaListExpression */;
26188
26280
  }
26189
26281
  function isTemplateSpan(node) {
26190
26282
  return node.kind === 239 /* TemplateSpan */;
@@ -26313,7 +26405,7 @@ function isNotEmittedStatement(node) {
26313
26405
  return node.kind === 353 /* NotEmittedStatement */;
26314
26406
  }
26315
26407
  function isSyntheticReference(node) {
26316
- return node.kind === 356 /* SyntheticReferenceExpression */;
26408
+ return node.kind === 357 /* SyntheticReferenceExpression */;
26317
26409
  }
26318
26410
  function isExternalModuleReference(node) {
26319
26411
  return node.kind === 283 /* ExternalModuleReference */;
@@ -26894,7 +26986,7 @@ function isOuterExpression(node, kinds = 31 /* All */) {
26894
26986
  return (kinds & 16 /* ExpressionsWithTypeArguments */) !== 0;
26895
26987
  case 235 /* NonNullExpression */:
26896
26988
  return (kinds & 4 /* NonNullAssertions */) !== 0;
26897
- case 354 /* PartiallyEmittedExpression */:
26989
+ case 355 /* PartiallyEmittedExpression */:
26898
26990
  return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0;
26899
26991
  }
26900
26992
  return false;
@@ -27334,10 +27426,13 @@ var BinaryExpressionState;
27334
27426
  switch (currentState) {
27335
27427
  case enter:
27336
27428
  if (machine.onLeft) return left;
27429
+ // falls through
27337
27430
  case left:
27338
27431
  if (machine.onOperator) return operator;
27432
+ // falls through
27339
27433
  case operator:
27340
27434
  if (machine.onRight) return right;
27435
+ // falls through
27341
27436
  case right:
27342
27437
  return exit;
27343
27438
  case exit:
@@ -27965,7 +28060,7 @@ var forEachChildTable = {
27965
28060
  [282 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) {
27966
28061
  return visitNodes(cbNode, cbNodes, node.modifiers);
27967
28062
  },
27968
- [355 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
28063
+ [356 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
27969
28064
  return visitNodes(cbNode, cbNodes, node.elements);
27970
28065
  },
27971
28066
  [284 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) {
@@ -28061,7 +28156,7 @@ var forEachChildTable = {
28061
28156
  [331 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag,
28062
28157
  [337 /* JSDocOverrideTag */]: forEachChildInJSDocTag,
28063
28158
  [351 /* JSDocImportTag */]: forEachChildInJSDocImportTag,
28064
- [354 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
28159
+ [355 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
28065
28160
  };
28066
28161
  function forEachChildInCallOrConstructSignature(node, cbNode, cbNodes) {
28067
28162
  return visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
@@ -28416,6 +28511,7 @@ var Parser;
28416
28511
  expression2 = parseLiteralNode();
28417
28512
  break;
28418
28513
  }
28514
+ // falls through
28419
28515
  default:
28420
28516
  expression2 = parseObjectLiteralExpression();
28421
28517
  break;
@@ -29337,6 +29433,7 @@ var Parser;
29337
29433
  case 25 /* DotToken */:
29338
29434
  return true;
29339
29435
  }
29436
+ // falls through
29340
29437
  case 11 /* ArgumentExpressions */:
29341
29438
  return token() === 26 /* DotDotDotToken */ || isStartOfExpression();
29342
29439
  case 16 /* Parameters */:
@@ -29370,6 +29467,7 @@ var Parser;
29370
29467
  return true;
29371
29468
  case 26 /* Count */:
29372
29469
  return Debug.fail("ParsingContext.Count used as a context");
29470
+ // Not a real context, only a marker.
29373
29471
  default:
29374
29472
  Debug.assertNever(parsingContext2, "Non-exhaustive case in 'isListElement'.");
29375
29473
  }
@@ -29686,6 +29784,7 @@ var Parser;
29686
29784
  case 3 /* SwitchClauseStatements */:
29687
29785
  return parseErrorAtCurrentToken(Diagnostics.Statement_expected);
29688
29786
  case 18 /* RestProperties */:
29787
+ // fallthrough
29689
29788
  case 4 /* TypeMembers */:
29690
29789
  return parseErrorAtCurrentToken(Diagnostics.Property_or_signature_expected);
29691
29790
  case 5 /* ClassMembers */:
@@ -29733,6 +29832,7 @@ var Parser;
29733
29832
  return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
29734
29833
  case 26 /* Count */:
29735
29834
  return Debug.fail("ParsingContext.Count used as a context");
29835
+ // Not a real context, only a marker.
29736
29836
  default:
29737
29837
  Debug.assertNever(context);
29738
29838
  }
@@ -30657,10 +30757,12 @@ var Parser;
30657
30757
  return tryParse(parseKeywordAndNoDot) || parseTypeReference();
30658
30758
  case 67 /* AsteriskEqualsToken */:
30659
30759
  scanner.reScanAsteriskEqualsToken();
30760
+ // falls through
30660
30761
  case 42 /* AsteriskToken */:
30661
30762
  return parseJSDocAllType();
30662
30763
  case 61 /* QuestionQuestionToken */:
30663
30764
  scanner.reScanQuestionToken();
30765
+ // falls through
30664
30766
  case 58 /* QuestionToken */:
30665
30767
  return parseJSDocUnknownOrNullableType();
30666
30768
  case 100 /* FunctionKeyword */:
@@ -31538,6 +31640,7 @@ var Parser;
31538
31640
  if (isAwaitExpression2()) {
31539
31641
  return parseAwaitExpression();
31540
31642
  }
31643
+ // falls through
31541
31644
  default:
31542
31645
  return parseUpdateExpression();
31543
31646
  }
@@ -31557,6 +31660,8 @@ var Parser;
31557
31660
  if (languageVariant !== 1 /* JSX */) {
31558
31661
  return false;
31559
31662
  }
31663
+ // We are in JSX context and the token is part of JSXElement.
31664
+ // falls through
31560
31665
  default:
31561
31666
  return true;
31562
31667
  }
@@ -32130,10 +32235,16 @@ var Parser;
32130
32235
  }
32131
32236
  function canFollowTypeArgumentsInExpression() {
32132
32237
  switch (token()) {
32238
+ // These tokens can follow a type argument list in a call expression.
32133
32239
  case 21 /* OpenParenToken */:
32240
+ // foo<x>(
32134
32241
  case 15 /* NoSubstitutionTemplateLiteral */:
32242
+ // foo<T> `...`
32135
32243
  case 16 /* TemplateHead */:
32136
32244
  return true;
32245
+ // A type argument list followed by `<` never makes sense, and a type argument list followed
32246
+ // by `>` is ambiguous with a (re-scanned) `>>` operator, so we disqualify both. Also, in
32247
+ // this context, `+` and `-` are unary operators, not binary operators.
32137
32248
  case 30 /* LessThanToken */:
32138
32249
  case 32 /* GreaterThanToken */:
32139
32250
  case 40 /* PlusToken */:
@@ -32151,6 +32262,7 @@ var Parser;
32151
32262
  false
32152
32263
  );
32153
32264
  }
32265
+ // falls through
32154
32266
  case 9 /* NumericLiteral */:
32155
32267
  case 10 /* BigIntLiteral */:
32156
32268
  case 11 /* StringLiteral */:
@@ -32654,6 +32766,27 @@ var Parser;
32654
32766
  return isUsingDeclaration();
32655
32767
  case 135 /* AwaitKeyword */:
32656
32768
  return isAwaitUsingDeclaration();
32769
+ // 'declare', 'module', 'namespace', 'interface'* and 'type' are all legal JavaScript identifiers;
32770
+ // however, an identifier cannot be followed by another identifier on the same line. This is what we
32771
+ // count on to parse out the respective declarations. For instance, we exploit this to say that
32772
+ //
32773
+ // namespace n
32774
+ //
32775
+ // can be none other than the beginning of a namespace declaration, but need to respect that JavaScript sees
32776
+ //
32777
+ // namespace
32778
+ // n
32779
+ //
32780
+ // as the identifier 'namespace' on one line followed by the identifier 'n' on another.
32781
+ // We need to look one token ahead to see if it permissible to try parsing a declaration.
32782
+ //
32783
+ // *Note*: 'interface' is actually a strict mode reserved word. So while
32784
+ //
32785
+ // "use strict"
32786
+ // interface
32787
+ // I {}
32788
+ //
32789
+ // could be legal, it would add complexity for very little gain.
32657
32790
  case 120 /* InterfaceKeyword */:
32658
32791
  case 156 /* TypeKeyword */:
32659
32792
  return nextTokenIsIdentifierOnSameLine();
@@ -32726,6 +32859,9 @@ var Parser;
32726
32859
  case 111 /* ThrowKeyword */:
32727
32860
  case 113 /* TryKeyword */:
32728
32861
  case 89 /* DebuggerKeyword */:
32862
+ // 'catch' and 'finally' do not actually indicate that the code is part of a statement,
32863
+ // however, we say they are here so that we may gracefully parse them and error later.
32864
+ // falls through
32729
32865
  case 85 /* CatchKeyword */:
32730
32866
  case 98 /* FinallyKeyword */:
32731
32867
  return true;
@@ -32864,6 +33000,8 @@ var Parser;
32864
33000
  case 111 /* ThrowKeyword */:
32865
33001
  return parseThrowStatement();
32866
33002
  case 113 /* TryKeyword */:
33003
+ // Include 'catch' and 'finally' for error recovery.
33004
+ // falls through
32867
33005
  case 85 /* CatchKeyword */:
32868
33006
  case 98 /* FinallyKeyword */:
32869
33007
  return parseTryStatement();
@@ -33282,10 +33420,15 @@ var Parser;
33282
33420
  }
33283
33421
  switch (token()) {
33284
33422
  case 21 /* OpenParenToken */:
33423
+ // Method declaration
33285
33424
  case 30 /* LessThanToken */:
33425
+ // Generic Method declaration
33286
33426
  case 54 /* ExclamationToken */:
33427
+ // Non-null assertion on property name
33287
33428
  case 59 /* ColonToken */:
33429
+ // Type Annotation for declaration
33288
33430
  case 64 /* EqualsToken */:
33431
+ // Initializer for declaration
33289
33432
  case 58 /* QuestionToken */:
33290
33433
  return true;
33291
33434
  default:
@@ -34192,6 +34335,7 @@ var Parser;
34192
34335
  linkEnd = scanner.getTokenEnd();
34193
34336
  break;
34194
34337
  }
34338
+ // fallthrough if it's not a {@link sequence
34195
34339
  default:
34196
34340
  state = 2 /* SavingComments */;
34197
34341
  pushComment(scanner.getTokenText());
@@ -34450,6 +34594,8 @@ var Parser;
34450
34594
  indent2 += 1;
34451
34595
  break;
34452
34596
  }
34597
+ // record the * as a comment
34598
+ // falls through
34453
34599
  default:
34454
34600
  if (state !== 3 /* SavingBackticks */) {
34455
34601
  state = 2 /* SavingComments */;
@@ -35530,6 +35676,7 @@ function processPragmasIntoFields(context, reportDiagnostic) {
35530
35676
  case "jsximportsource":
35531
35677
  case "jsxruntime":
35532
35678
  return;
35679
+ // Accessed directly
35533
35680
  default:
35534
35681
  Debug.fail("Unhandled pragma kind");
35535
35682
  }
@@ -37383,6 +37530,7 @@ function parseOptionValue(args, i, diagnostics, opt, options, errors) {
37383
37530
  case "listOrElement":
37384
37531
  Debug.fail("listOrElement not supported here");
37385
37532
  break;
37533
+ // If not a primitive, the possible types are specified in what is effectively a map of options.
37386
37534
  default:
37387
37535
  options[opt.name] = parseCustomTypeOption(opt, args[i], errors);
37388
37536
  i++;
@@ -37716,6 +37864,7 @@ function convertToJson(sourceFile, rootExpression, errors, returnValue, jsonConv
37716
37864
  return false;
37717
37865
  case 106 /* NullKeyword */:
37718
37866
  return null;
37867
+ // eslint-disable-line no-restricted-syntax
37719
37868
  case 11 /* StringLiteral */:
37720
37869
  if (!isDoubleQuotedString(valueExpression)) {
37721
37870
  errors.push(createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, Diagnostics.String_literal_with_double_quotes_expected));
@@ -38180,8 +38329,6 @@ function parseJsonConfigFileContentWorker(json, sourceFile, host, basePath, exis
38180
38329
  validatedFilesSpecBeforeSubstitution,
38181
38330
  validatedIncludeSpecsBeforeSubstitution,
38182
38331
  validatedExcludeSpecsBeforeSubstitution,
38183
- pathPatterns: void 0,
38184
- // Initialized on first use
38185
38332
  isDefaultIncludeSpec
38186
38333
  };
38187
38334
  }
@@ -39806,8 +39953,7 @@ function tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, co
39806
39953
  }
39807
39954
  }
39808
39955
  function tryLoadModuleUsingPathsIfEligible(extensions, moduleName, loader, state) {
39809
- var _a;
39810
- const { baseUrl, paths, configFile } = state.compilerOptions;
39956
+ const { baseUrl, paths } = state.compilerOptions;
39811
39957
  if (paths && !pathIsRelative(moduleName)) {
39812
39958
  if (state.traceEnabled) {
39813
39959
  if (baseUrl) {
@@ -39816,7 +39962,7 @@ function tryLoadModuleUsingPathsIfEligible(extensions, moduleName, loader, state
39816
39962
  trace(state.host, Diagnostics.paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0, moduleName);
39817
39963
  }
39818
39964
  const baseDirectory = getPathsBasePath(state.compilerOptions, state.host);
39819
- const pathPatterns = (configFile == null ? void 0 : configFile.configFileSpecs) ? (_a = configFile.configFileSpecs).pathPatterns || (_a.pathPatterns = tryParsePatterns(paths)) : void 0;
39965
+ const pathPatterns = tryParsePatterns(paths);
39820
39966
  return tryLoadModuleUsingPaths(
39821
39967
  extensions,
39822
39968
  moduleName,
@@ -40488,17 +40634,8 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
40488
40634
  if (state.traceEnabled) {
40489
40635
  trace(state.host, Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, versionPaths.version, version, moduleName);
40490
40636
  }
40491
- const result = tryLoadModuleUsingPaths(
40492
- extensions,
40493
- moduleName,
40494
- candidate,
40495
- versionPaths.paths,
40496
- /*pathPatterns*/
40497
- void 0,
40498
- loader,
40499
- onlyRecordFailuresForPackageFile || onlyRecordFailuresForIndex,
40500
- state
40501
- );
40637
+ const pathPatterns = tryParsePatterns(versionPaths.paths);
40638
+ const result = tryLoadModuleUsingPaths(extensions, moduleName, candidate, versionPaths.paths, pathPatterns, loader, onlyRecordFailuresForPackageFile || onlyRecordFailuresForIndex, state);
40502
40639
  if (result) {
40503
40640
  return removeIgnoredPackageId(result.value);
40504
40641
  }
@@ -41090,17 +41227,8 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, node
41090
41227
  trace(state.host, Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, versionPaths.version, version, rest);
41091
41228
  }
41092
41229
  const packageDirectoryExists = nodeModulesDirectoryExists && directoryProbablyExists(packageDirectory, state.host);
41093
- const fromPaths = tryLoadModuleUsingPaths(
41094
- extensions,
41095
- rest,
41096
- packageDirectory,
41097
- versionPaths.paths,
41098
- /*pathPatterns*/
41099
- void 0,
41100
- loader,
41101
- !packageDirectoryExists,
41102
- state
41103
- );
41230
+ const pathPatterns = tryParsePatterns(versionPaths.paths);
41231
+ const fromPaths = tryLoadModuleUsingPaths(extensions, rest, packageDirectory, versionPaths.paths, pathPatterns, loader, !packageDirectoryExists, state);
41104
41232
  if (fromPaths) {
41105
41233
  return fromPaths.value;
41106
41234
  }
@@ -41108,7 +41236,6 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, node
41108
41236
  return loader(extensions, candidate, !nodeModulesDirectoryExists, state);
41109
41237
  }
41110
41238
  function tryLoadModuleUsingPaths(extensions, moduleName, baseDirectory, paths, pathPatterns, loader, onlyRecordFailures, state) {
41111
- pathPatterns || (pathPatterns = tryParsePatterns(paths));
41112
41239
  const matchedPattern = matchPatternOrExact(pathPatterns, moduleName);
41113
41240
  if (matchedPattern) {
41114
41241
  const matchedStar = isString(matchedPattern) ? void 0 : matchedText(matchedPattern, moduleName);
@@ -41369,20 +41496,24 @@ function getModuleInstanceStateCached(node, visited = /* @__PURE__ */ new Map())
41369
41496
  }
41370
41497
  function getModuleInstanceStateWorker(node, visited) {
41371
41498
  switch (node.kind) {
41499
+ // 1. interface declarations, type alias declarations
41372
41500
  case 264 /* InterfaceDeclaration */:
41373
41501
  case 265 /* TypeAliasDeclaration */:
41374
41502
  return 0 /* NonInstantiated */;
41503
+ // 2. const enum declarations
41375
41504
  case 266 /* EnumDeclaration */:
41376
41505
  if (isEnumConst(node)) {
41377
41506
  return 2 /* ConstEnumOnly */;
41378
41507
  }
41379
41508
  break;
41509
+ // 3. non-exported import declarations
41380
41510
  case 272 /* ImportDeclaration */:
41381
41511
  case 271 /* ImportEqualsDeclaration */:
41382
41512
  if (!hasSyntacticModifier(node, 32 /* Export */)) {
41383
41513
  return 0 /* NonInstantiated */;
41384
41514
  }
41385
41515
  break;
41516
+ // 4. Export alias declarations pointing at only uninstantiated modules or things uninstantiated modules contain
41386
41517
  case 278 /* ExportDeclaration */:
41387
41518
  const exportDeclaration = node;
41388
41519
  if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 279 /* NamedExports */) {
@@ -41399,6 +41530,7 @@ function getModuleInstanceStateWorker(node, visited) {
41399
41530
  return state;
41400
41531
  }
41401
41532
  break;
41533
+ // 5. other uninstantiated module declarations.
41402
41534
  case 268 /* ModuleBlock */: {
41403
41535
  let state = 0 /* NonInstantiated */;
41404
41536
  forEachChild(node, (n) => {
@@ -41997,6 +42129,7 @@ function createBinder() {
41997
42129
  case 351 /* JSDocImportTag */:
41998
42130
  bindJSDocImportTag(node);
41999
42131
  break;
42132
+ // In source files and blocks, bind functions first to match hoisting that occurs at runtime
42000
42133
  case 307 /* SourceFile */: {
42001
42134
  bindEachFunctionsFirst(node.statements);
42002
42135
  bind(node.endOfFileToken);
@@ -42017,6 +42150,7 @@ function createBinder() {
42017
42150
  case 303 /* PropertyAssignment */:
42018
42151
  case 230 /* SpreadElement */:
42019
42152
  inAssignmentPattern = saveInAssignmentPattern;
42153
+ // falls through
42020
42154
  default:
42021
42155
  bindEachChild(node);
42022
42156
  break;
@@ -42038,6 +42172,7 @@ function createBinder() {
42038
42172
  if (isJSDocTypeAssertion(expr)) {
42039
42173
  return false;
42040
42174
  }
42175
+ // fallthrough
42041
42176
  case 235 /* NonNullExpression */:
42042
42177
  return isNarrowingExpression(expr.expression);
42043
42178
  case 226 /* BinaryExpression */:
@@ -42869,6 +43004,10 @@ function createBinder() {
42869
43004
  }
42870
43005
  function declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes) {
42871
43006
  switch (container.kind) {
43007
+ // Modules, source files, and classes need specialized handling for how their
43008
+ // members are declared (for example, a member of a class will go into a specific
43009
+ // symbol table depending on if it is static or not). We defer to specialized
43010
+ // handlers to take care of declaring these child members.
42872
43011
  case 267 /* ModuleDeclaration */:
42873
43012
  return declareModuleMember(node, symbolFlags, symbolExcludes);
42874
43013
  case 307 /* SourceFile */:
@@ -43010,6 +43149,7 @@ function createBinder() {
43010
43149
  declareModuleMember(node, symbolFlags, symbolExcludes);
43011
43150
  break;
43012
43151
  }
43152
+ // falls through
43013
43153
  default:
43014
43154
  Debug.assertNode(blockScopeContainer, canHaveLocals);
43015
43155
  if (!blockScopeContainer.locals) {
@@ -43330,6 +43470,7 @@ function createBinder() {
43330
43470
  }
43331
43471
  function bindWorker(node) {
43332
43472
  switch (node.kind) {
43473
+ /* Strict mode checks */
43333
43474
  case 80 /* Identifier */:
43334
43475
  if (node.flags & 4096 /* IdentifierIsInJSDocNamespace */) {
43335
43476
  let parentNode = node.parent;
@@ -43339,6 +43480,7 @@ function createBinder() {
43339
43480
  bindBlockScopedDeclaration(parentNode, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */);
43340
43481
  break;
43341
43482
  }
43483
+ // falls through
43342
43484
  case 110 /* ThisKeyword */:
43343
43485
  if (currentFlow && (isExpression(node) || parent.kind === 304 /* ShorthandPropertyAssignment */)) {
43344
43486
  node.flowNode = currentFlow;
@@ -43427,6 +43569,7 @@ function createBinder() {
43427
43569
  return;
43428
43570
  case 182 /* TypePredicate */:
43429
43571
  break;
43572
+ // Binding the children will handle everything
43430
43573
  case 168 /* TypeParameter */:
43431
43574
  return bindTypeParameter(node);
43432
43575
  case 169 /* Parameter */:
@@ -43491,6 +43634,7 @@ function createBinder() {
43491
43634
  return bindObjectDefinePrototypeProperty(node);
43492
43635
  case 0 /* None */:
43493
43636
  break;
43637
+ // Nothing to do
43494
43638
  default:
43495
43639
  return Debug.fail("Unknown call expression assignment declaration kind");
43496
43640
  }
@@ -43498,6 +43642,7 @@ function createBinder() {
43498
43642
  bindCallExpression(node);
43499
43643
  }
43500
43644
  break;
43645
+ // Members of classes, interfaces, and modules
43501
43646
  case 231 /* ClassExpression */:
43502
43647
  case 263 /* ClassDeclaration */:
43503
43648
  inStrictMode = true;
@@ -43510,10 +43655,12 @@ function createBinder() {
43510
43655
  return bindEnumDeclaration(node);
43511
43656
  case 267 /* ModuleDeclaration */:
43512
43657
  return bindModuleDeclaration(node);
43658
+ // Jsx-attributes
43513
43659
  case 292 /* JsxAttributes */:
43514
43660
  return bindJsxAttributes(node);
43515
43661
  case 291 /* JsxAttribute */:
43516
43662
  return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */);
43663
+ // Imports and exports
43517
43664
  case 271 /* ImportEqualsDeclaration */:
43518
43665
  case 274 /* NamespaceImport */:
43519
43666
  case 276 /* ImportSpecifier */:
@@ -43534,6 +43681,7 @@ function createBinder() {
43534
43681
  if (!isFunctionLikeOrClassStaticBlockDeclaration(node.parent)) {
43535
43682
  return;
43536
43683
  }
43684
+ // falls through
43537
43685
  case 268 /* ModuleBlock */:
43538
43686
  return updateStrictModeStatementList(node.statements);
43539
43687
  case 341 /* JSDocParameterTag */:
@@ -43543,6 +43691,7 @@ function createBinder() {
43543
43691
  if (node.parent.kind !== 322 /* JSDocTypeLiteral */) {
43544
43692
  break;
43545
43693
  }
43694
+ // falls through
43546
43695
  case 348 /* JSDocPropertyTag */:
43547
43696
  const propTag = node;
43548
43697
  const flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 316 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */;
@@ -43755,6 +43904,7 @@ function createBinder() {
43755
43904
  declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 111550 /* FunctionScopedVariableExcludes */);
43756
43905
  }
43757
43906
  break;
43907
+ // Namespaces are not allowed in javascript files, so do nothing here
43758
43908
  case 267 /* ModuleDeclaration */:
43759
43909
  break;
43760
43910
  default:
@@ -44251,6 +44401,7 @@ function getContainerFlags(node) {
44251
44401
  if (isObjectLiteralOrClassExpressionMethodOrAccessor(node)) {
44252
44402
  return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethodOrAccessor */;
44253
44403
  }
44404
+ // falls through
44254
44405
  case 176 /* Constructor */:
44255
44406
  case 262 /* FunctionDeclaration */:
44256
44407
  case 173 /* MethodSignature */:
@@ -47304,6 +47455,7 @@ function createTypeChecker(host) {
47304
47455
  if (isEntityNameExpression(node.expression)) {
47305
47456
  return node.expression;
47306
47457
  }
47458
+ // falls through
47307
47459
  default:
47308
47460
  return void 0;
47309
47461
  }
@@ -49159,6 +49311,7 @@ function createTypeChecker(host) {
49159
49311
  if (!isExternalOrCommonJsModule(location)) {
49160
49312
  break;
49161
49313
  }
49314
+ // falls through
49162
49315
  case 267 /* ModuleDeclaration */:
49163
49316
  const sym = getSymbolOfDeclaration(location);
49164
49317
  if (result = callback(
@@ -50581,6 +50734,9 @@ function createTypeChecker(host) {
50581
50734
  }
50582
50735
  function createTypeNodesFromResolvedType(resolvedType) {
50583
50736
  if (checkTruncationLength(context)) {
50737
+ if (context.flags & 1 /* NoTruncation */) {
50738
+ return [addSyntheticTrailingComment(factory.createNotEmittedTypeElement(), 3 /* MultiLineCommentTrivia */, "elided")];
50739
+ }
50584
50740
  return [factory.createPropertySignature(
50585
50741
  /*modifiers*/
50586
50742
  void 0,
@@ -50618,15 +50774,20 @@ function createTypeChecker(host) {
50618
50774
  }
50619
50775
  }
50620
50776
  if (checkTruncationLength(context) && i + 2 < properties.length - 1) {
50621
- typeElements.push(factory.createPropertySignature(
50622
- /*modifiers*/
50623
- void 0,
50624
- `... ${properties.length - i} more ...`,
50625
- /*questionToken*/
50626
- void 0,
50627
- /*type*/
50628
- void 0
50629
- ));
50777
+ if (context.flags & 1 /* NoTruncation */) {
50778
+ const typeElement = typeElements.pop();
50779
+ typeElements.push(addSyntheticTrailingComment(typeElement, 3 /* MultiLineCommentTrivia */, `... ${properties.length - i} more elided ...`));
50780
+ } else {
50781
+ typeElements.push(factory.createPropertySignature(
50782
+ /*modifiers*/
50783
+ void 0,
50784
+ `... ${properties.length - i} more ...`,
50785
+ /*questionToken*/
50786
+ void 0,
50787
+ /*type*/
50788
+ void 0
50789
+ ));
50790
+ }
50630
50791
  addPropertyToElementList(properties[properties.length - 1], context, typeElements);
50631
50792
  break;
50632
50793
  }
@@ -50644,7 +50805,7 @@ function createTypeChecker(host) {
50644
50805
  void 0
50645
50806
  );
50646
50807
  }
50647
- return factory.createKeywordTypeNode(133 /* AnyKeyword */);
50808
+ return addSyntheticLeadingComment(factory.createKeywordTypeNode(133 /* AnyKeyword */), 3 /* MultiLineCommentTrivia */, "elided");
50648
50809
  }
50649
50810
  function shouldUsePlaceholderForProperty(propertySymbol, context) {
50650
50811
  var _a;
@@ -50780,15 +50941,17 @@ function createTypeChecker(host) {
50780
50941
  if (some(types)) {
50781
50942
  if (checkTruncationLength(context)) {
50782
50943
  if (!isBareList) {
50783
- return [factory.createTypeReferenceNode(
50784
- "...",
50785
- /*typeArguments*/
50786
- void 0
50787
- )];
50944
+ return [
50945
+ context.flags & 1 /* NoTruncation */ ? addSyntheticLeadingComment(factory.createKeywordTypeNode(133 /* AnyKeyword */), 3 /* MultiLineCommentTrivia */, "elided") : factory.createTypeReferenceNode(
50946
+ "...",
50947
+ /*typeArguments*/
50948
+ void 0
50949
+ )
50950
+ ];
50788
50951
  } else if (types.length > 2) {
50789
50952
  return [
50790
50953
  typeToTypeNodeHelper(types[0], context),
50791
- factory.createTypeReferenceNode(
50954
+ context.flags & 1 /* NoTruncation */ ? addSyntheticLeadingComment(factory.createKeywordTypeNode(133 /* AnyKeyword */), 3 /* MultiLineCommentTrivia */, `... ${types.length - 2} more elided ...`) : factory.createTypeReferenceNode(
50792
50955
  `... ${types.length - 2} more ...`,
50793
50956
  /*typeArguments*/
50794
50957
  void 0
@@ -50804,11 +50967,13 @@ function createTypeChecker(host) {
50804
50967
  for (const type of types) {
50805
50968
  i++;
50806
50969
  if (checkTruncationLength(context) && i + 2 < types.length - 1) {
50807
- result.push(factory.createTypeReferenceNode(
50808
- `... ${types.length - i} more ...`,
50809
- /*typeArguments*/
50810
- void 0
50811
- ));
50970
+ result.push(
50971
+ context.flags & 1 /* NoTruncation */ ? addSyntheticLeadingComment(factory.createKeywordTypeNode(133 /* AnyKeyword */), 3 /* MultiLineCommentTrivia */, `... ${types.length - i} more elided ...`) : factory.createTypeReferenceNode(
50972
+ `... ${types.length - i} more ...`,
50973
+ /*typeArguments*/
50974
+ void 0
50975
+ )
50976
+ );
50812
50977
  const typeNode2 = typeToTypeNodeHelper(types[types.length - 1], context);
50813
50978
  if (typeNode2) {
50814
50979
  result.push(typeNode2);
@@ -53403,6 +53568,7 @@ function createTypeChecker(host) {
53403
53568
  );
53404
53569
  break;
53405
53570
  }
53571
+ // else fall through and treat commonjs require just like import=
53406
53572
  case 271 /* ImportEqualsDeclaration */:
53407
53573
  if (target.escapedName === "export=" /* ExportEquals */ && some(target.declarations, (d) => isSourceFile(d) && isJsonSourceFile(d))) {
53408
53574
  serializeMaybeAliasAssignment(symbol);
@@ -54175,6 +54341,7 @@ function createTypeChecker(host) {
54175
54341
  if (isBindingPattern(node.name) && !node.name.elements.length) {
54176
54342
  return false;
54177
54343
  }
54344
+ // falls through
54178
54345
  case 267 /* ModuleDeclaration */:
54179
54346
  case 263 /* ClassDeclaration */:
54180
54347
  case 264 /* InterfaceDeclaration */:
@@ -54199,6 +54366,8 @@ function createTypeChecker(host) {
54199
54366
  if (hasEffectiveModifier(node, 2 /* Private */ | 4 /* Protected */)) {
54200
54367
  return false;
54201
54368
  }
54369
+ // Public properties/methods are visible if its parents are visible, so:
54370
+ // falls through
54202
54371
  case 176 /* Constructor */:
54203
54372
  case 180 /* ConstructSignature */:
54204
54373
  case 179 /* CallSignature */:
@@ -54216,14 +54385,20 @@ function createTypeChecker(host) {
54216
54385
  case 196 /* ParenthesizedType */:
54217
54386
  case 202 /* NamedTupleMember */:
54218
54387
  return isDeclarationVisible(node.parent);
54388
+ // Default binding, import specifier and namespace import is visible
54389
+ // only on demand so by default it is not visible
54219
54390
  case 273 /* ImportClause */:
54220
54391
  case 274 /* NamespaceImport */:
54221
54392
  case 276 /* ImportSpecifier */:
54222
54393
  return false;
54394
+ // Type parameters are always visible
54223
54395
  case 168 /* TypeParameter */:
54396
+ // Source file and namespace export are always visible
54397
+ // falls through
54224
54398
  case 307 /* SourceFile */:
54225
54399
  case 270 /* NamespaceExportDeclaration */:
54226
54400
  return true;
54401
+ // Export assignments do not create name bindings outside the module
54227
54402
  case 277 /* ExportAssignment */:
54228
54403
  return false;
54229
54404
  default:
@@ -56168,11 +56343,20 @@ function createTypeChecker(host) {
56168
56343
  return type;
56169
56344
  }
56170
56345
  function isLateBindableName(node) {
56346
+ return isLateBindableAST(node) && isTypeUsableAsPropertyName(isComputedPropertyName(node) ? checkComputedPropertyName(node) : checkExpressionCached(node.argumentExpression));
56347
+ }
56348
+ function isLateBindableIndexSignature(node) {
56349
+ return isLateBindableAST(node) && isTypeUsableAsIndexSignature(isComputedPropertyName(node) ? checkComputedPropertyName(node) : checkExpressionCached(node.argumentExpression));
56350
+ }
56351
+ function isLateBindableAST(node) {
56171
56352
  if (!isComputedPropertyName(node) && !isElementAccessExpression(node)) {
56172
56353
  return false;
56173
56354
  }
56174
56355
  const expr = isComputedPropertyName(node) ? node.expression : node.argumentExpression;
56175
- return isEntityNameExpression(expr) && isTypeUsableAsPropertyName(isComputedPropertyName(node) ? checkComputedPropertyName(node) : checkExpressionCached(expr));
56356
+ return isEntityNameExpression(expr);
56357
+ }
56358
+ function isTypeUsableAsIndexSignature(type) {
56359
+ return isTypeAssignableTo(type, stringNumberSymbolType);
56176
56360
  }
56177
56361
  function isLateBoundName(name) {
56178
56362
  return name.charCodeAt(0) === 95 /* _ */ && name.charCodeAt(1) === 95 /* _ */ && name.charCodeAt(2) === 64 /* at */;
@@ -56181,6 +56365,10 @@ function createTypeChecker(host) {
56181
56365
  const name = getNameOfDeclaration(node);
56182
56366
  return !!name && isLateBindableName(name);
56183
56367
  }
56368
+ function hasLateBindableIndexSignature(node) {
56369
+ const name = getNameOfDeclaration(node);
56370
+ return !!name && isLateBindableIndexSignature(name);
56371
+ }
56184
56372
  function hasBindableName(node) {
56185
56373
  return !hasDynamicName(node) || hasLateBindableName(node);
56186
56374
  }
@@ -56234,6 +56422,24 @@ function createTypeChecker(host) {
56234
56422
  }
56235
56423
  return links.resolvedSymbol;
56236
56424
  }
56425
+ function lateBindIndexSignature(parent, earlySymbols, lateSymbols, decl) {
56426
+ let indexSymbol = lateSymbols.get("__index" /* Index */);
56427
+ if (!indexSymbol) {
56428
+ const early = earlySymbols == null ? void 0 : earlySymbols.get("__index" /* Index */);
56429
+ if (!early) {
56430
+ indexSymbol = createSymbol(0 /* None */, "__index" /* Index */, 4096 /* Late */);
56431
+ } else {
56432
+ indexSymbol = cloneSymbol(early);
56433
+ indexSymbol.links.checkFlags |= 4096 /* Late */;
56434
+ }
56435
+ lateSymbols.set("__index" /* Index */, indexSymbol);
56436
+ }
56437
+ if (!indexSymbol.declarations) {
56438
+ indexSymbol.declarations = [decl];
56439
+ } else if (!decl.symbol.isReplaceableByMethod) {
56440
+ indexSymbol.declarations.push(decl);
56441
+ }
56442
+ }
56237
56443
  function getResolvedMembersOrExportsOfSymbol(symbol, resolutionKind) {
56238
56444
  const links = getSymbolLinks(symbol);
56239
56445
  if (!links[resolutionKind]) {
@@ -56248,6 +56454,8 @@ function createTypeChecker(host) {
56248
56454
  if (isStatic2 === hasStaticModifier(member)) {
56249
56455
  if (hasLateBindableName(member)) {
56250
56456
  lateBindMember(symbol, earlySymbols, lateSymbols, member);
56457
+ } else if (hasLateBindableIndexSignature(member)) {
56458
+ lateBindIndexSignature(symbol, earlySymbols, lateSymbols, member);
56251
56459
  }
56252
56460
  }
56253
56461
  }
@@ -58511,7 +58719,7 @@ function createTypeChecker(host) {
58511
58719
  return signature.isolatedSignatureType;
58512
58720
  }
58513
58721
  function getIndexSymbol(symbol) {
58514
- return symbol.members ? getIndexSymbolFromSymbolTable(symbol.members) : void 0;
58722
+ return symbol.members ? getIndexSymbolFromSymbolTable(getMembersOfSymbol(symbol)) : void 0;
58515
58723
  }
58516
58724
  function getIndexSymbolFromSymbolTable(symbolTable) {
58517
58725
  return symbolTable.get("__index" /* Index */);
@@ -58527,15 +58735,25 @@ function createTypeChecker(host) {
58527
58735
  if (indexSymbol.declarations) {
58528
58736
  const indexInfos = [];
58529
58737
  for (const declaration of indexSymbol.declarations) {
58530
- if (declaration.parameters.length === 1) {
58531
- const parameter = declaration.parameters[0];
58532
- if (parameter.type) {
58533
- forEachType(getTypeFromTypeNode(parameter.type), (keyType) => {
58534
- if (isValidIndexKeyType(keyType) && !findIndexInfo(indexInfos, keyType)) {
58535
- indexInfos.push(createIndexInfo(keyType, declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, hasEffectiveModifier(declaration, 8 /* Readonly */), declaration));
58536
- }
58537
- });
58738
+ if (isIndexSignatureDeclaration(declaration)) {
58739
+ if (declaration.parameters.length === 1) {
58740
+ const parameter = declaration.parameters[0];
58741
+ if (parameter.type) {
58742
+ forEachType(getTypeFromTypeNode(parameter.type), (keyType) => {
58743
+ if (isValidIndexKeyType(keyType) && !findIndexInfo(indexInfos, keyType)) {
58744
+ indexInfos.push(createIndexInfo(keyType, declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, hasEffectiveModifier(declaration, 8 /* Readonly */), declaration));
58745
+ }
58746
+ });
58747
+ }
58538
58748
  }
58749
+ } else if (hasLateBindableIndexSignature(declaration)) {
58750
+ const declName = isBinaryExpression(declaration) ? declaration.left : declaration.name;
58751
+ const keyType = isElementAccessExpression(declName) ? checkExpressionCached(declName.argumentExpression) : checkComputedPropertyName(declName);
58752
+ forEachType(keyType, (keyType2) => {
58753
+ if (isValidIndexKeyType(keyType2) && !findIndexInfo(indexInfos, keyType2)) {
58754
+ indexInfos.push(createIndexInfo(keyType2, getTypeOfVariableOrParameterOrProperty(declaration.symbol), hasEffectiveModifier(declaration, 8 /* Readonly */)));
58755
+ }
58756
+ });
58539
58757
  }
58540
58758
  }
58541
58759
  return indexInfos;
@@ -61773,6 +61991,9 @@ function createTypeChecker(host) {
61773
61991
  return getTypeFromTemplateTypeNode(node);
61774
61992
  case 205 /* ImportType */:
61775
61993
  return getTypeFromImportTypeNode(node);
61994
+ // This function assumes that an identifier, qualified name, or property access expression is a type expression
61995
+ // Callers should first ensure this by calling `isPartOfTypeNode`
61996
+ // TODO(rbuckton): These aren't valid TypeNodes, but we treat them as such because of `isPartOfTypeNode`, which returns `true` for things that aren't `TypeNode`s.
61776
61997
  case 80 /* Identifier */:
61777
61998
  case 166 /* QualifiedName */:
61778
61999
  case 211 /* PropertyAccessExpression */:
@@ -62020,6 +62241,7 @@ function createTypeChecker(host) {
62020
62241
  return !!tp.isThisType;
62021
62242
  case 80 /* Identifier */:
62022
62243
  return !tp.isThisType && isPartOfTypeNode(node2) && maybeTypeParameterReference(node2) && getTypeFromTypeNodeWorker(node2) === tp;
62244
+ // use worker because we're looking for === equality
62023
62245
  case 186 /* TypeQuery */:
62024
62246
  const entityName = node2.exprName;
62025
62247
  const firstIdentifier = getFirstIdentifier(entityName);
@@ -62439,6 +62661,7 @@ function createTypeChecker(host) {
62439
62661
  if (!isConstAssertion(node)) {
62440
62662
  break;
62441
62663
  }
62664
+ // fallthrough
62442
62665
  case 294 /* JsxExpression */:
62443
62666
  case 217 /* ParenthesizedExpression */:
62444
62667
  return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer);
@@ -63534,7 +63757,7 @@ function createTypeChecker(host) {
63534
63757
  const [sourceType, targetType] = getTypeNamesForErrorDisplay(source2, target2);
63535
63758
  let generalizedSource = source2;
63536
63759
  let generalizedSourceType = sourceType;
63537
- if (isLiteralType(source2) && !typeCouldHaveTopLevelSingletonTypes(target2)) {
63760
+ if (!(target2.flags & 131072 /* Never */) && isLiteralType(source2) && !typeCouldHaveTopLevelSingletonTypes(target2)) {
63538
63761
  generalizedSource = getBaseTypeOfLiteralType(source2);
63539
63762
  Debug.assert(!isTypeAssignableTo(generalizedSource, target2), "generalized source shouldn't be assignable");
63540
63763
  generalizedSourceType = getTypeNameForErrorDisplay(generalizedSource);
@@ -67758,6 +67981,7 @@ function createTypeChecker(host) {
67758
67981
  if (isCallExpression(node.parent)) {
67759
67982
  return Diagnostics.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function;
67760
67983
  }
67984
+ // falls through
67761
67985
  default:
67762
67986
  if (node.parent.kind === 304 /* ShorthandPropertyAssignment */) {
67763
67987
  return Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer;
@@ -67791,6 +68015,7 @@ function createTypeChecker(host) {
67791
68015
  const symbol = getResolvedSymbol(node);
67792
68016
  return symbol !== unknownSymbol ? `${flowContainer ? getNodeId(flowContainer) : "-1"}|${getTypeId(declaredType)}|${getTypeId(initialType)}|${getSymbolId(symbol)}` : void 0;
67793
68017
  }
68018
+ // falls through
67794
68019
  case 110 /* ThisKeyword */:
67795
68020
  return `0|${flowContainer ? getNodeId(flowContainer) : "-1"}|${getTypeId(declaredType)}|${getTypeId(initialType)}`;
67796
68021
  case 235 /* NonNullExpression */:
@@ -69344,6 +69569,9 @@ function createTypeChecker(host) {
69344
69569
  break;
69345
69570
  case 28 /* CommaToken */:
69346
69571
  return narrowType(type, expr.right, assumeTrue);
69572
+ // Ordinarily we won't see && and || expressions in control flow analysis because the Binder breaks those
69573
+ // expressions down to individual conditional control flows. However, we may encounter them when analyzing
69574
+ // aliased conditional expressions.
69347
69575
  case 56 /* AmpersandAmpersandToken */:
69348
69576
  return assumeTrue ? narrowType(
69349
69577
  narrowType(
@@ -69787,6 +70015,7 @@ function createTypeChecker(host) {
69787
70015
  }
69788
70016
  }
69789
70017
  }
70018
+ // falls through
69790
70019
  case 110 /* ThisKeyword */:
69791
70020
  case 108 /* SuperKeyword */:
69792
70021
  case 211 /* PropertyAccessExpression */:
@@ -77605,6 +77834,7 @@ function createTypeChecker(host) {
77605
77834
  hasError = true;
77606
77835
  break;
77607
77836
  }
77837
+ // fallthrough
77608
77838
  case 7 /* ES2022 */:
77609
77839
  case 99 /* ESNext */:
77610
77840
  case 200 /* Preserve */:
@@ -77612,6 +77842,7 @@ function createTypeChecker(host) {
77612
77842
  if (languageVersion >= 4 /* ES2017 */) {
77613
77843
  break;
77614
77844
  }
77845
+ // fallthrough
77615
77846
  default:
77616
77847
  span ?? (span = getSpanOfTokenAtPosition(sourceFile, node.pos));
77617
77848
  const message = isAwaitExpression(node) ? Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher : Diagnostics.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher;
@@ -78029,9 +78260,13 @@ function createTypeChecker(host) {
78029
78260
  return true;
78030
78261
  }
78031
78262
  return false;
78263
+ // Some forms listed here for clarity
78032
78264
  case 222 /* VoidExpression */:
78265
+ // Explicit opt-out
78033
78266
  case 216 /* TypeAssertionExpression */:
78267
+ // Not SEF, but can produce useful type warnings
78034
78268
  case 234 /* AsExpression */:
78269
+ // Not SEF, but can produce useful type warnings
78035
78270
  default:
78036
78271
  return false;
78037
78272
  }
@@ -79277,6 +79512,7 @@ function createTypeChecker(host) {
79277
79512
  if (node.expression.kind === 102 /* ImportKeyword */) {
79278
79513
  return checkImportCallExpression(node);
79279
79514
  }
79515
+ // falls through
79280
79516
  case 214 /* NewExpression */:
79281
79517
  return checkCallExpression(node, checkMode);
79282
79518
  case 215 /* TaggedTemplateExpression */:
@@ -79365,7 +79601,7 @@ function createTypeChecker(host) {
79365
79601
  const modifiers = getTypeParameterModifiers(typeParameter) & (8192 /* In */ | 16384 /* Out */);
79366
79602
  if (modifiers) {
79367
79603
  const symbol = getSymbolOfDeclaration(node.parent);
79368
- if (isTypeAliasDeclaration(node.parent) && !(getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */))) {
79604
+ if (isTypeAliasDeclaration(node.parent) && !(getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (16 /* Anonymous */ | 32 /* Mapped */))) {
79369
79605
  error(node, Diagnostics.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types);
79370
79606
  } else if (modifiers === 8192 /* In */ || modifiers === 16384 /* Out */) {
79371
79607
  (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.CheckTypes, "checkTypeParameterDeferred", { parent: getTypeId(getDeclaredTypeOfSymbol(symbol)), id: getTypeId(typeParameter) });
@@ -79646,6 +79882,7 @@ function createTypeChecker(host) {
79646
79882
  if (useDefineForClassFields) {
79647
79883
  break;
79648
79884
  }
79885
+ // fall through
79649
79886
  case "prototype":
79650
79887
  const message = Diagnostics.Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1;
79651
79888
  const className = getNameOfSymbolAsWritten(getSymbolOfDeclaration(node));
@@ -79692,15 +79929,17 @@ function createTypeChecker(host) {
79692
79929
  if (indexSymbol == null ? void 0 : indexSymbol.declarations) {
79693
79930
  const indexSignatureMap = /* @__PURE__ */ new Map();
79694
79931
  for (const declaration of indexSymbol.declarations) {
79695
- if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
79696
- forEachType(getTypeFromTypeNode(declaration.parameters[0].type), (type) => {
79697
- const entry = indexSignatureMap.get(getTypeId(type));
79698
- if (entry) {
79699
- entry.declarations.push(declaration);
79700
- } else {
79701
- indexSignatureMap.set(getTypeId(type), { type, declarations: [declaration] });
79702
- }
79703
- });
79932
+ if (isIndexSignatureDeclaration(declaration)) {
79933
+ if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
79934
+ forEachType(getTypeFromTypeNode(declaration.parameters[0].type), (type) => {
79935
+ const entry = indexSignatureMap.get(getTypeId(type));
79936
+ if (entry) {
79937
+ entry.declarations.push(declaration);
79938
+ } else {
79939
+ indexSignatureMap.set(getTypeId(type), { type, declarations: [declaration] });
79940
+ }
79941
+ });
79942
+ }
79704
79943
  }
79705
79944
  }
79706
79945
  indexSignatureMap.forEach((entry) => {
@@ -80389,6 +80628,8 @@ function createTypeChecker(host) {
80389
80628
  switch (d.kind) {
80390
80629
  case 264 /* InterfaceDeclaration */:
80391
80630
  case 265 /* TypeAliasDeclaration */:
80631
+ // A jsdoc typedef and callback are, by definition, type aliases.
80632
+ // falls through
80392
80633
  case 346 /* JSDocTypedefTag */:
80393
80634
  case 338 /* JSDocCallbackTag */:
80394
80635
  case 340 /* JSDocEnumTag */:
@@ -80409,6 +80650,8 @@ function createTypeChecker(host) {
80409
80650
  return 1 /* ExportValue */;
80410
80651
  }
80411
80652
  d = expression;
80653
+ // The below options all declare an Alias, which is allowed to merge with other values within the importing module.
80654
+ // falls through
80412
80655
  case 271 /* ImportEqualsDeclaration */:
80413
80656
  case 274 /* NamespaceImport */:
80414
80657
  case 273 /* ImportClause */:
@@ -80422,6 +80665,7 @@ function createTypeChecker(host) {
80422
80665
  case 208 /* BindingElement */:
80423
80666
  case 262 /* FunctionDeclaration */:
80424
80667
  case 276 /* ImportSpecifier */:
80668
+ // https://github.com/Microsoft/TypeScript/pull/7591
80425
80669
  case 80 /* Identifier */:
80426
80670
  return 1 /* ExportValue */;
80427
80671
  case 173 /* MethodSignature */:
@@ -80770,6 +81014,7 @@ function createTypeChecker(host) {
80770
81014
  headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1;
80771
81015
  break;
80772
81016
  }
81017
+ // falls through
80773
81018
  case 169 /* Parameter */:
80774
81019
  headMessage = Diagnostics.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any;
80775
81020
  break;
@@ -83991,6 +84236,7 @@ function createTypeChecker(host) {
83991
84236
  break;
83992
84237
  case 271 /* ImportEqualsDeclaration */:
83993
84238
  if (isInternalModuleImportEqualsDeclaration(node)) break;
84239
+ // falls through
83994
84240
  case 272 /* ImportDeclaration */:
83995
84241
  grammarErrorOnFirstToken(node, Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module);
83996
84242
  break;
@@ -84003,6 +84249,7 @@ function createTypeChecker(host) {
84003
84249
  }
84004
84250
  break;
84005
84251
  }
84252
+ // falls through
84006
84253
  case 263 /* ClassDeclaration */:
84007
84254
  case 266 /* EnumDeclaration */:
84008
84255
  case 262 /* FunctionDeclaration */:
@@ -84679,6 +84926,7 @@ function createTypeChecker(host) {
84679
84926
  return checkJSDocPropertyTag(node);
84680
84927
  case 317 /* JSDocFunctionType */:
84681
84928
  checkJSDocFunctionType(node);
84929
+ // falls through
84682
84930
  case 315 /* JSDocNonNullableType */:
84683
84931
  case 314 /* JSDocNullableType */:
84684
84932
  case 312 /* JSDocAllType */:
@@ -85102,6 +85350,7 @@ function createTypeChecker(host) {
85102
85350
  switch (location.kind) {
85103
85351
  case 307 /* SourceFile */:
85104
85352
  if (!isExternalModule(location)) break;
85353
+ // falls through
85105
85354
  case 267 /* ModuleDeclaration */:
85106
85355
  copyLocallyVisibleExportSymbols(getSymbolOfDeclaration(location).exports, meaning & 2623475 /* ModuleMember */);
85107
85356
  break;
@@ -85113,6 +85362,9 @@ function createTypeChecker(host) {
85113
85362
  if (className) {
85114
85363
  copySymbol(location.symbol, meaning);
85115
85364
  }
85365
+ // this fall-through is necessary because we would like to handle
85366
+ // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration.
85367
+ // falls through
85116
85368
  case 263 /* ClassDeclaration */:
85117
85369
  case 264 /* InterfaceDeclaration */:
85118
85370
  if (!isStaticSymbol) {
@@ -85221,6 +85473,7 @@ function createTypeChecker(host) {
85221
85473
  if (isPropertyAccessExpression(entityName.parent) && getLeftmostAccessExpression(entityName.parent) === entityName) {
85222
85474
  return void 0;
85223
85475
  }
85476
+ // falls through
85224
85477
  case 4 /* ThisProperty */:
85225
85478
  case 2 /* ModuleExports */:
85226
85479
  return getSymbolOfDeclaration(entityName.parent.parent);
@@ -85514,6 +85767,7 @@ function createTypeChecker(host) {
85514
85767
  if (!isThisInTypeQuery(node)) {
85515
85768
  return getSymbolOfNameOrPropertyAccessExpression(node);
85516
85769
  }
85770
+ // falls through
85517
85771
  case 110 /* ThisKeyword */:
85518
85772
  const container = getThisContainer(
85519
85773
  node,
@@ -85531,6 +85785,7 @@ function createTypeChecker(host) {
85531
85785
  if (isInExpressionContext(node)) {
85532
85786
  return checkExpression(node).symbol;
85533
85787
  }
85788
+ // falls through
85534
85789
  case 197 /* ThisType */:
85535
85790
  return getTypeFromThisTypeNode(node).symbol;
85536
85791
  case 108 /* SuperKeyword */:
@@ -85553,6 +85808,7 @@ function createTypeChecker(host) {
85553
85808
  if (isCallExpression(parent) && isBindableObjectDefinePropertyCall(parent) && parent.arguments[1] === node) {
85554
85809
  return getSymbolOfDeclaration(parent);
85555
85810
  }
85811
+ // falls through
85556
85812
  case 9 /* NumericLiteral */:
85557
85813
  const objectType = isElementAccessExpression(parent) ? parent.argumentExpression === node ? getTypeOfExpression(parent.expression) : void 0 : isLiteralTypeNode(parent) && isIndexedAccessTypeNode(grandParent) ? getTypeFromTypeNode(grandParent.objectType) : void 0;
85558
85814
  return objectType && getPropertyOfType(objectType, escapeLeadingUnderscores(node.text));
@@ -85582,6 +85838,7 @@ function createTypeChecker(host) {
85582
85838
  const symbol = getIntrinsicTagSymbol(node.parent);
85583
85839
  return symbol === unknownSymbol ? void 0 : symbol;
85584
85840
  }
85841
+ // falls through
85585
85842
  default:
85586
85843
  return void 0;
85587
85844
  }
@@ -86590,7 +86847,29 @@ function createTypeChecker(host) {
86590
86847
  return !sym.exports ? [] : nodeBuilder.symbolTableToDeclarationStatements(sym.exports, node, flags, internalFlags, tracker);
86591
86848
  },
86592
86849
  isImportRequiredByAugmentation,
86593
- isDefinitelyReferenceToGlobalSymbolObject
86850
+ isDefinitelyReferenceToGlobalSymbolObject,
86851
+ createLateBoundIndexSignatures: (cls, enclosing, flags, internalFlags, tracker) => {
86852
+ const sym = cls.symbol;
86853
+ const staticInfos = getIndexInfosOfType(getTypeOfSymbol(sym));
86854
+ const instanceIndexSymbol = getIndexSymbol(sym);
86855
+ const instanceInfos = instanceIndexSymbol && getIndexInfosOfIndexSymbol(instanceIndexSymbol);
86856
+ let result;
86857
+ for (const infoList of [staticInfos, instanceInfos]) {
86858
+ if (!length(infoList)) continue;
86859
+ result || (result = []);
86860
+ for (const info of infoList) {
86861
+ if (info.declaration) continue;
86862
+ const node = nodeBuilder.indexInfoToIndexSignatureDeclaration(info, enclosing, flags, internalFlags, tracker);
86863
+ if (node && infoList === staticInfos) {
86864
+ (node.modifiers || (node.modifiers = factory.createNodeArray())).unshift(factory.createModifier(126 /* StaticKeyword */));
86865
+ }
86866
+ if (node) {
86867
+ result.push(node);
86868
+ }
86869
+ }
86870
+ }
86871
+ return result;
86872
+ }
86594
86873
  };
86595
86874
  function isImportRequiredByAugmentation(node) {
86596
86875
  const file = getSourceFileOfNode(node);
@@ -87676,6 +87955,7 @@ function createTypeChecker(host) {
87676
87955
  );
87677
87956
  break;
87678
87957
  }
87958
+ // fallthrough
87679
87959
  case 7 /* ES2022 */:
87680
87960
  case 99 /* ESNext */:
87681
87961
  case 200 /* Preserve */:
@@ -87683,6 +87963,7 @@ function createTypeChecker(host) {
87683
87963
  if (languageVersion >= 4 /* ES2017 */) {
87684
87964
  break;
87685
87965
  }
87966
+ // fallthrough
87686
87967
  default:
87687
87968
  diagnostics.add(
87688
87969
  createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher)
@@ -89859,13 +90140,13 @@ var visitEachChildTable = {
89859
90140
  );
89860
90141
  },
89861
90142
  // Transformation nodes
89862
- [354 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
90143
+ [355 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
89863
90144
  return context.factory.updatePartiallyEmittedExpression(
89864
90145
  node,
89865
90146
  Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression))
89866
90147
  );
89867
90148
  },
89868
- [355 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
90149
+ [356 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
89869
90150
  return context.factory.updateCommaListExpression(
89870
90151
  node,
89871
90152
  nodesVisitor(node.elements, visitor, isExpression)
@@ -91789,6 +92070,8 @@ function transformTypeScript(context) {
91789
92070
  case 148 /* ReadonlyKeyword */:
91790
92071
  case 103 /* InKeyword */:
91791
92072
  case 147 /* OutKeyword */:
92073
+ // TypeScript accessibility and readonly modifiers are elided
92074
+ // falls through
91792
92075
  case 188 /* ArrayType */:
91793
92076
  case 189 /* TupleType */:
91794
92077
  case 190 /* OptionalType */:
@@ -91817,6 +92100,8 @@ function transformTypeScript(context) {
91817
92100
  case 199 /* IndexedAccessType */:
91818
92101
  case 200 /* MappedType */:
91819
92102
  case 201 /* LiteralType */:
92103
+ // TypeScript type nodes are elided.
92104
+ // falls through
91820
92105
  case 181 /* IndexSignature */:
91821
92106
  return void 0;
91822
92107
  case 265 /* TypeAliasDeclaration */:
@@ -93499,7 +93784,7 @@ function transformClassFields(context) {
93499
93784
  /*discarded*/
93500
93785
  true
93501
93786
  );
93502
- case 355 /* CommaListExpression */:
93787
+ case 356 /* CommaListExpression */:
93503
93788
  return visitCommaListExpression(
93504
93789
  node,
93505
93790
  /*discarded*/
@@ -95439,6 +95724,7 @@ function transformClassFields(context) {
95439
95724
  if (isArrowFunction(original) || getEmitFlags(node) & 524288 /* AsyncFunctionBody */) {
95440
95725
  break;
95441
95726
  }
95727
+ // falls through
95442
95728
  case 262 /* FunctionDeclaration */:
95443
95729
  case 176 /* Constructor */:
95444
95730
  case 177 /* GetAccessor */:
@@ -95714,6 +96000,7 @@ function createRuntimeTypeSerializer(context) {
95714
96000
  case 197 /* ThisType */:
95715
96001
  case 205 /* ImportType */:
95716
96002
  break;
96003
+ // handle JSDoc types from an invalid parse
95717
96004
  case 312 /* JSDocAllType */:
95718
96005
  case 313 /* JSDocUnknownType */:
95719
96006
  case 317 /* JSDocFunctionType */:
@@ -96559,6 +96846,7 @@ function transformESDecorators(context) {
96559
96846
  return Debug.fail("Not supported outside of a class. Use 'classElementVisitor' instead.");
96560
96847
  case 169 /* Parameter */:
96561
96848
  return visitParameterDeclaration(node);
96849
+ // Support NamedEvaluation to ensure the correct class name for class expressions.
96562
96850
  case 226 /* BinaryExpression */:
96563
96851
  return visitBinaryExpression(
96564
96852
  node,
@@ -96579,7 +96867,7 @@ function transformESDecorators(context) {
96579
96867
  return visitForStatement(node);
96580
96868
  case 244 /* ExpressionStatement */:
96581
96869
  return visitExpressionStatement(node);
96582
- case 355 /* CommaListExpression */:
96870
+ case 356 /* CommaListExpression */:
96583
96871
  return visitCommaListExpression(
96584
96872
  node,
96585
96873
  /*discarded*/
@@ -96591,7 +96879,7 @@ function transformESDecorators(context) {
96591
96879
  /*discarded*/
96592
96880
  false
96593
96881
  );
96594
- case 354 /* PartiallyEmittedExpression */:
96882
+ case 355 /* PartiallyEmittedExpression */:
96595
96883
  return visitPartiallyEmittedExpression(
96596
96884
  node,
96597
96885
  /*discarded*/
@@ -96615,6 +96903,7 @@ function transformESDecorators(context) {
96615
96903
  case 167 /* ComputedPropertyName */:
96616
96904
  return visitComputedPropertyName(node);
96617
96905
  case 174 /* MethodDeclaration */:
96906
+ // object literal methods and accessors
96618
96907
  case 178 /* SetAccessor */:
96619
96908
  case 177 /* GetAccessor */:
96620
96909
  case 218 /* FunctionExpression */:
@@ -96677,7 +96966,7 @@ function transformESDecorators(context) {
96677
96966
  /*discarded*/
96678
96967
  true
96679
96968
  );
96680
- case 355 /* CommaListExpression */:
96969
+ case 356 /* CommaListExpression */:
96681
96970
  return visitCommaListExpression(
96682
96971
  node,
96683
96972
  /*discarded*/
@@ -99259,7 +99548,7 @@ function transformES2018(context) {
99259
99548
  return visitObjectLiteralExpression(node);
99260
99549
  case 226 /* BinaryExpression */:
99261
99550
  return visitBinaryExpression(node, expressionResultIsUnused2);
99262
- case 355 /* CommaListExpression */:
99551
+ case 356 /* CommaListExpression */:
99263
99552
  return visitCommaListExpression(node, expressionResultIsUnused2);
99264
99553
  case 299 /* CatchClause */:
99265
99554
  return visitCatchClause(node);
@@ -102399,6 +102688,7 @@ function transformES2015(context) {
102399
102688
  switch (node.kind) {
102400
102689
  case 126 /* StaticKeyword */:
102401
102690
  return void 0;
102691
+ // elide static keyword
102402
102692
  case 263 /* ClassDeclaration */:
102403
102693
  return visitClassDeclaration(node);
102404
102694
  case 231 /* ClassExpression */:
@@ -102477,7 +102767,7 @@ function transformES2015(context) {
102477
102767
  return visitParenthesizedExpression(node, expressionResultIsUnused2);
102478
102768
  case 226 /* BinaryExpression */:
102479
102769
  return visitBinaryExpression(node, expressionResultIsUnused2);
102480
- case 355 /* CommaListExpression */:
102770
+ case 356 /* CommaListExpression */:
102481
102771
  return visitCommaListExpression(node, expressionResultIsUnused2);
102482
102772
  case 15 /* NoSubstitutionTemplateLiteral */:
102483
102773
  case 16 /* TemplateHead */:
@@ -102861,12 +103151,14 @@ function transformES2015(context) {
102861
103151
  return false;
102862
103152
  }
102863
103153
  switch (node.kind) {
103154
+ // stop at function boundaries
102864
103155
  case 219 /* ArrowFunction */:
102865
103156
  case 218 /* FunctionExpression */:
102866
103157
  case 262 /* FunctionDeclaration */:
102867
103158
  case 176 /* Constructor */:
102868
103159
  case 175 /* ClassStaticBlockDeclaration */:
102869
103160
  return false;
103161
+ // only step into computed property names for class and object literal elements
102870
103162
  case 177 /* GetAccessor */:
102871
103163
  case 178 /* SetAccessor */:
102872
103164
  case 174 /* MethodDeclaration */:
@@ -103075,12 +103367,14 @@ function transformES2015(context) {
103075
103367
  return factory2.createPartiallyEmittedExpression(node.right, node);
103076
103368
  }
103077
103369
  switch (node.kind) {
103370
+ // stop at function boundaries
103078
103371
  case 219 /* ArrowFunction */:
103079
103372
  case 218 /* FunctionExpression */:
103080
103373
  case 262 /* FunctionDeclaration */:
103081
103374
  case 176 /* Constructor */:
103082
103375
  case 175 /* ClassStaticBlockDeclaration */:
103083
103376
  return node;
103377
+ // only step into computed property names for class and object literal elements
103084
103378
  case 177 /* GetAccessor */:
103085
103379
  case 178 /* SetAccessor */:
103086
103380
  case 174 /* MethodDeclaration */:
@@ -103126,12 +103420,14 @@ function transformES2015(context) {
103126
103420
  );
103127
103421
  }
103128
103422
  switch (node.kind) {
103423
+ // stop at function boundaries
103129
103424
  case 219 /* ArrowFunction */:
103130
103425
  case 218 /* FunctionExpression */:
103131
103426
  case 262 /* FunctionDeclaration */:
103132
103427
  case 176 /* Constructor */:
103133
103428
  case 175 /* ClassStaticBlockDeclaration */:
103134
103429
  return node;
103430
+ // only step into computed property names for class and object literal elements
103135
103431
  case 177 /* GetAccessor */:
103136
103432
  case 178 /* SetAccessor */:
103137
103433
  case 174 /* MethodDeclaration */:
@@ -105763,7 +106059,7 @@ function transformGenerators(context) {
105763
106059
  switch (node.kind) {
105764
106060
  case 226 /* BinaryExpression */:
105765
106061
  return visitBinaryExpression(node);
105766
- case 355 /* CommaListExpression */:
106062
+ case 356 /* CommaListExpression */:
105767
106063
  return visitCommaListExpression(node);
105768
106064
  case 227 /* ConditionalExpression */:
105769
106065
  return visitConditionalExpression(node);
@@ -108154,7 +108450,7 @@ function transformModule(context) {
108154
108450
  return visitExpressionStatement(node);
108155
108451
  case 217 /* ParenthesizedExpression */:
108156
108452
  return visitParenthesizedExpression(node, valueIsDiscarded);
108157
- case 354 /* PartiallyEmittedExpression */:
108453
+ case 355 /* PartiallyEmittedExpression */:
108158
108454
  return visitPartiallyEmittedExpression(node, valueIsDiscarded);
108159
108455
  case 213 /* CallExpression */:
108160
108456
  if (isImportCall(node) && host.shouldTransformImportCall(currentSourceFile)) {
@@ -109914,6 +110210,7 @@ function transformSystemModule(context) {
109914
110210
  if (!entry.importClause) {
109915
110211
  break;
109916
110212
  }
110213
+ // falls through
109917
110214
  case 271 /* ImportEqualsDeclaration */:
109918
110215
  Debug.assert(importVariableName !== void 0);
109919
110216
  statements.push(
@@ -110548,7 +110845,7 @@ function transformSystemModule(context) {
110548
110845
  return visitExpressionStatement(node);
110549
110846
  case 217 /* ParenthesizedExpression */:
110550
110847
  return visitParenthesizedExpression(node, valueIsDiscarded);
110551
- case 354 /* PartiallyEmittedExpression */:
110848
+ case 355 /* PartiallyEmittedExpression */:
110552
110849
  return visitPartiallyEmittedExpression(node, valueIsDiscarded);
110553
110850
  case 226 /* BinaryExpression */:
110554
110851
  if (isDestructuringAssignment(node)) {
@@ -112147,6 +112444,7 @@ function transformDeclarations(context) {
112147
112444
  case 265 /* TypeAliasDeclaration */:
112148
112445
  case 266 /* EnumDeclaration */:
112149
112446
  return !resolver.isDeclarationVisible(node);
112447
+ // The following should be doing their own visibility checks based on filtering their members
112150
112448
  case 260 /* VariableDeclaration */:
112151
112449
  return !getBindingNameVisible(node);
112152
112450
  case 271 /* ImportEqualsDeclaration */:
@@ -113041,7 +113339,8 @@ function transformDeclarations(context) {
113041
113339
  void 0
113042
113340
  )
113043
113341
  ] : void 0;
113044
- const memberNodes = concatenate(concatenate(privateIdentifier, parameterProperties), visitNodes2(input.members, visitDeclarationSubtree, isClassElement));
113342
+ const lateIndexes = resolver.createLateBoundIndexSignatures(input, enclosingDeclaration, declarationEmitNodeBuilderFlags, declarationEmitInternalNodeBuilderFlags, symbolTracker);
113343
+ const memberNodes = concatenate(concatenate(concatenate(privateIdentifier, lateIndexes), parameterProperties), visitNodes2(input.members, visitDeclarationSubtree, isClassElement));
113045
113344
  const members = factory2.createNodeArray(memberNodes);
113046
113345
  const extendsClause = getEffectiveBaseTypeNode(input);
113047
113346
  if (extendsClause && !isEntityNameExpression(extendsClause.expression) && extendsClause.expression.kind !== 106 /* NullKeyword */) {
@@ -113428,7 +113727,7 @@ function noEmitNotification(hint, node, callback) {
113428
113727
  }
113429
113728
  function transformNodes(resolver, host, factory2, options, nodes, transformers, allowDtsFiles) {
113430
113729
  var _a, _b;
113431
- const enabledSyntaxKindFeatures = new Array(357 /* Count */);
113730
+ const enabledSyntaxKindFeatures = new Array(358 /* Count */);
113432
113731
  let lexicalEnvironmentVariableDeclarations;
113433
113732
  let lexicalEnvironmentFunctionDeclarations;
113434
113733
  let lexicalEnvironmentStatements;
@@ -114346,7 +114645,8 @@ var notImplementedResolver = {
114346
114645
  isBindingCapturedByNode: notImplemented,
114347
114646
  getDeclarationStatementsForSourceFile: notImplemented,
114348
114647
  isImportRequiredByAugmentation: notImplemented,
114349
- isDefinitelyReferenceToGlobalSymbolObject: notImplemented
114648
+ isDefinitelyReferenceToGlobalSymbolObject: notImplemented,
114649
+ createLateBoundIndexSignatures: notImplemented
114350
114650
  };
114351
114651
  var createPrinterWithDefaults = /* @__PURE__ */ memoize(() => createPrinter({}));
114352
114652
  var createPrinterWithRemoveComments = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true }));
@@ -114631,6 +114931,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114631
114931
  if (onEmitNode !== noEmitNotification && (!isEmitNotificationEnabled || isEmitNotificationEnabled(node))) {
114632
114932
  return pipelineEmitWithNotification;
114633
114933
  }
114934
+ // falls through
114634
114935
  case 1 /* Substitution */:
114635
114936
  if (substituteNode !== noEmitSubstitution && (lastSubstitution = substituteNode(emitHint, node) || node) !== node) {
114636
114937
  if (currentParenthesizerRule) {
@@ -114638,14 +114939,17 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114638
114939
  }
114639
114940
  return pipelineEmitWithSubstitution;
114640
114941
  }
114942
+ // falls through
114641
114943
  case 2 /* Comments */:
114642
114944
  if (shouldEmitComments(node)) {
114643
114945
  return pipelineEmitWithComments;
114644
114946
  }
114947
+ // falls through
114645
114948
  case 3 /* SourceMaps */:
114646
114949
  if (shouldEmitSourceMaps(node)) {
114647
114950
  return pipelineEmitWithSourceMaps;
114648
114951
  }
114952
+ // falls through
114649
114953
  case 4 /* Emit */:
114650
114954
  return pipelineEmitWithHint;
114651
114955
  default:
@@ -114697,6 +115001,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114697
115001
  }
114698
115002
  if (hint === 4 /* Unspecified */) {
114699
115003
  switch (node.kind) {
115004
+ // Pseudo-literals
114700
115005
  case 16 /* TemplateHead */:
114701
115006
  case 17 /* TemplateMiddle */:
114702
115007
  case 18 /* TemplateTail */:
@@ -114705,20 +115010,26 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114705
115010
  /*jsxAttributeEscape*/
114706
115011
  false
114707
115012
  );
115013
+ // Identifiers
114708
115014
  case 80 /* Identifier */:
114709
115015
  return emitIdentifier(node);
115016
+ // PrivateIdentifiers
114710
115017
  case 81 /* PrivateIdentifier */:
114711
115018
  return emitPrivateIdentifier(node);
115019
+ // Parse tree nodes
115020
+ // Names
114712
115021
  case 166 /* QualifiedName */:
114713
115022
  return emitQualifiedName(node);
114714
115023
  case 167 /* ComputedPropertyName */:
114715
115024
  return emitComputedPropertyName(node);
115025
+ // Signature elements
114716
115026
  case 168 /* TypeParameter */:
114717
115027
  return emitTypeParameter(node);
114718
115028
  case 169 /* Parameter */:
114719
115029
  return emitParameter(node);
114720
115030
  case 170 /* Decorator */:
114721
115031
  return emitDecorator(node);
115032
+ // Type members
114722
115033
  case 171 /* PropertySignature */:
114723
115034
  return emitPropertySignature(node);
114724
115035
  case 172 /* PropertyDeclaration */:
@@ -114740,6 +115051,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114740
115051
  return emitConstructSignature(node);
114741
115052
  case 181 /* IndexSignature */:
114742
115053
  return emitIndexSignature(node);
115054
+ // Types
114743
115055
  case 182 /* TypePredicate */:
114744
115056
  return emitTypePredicate(node);
114745
115057
  case 183 /* TypeReference */:
@@ -114758,6 +115070,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114758
115070
  return emitTupleType(node);
114759
115071
  case 190 /* OptionalType */:
114760
115072
  return emitOptionalType(node);
115073
+ // SyntaxKind.RestType is handled below
114761
115074
  case 192 /* UnionType */:
114762
115075
  return emitUnionType(node);
114763
115076
  case 193 /* IntersectionType */:
@@ -114788,16 +115101,19 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114788
115101
  return emitTemplateTypeSpan(node);
114789
115102
  case 205 /* ImportType */:
114790
115103
  return emitImportTypeNode(node);
115104
+ // Binding patterns
114791
115105
  case 206 /* ObjectBindingPattern */:
114792
115106
  return emitObjectBindingPattern(node);
114793
115107
  case 207 /* ArrayBindingPattern */:
114794
115108
  return emitArrayBindingPattern(node);
114795
115109
  case 208 /* BindingElement */:
114796
115110
  return emitBindingElement(node);
115111
+ // Misc
114797
115112
  case 239 /* TemplateSpan */:
114798
115113
  return emitTemplateSpan(node);
114799
115114
  case 240 /* SemicolonClassElement */:
114800
115115
  return emitSemicolonClassElement();
115116
+ // Statements
114801
115117
  case 241 /* Block */:
114802
115118
  return emitBlock(node);
114803
115119
  case 243 /* VariableStatement */:
@@ -114839,6 +115155,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114839
115155
  return emitTryStatement(node);
114840
115156
  case 259 /* DebuggerStatement */:
114841
115157
  return emitDebuggerStatement(node);
115158
+ // Declarations
114842
115159
  case 260 /* VariableDeclaration */:
114843
115160
  return emitVariableDeclaration(node);
114844
115161
  case 261 /* VariableDeclarationList */:
@@ -114889,8 +115206,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114889
115206
  return emitImportAttribute(node);
114890
115207
  case 282 /* MissingDeclaration */:
114891
115208
  return;
115209
+ // Module references
114892
115210
  case 283 /* ExternalModuleReference */:
114893
115211
  return emitExternalModuleReference(node);
115212
+ // JSX (non-expression)
114894
115213
  case 12 /* JsxText */:
114895
115214
  return emitJsxText(node);
114896
115215
  case 286 /* JsxOpeningElement */:
@@ -114909,6 +115228,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114909
115228
  return emitJsxExpression(node);
114910
115229
  case 295 /* JsxNamespacedName */:
114911
115230
  return emitJsxNamespacedName(node);
115231
+ // Clauses
114912
115232
  case 296 /* CaseClause */:
114913
115233
  return emitCaseClause(node);
114914
115234
  case 297 /* DefaultClause */:
@@ -114917,18 +115237,22 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114917
115237
  return emitHeritageClause(node);
114918
115238
  case 299 /* CatchClause */:
114919
115239
  return emitCatchClause(node);
115240
+ // Property assignments
114920
115241
  case 303 /* PropertyAssignment */:
114921
115242
  return emitPropertyAssignment(node);
114922
115243
  case 304 /* ShorthandPropertyAssignment */:
114923
115244
  return emitShorthandPropertyAssignment(node);
114924
115245
  case 305 /* SpreadAssignment */:
114925
115246
  return emitSpreadAssignment(node);
115247
+ // Enum
114926
115248
  case 306 /* EnumMember */:
114927
115249
  return emitEnumMember(node);
115250
+ // Top-level nodes
114928
115251
  case 307 /* SourceFile */:
114929
115252
  return emitSourceFile(node);
114930
115253
  case 308 /* Bundle */:
114931
115254
  return Debug.fail("Bundles should be printed using printBundle");
115255
+ // JSDoc nodes (only used in codefixes currently)
114932
115256
  case 309 /* JSDocTypeExpression */:
114933
115257
  return emitJSDocTypeExpression(node);
114934
115258
  case 310 /* JSDocNameReference */:
@@ -114966,6 +115290,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114966
115290
  case 330 /* JSDocAuthorTag */:
114967
115291
  case 331 /* JSDocDeprecatedTag */:
114968
115292
  return;
115293
+ // SyntaxKind.JSDocClassTag (see JSDocTag, above)
114969
115294
  case 333 /* JSDocPublicTag */:
114970
115295
  case 334 /* JSDocPrivateTag */:
114971
115296
  case 335 /* JSDocProtectedTag */:
@@ -114975,6 +115300,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114975
115300
  return emitJSDocCallbackTag(node);
114976
115301
  case 339 /* JSDocOverloadTag */:
114977
115302
  return emitJSDocOverloadTag(node);
115303
+ // SyntaxKind.JSDocEnumTag (see below)
114978
115304
  case 341 /* JSDocParameterTag */:
114979
115305
  case 348 /* JSDocPropertyTag */:
114980
115306
  return emitJSDocPropertyLikeTag(node);
@@ -114993,7 +115319,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114993
115319
  return emitJSDocSeeTag(node);
114994
115320
  case 351 /* JSDocImportTag */:
114995
115321
  return emitJSDocImportTag(node);
115322
+ // SyntaxKind.JSDocPropertyTag (see JSDocParameterTag, above)
115323
+ // Transformation nodes
114996
115324
  case 353 /* NotEmittedStatement */:
115325
+ case 354 /* NotEmittedTypeElement */:
114997
115326
  return;
114998
115327
  }
114999
115328
  if (isExpression(node)) {
@@ -115011,6 +115340,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
115011
115340
  }
115012
115341
  if (hint === 1 /* Expression */) {
115013
115342
  switch (node.kind) {
115343
+ // Literals
115014
115344
  case 9 /* NumericLiteral */:
115015
115345
  case 10 /* BigIntLiteral */:
115016
115346
  return emitNumericOrBigIntLiteral(node);
@@ -115022,10 +115352,12 @@ function createPrinter(printerOptions = {}, handlers = {}) {
115022
115352
  /*jsxAttributeEscape*/
115023
115353
  false
115024
115354
  );
115355
+ // Identifiers
115025
115356
  case 80 /* Identifier */:
115026
115357
  return emitIdentifier(node);
115027
115358
  case 81 /* PrivateIdentifier */:
115028
115359
  return emitPrivateIdentifier(node);
115360
+ // Expressions
115029
115361
  case 209 /* ArrayLiteralExpression */:
115030
115362
  return emitArrayLiteralExpression(node);
115031
115363
  case 210 /* ObjectLiteralExpression */:
@@ -115088,21 +115420,24 @@ function createPrinter(printerOptions = {}, handlers = {}) {
115088
115420
  return Debug.fail("SyntheticExpression should never be printed.");
115089
115421
  case 282 /* MissingDeclaration */:
115090
115422
  return;
115423
+ // JSX
115091
115424
  case 284 /* JsxElement */:
115092
115425
  return emitJsxElement(node);
115093
115426
  case 285 /* JsxSelfClosingElement */:
115094
115427
  return emitJsxSelfClosingElement(node);
115095
115428
  case 288 /* JsxFragment */:
115096
115429
  return emitJsxFragment(node);
115430
+ // Synthesized list
115097
115431
  case 352 /* SyntaxList */:
115098
115432
  return Debug.fail("SyntaxList should not be printed");
115433
+ // Transformation nodes
115099
115434
  case 353 /* NotEmittedStatement */:
115100
115435
  return;
115101
- case 354 /* PartiallyEmittedExpression */:
115436
+ case 355 /* PartiallyEmittedExpression */:
115102
115437
  return emitPartiallyEmittedExpression(node);
115103
- case 355 /* CommaListExpression */:
115438
+ case 356 /* CommaListExpression */:
115104
115439
  return emitCommaList(node);
115105
- case 356 /* SyntheticReferenceExpression */:
115440
+ case 357 /* SyntheticReferenceExpression */:
115106
115441
  return Debug.fail("SyntheticReferenceExpression should not be printed");
115107
115442
  }
115108
115443
  }
@@ -121239,6 +121574,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
121239
121574
  diagnostics.push(createDiagnosticForNode2(node, Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?"));
121240
121575
  return "skip";
121241
121576
  }
121577
+ // falls through
121242
121578
  case 173 /* MethodSignature */:
121243
121579
  case 176 /* Constructor */:
121244
121580
  case 177 /* GetAccessor */:
@@ -121370,6 +121706,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
121370
121706
  diagnostics.push(createDiagnosticForNodeArray2(nodes, Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files));
121371
121707
  return "skip";
121372
121708
  }
121709
+ // falls through
121373
121710
  case 243 /* VariableStatement */:
121374
121711
  if (nodes === parent.modifiers) {
121375
121712
  checkModifiers(parent.modifiers, parent.kind === 243 /* VariableStatement */);
@@ -121412,6 +121749,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
121412
121749
  if (isConstValid) {
121413
121750
  continue;
121414
121751
  }
121752
+ // to report error,
121753
+ // falls through
121415
121754
  case 125 /* PublicKeyword */:
121416
121755
  case 123 /* PrivateKeyword */:
121417
121756
  case 124 /* ProtectedKeyword */:
@@ -121423,6 +121762,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
121423
121762
  case 147 /* OutKeyword */:
121424
121763
  diagnostics.push(createDiagnosticForNode2(modifier, Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, tokenToString(modifier.kind)));
121425
121764
  break;
121765
+ // These are all legal modifiers.
121426
121766
  case 126 /* StaticKeyword */:
121427
121767
  case 95 /* ExportKeyword */:
121428
121768
  case 90 /* DefaultKeyword */:
@@ -126828,6 +127168,7 @@ function getSourceFileVersionAsHashFromText(host, text) {
126828
127168
  if (pos && text.charCodeAt(pos - 1) === 13 /* carriageReturn */) {
126829
127169
  pos--;
126830
127170
  }
127171
+ // falls through
126831
127172
  case 13 /* carriageReturn */:
126832
127173
  break;
126833
127174
  default:
@@ -128314,6 +128655,7 @@ function createBuildOrUpdateInvalidedProject(state, project, projectPath, projec
128314
128655
  queueReferencingProjects(state, project, projectPath, projectIndex, config, buildOrder, Debug.checkDefined(buildResult));
128315
128656
  step++;
128316
128657
  break;
128658
+ // Should never be done
128317
128659
  case 3 /* Done */:
128318
128660
  default:
128319
128661
  assertType(step);
@@ -128854,6 +129196,7 @@ function queueReferencingProjects(state, project, projectPath, projectIndex, con
128854
129196
  status.type = 2 /* UpToDateWithUpstreamTypes */;
128855
129197
  break;
128856
129198
  }
129199
+ // falls through
128857
129200
  case 15 /* UpToDateWithInputFileText */:
128858
129201
  case 2 /* UpToDateWithUpstreamTypes */:
128859
129202
  if (!(buildResult & 2 /* DeclarationOutputUnchanged */)) {
@@ -129371,6 +129714,8 @@ function reportUpToDateStatus(state, configFileName, status) {
129371
129714
  relName(state, configFileName)
129372
129715
  );
129373
129716
  case 16 /* ContainerOnly */:
129717
+ // Don't report status on "solution" projects
129718
+ // falls through
129374
129719
  case 13 /* ComputingUpstream */:
129375
129720
  break;
129376
129721
  default: