@typescript-deploys/pr-build 5.0.0-pr-51753-15 → 5.0.0-pr-52217-7

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
@@ -23,7 +23,7 @@ var __export = (target, all) => {
23
23
 
24
24
  // src/compiler/corePublic.ts
25
25
  var versionMajorMinor = "5.0";
26
- var version = `${versionMajorMinor}.0-insiders.20230111`;
26
+ var version = `${versionMajorMinor}.0-insiders.20230113`;
27
27
 
28
28
  // src/compiler/core.ts
29
29
  var emptyArray = [];
@@ -3445,15 +3445,14 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind4) => {
3445
3445
  SyntaxKind4[SyntaxKind4["JSDocSeeTag"] = 350] = "JSDocSeeTag";
3446
3446
  SyntaxKind4[SyntaxKind4["JSDocPropertyTag"] = 351] = "JSDocPropertyTag";
3447
3447
  SyntaxKind4[SyntaxKind4["JSDocThrowsTag"] = 352] = "JSDocThrowsTag";
3448
- SyntaxKind4[SyntaxKind4["JSDocSatisfiesTag"] = 353] = "JSDocSatisfiesTag";
3449
- SyntaxKind4[SyntaxKind4["SyntaxList"] = 354] = "SyntaxList";
3450
- SyntaxKind4[SyntaxKind4["NotEmittedStatement"] = 355] = "NotEmittedStatement";
3451
- SyntaxKind4[SyntaxKind4["PartiallyEmittedExpression"] = 356] = "PartiallyEmittedExpression";
3452
- SyntaxKind4[SyntaxKind4["CommaListExpression"] = 357] = "CommaListExpression";
3453
- SyntaxKind4[SyntaxKind4["MergeDeclarationMarker"] = 358] = "MergeDeclarationMarker";
3454
- SyntaxKind4[SyntaxKind4["EndOfDeclarationMarker"] = 359] = "EndOfDeclarationMarker";
3455
- SyntaxKind4[SyntaxKind4["SyntheticReferenceExpression"] = 360] = "SyntheticReferenceExpression";
3456
- SyntaxKind4[SyntaxKind4["Count"] = 361] = "Count";
3448
+ SyntaxKind4[SyntaxKind4["SyntaxList"] = 353] = "SyntaxList";
3449
+ SyntaxKind4[SyntaxKind4["NotEmittedStatement"] = 354] = "NotEmittedStatement";
3450
+ SyntaxKind4[SyntaxKind4["PartiallyEmittedExpression"] = 355] = "PartiallyEmittedExpression";
3451
+ SyntaxKind4[SyntaxKind4["CommaListExpression"] = 356] = "CommaListExpression";
3452
+ SyntaxKind4[SyntaxKind4["MergeDeclarationMarker"] = 357] = "MergeDeclarationMarker";
3453
+ SyntaxKind4[SyntaxKind4["EndOfDeclarationMarker"] = 358] = "EndOfDeclarationMarker";
3454
+ SyntaxKind4[SyntaxKind4["SyntheticReferenceExpression"] = 359] = "SyntheticReferenceExpression";
3455
+ SyntaxKind4[SyntaxKind4["Count"] = 360] = "Count";
3457
3456
  SyntaxKind4[SyntaxKind4["FirstAssignment"] = 63 /* EqualsToken */] = "FirstAssignment";
3458
3457
  SyntaxKind4[SyntaxKind4["LastAssignment"] = 78 /* CaretEqualsToken */] = "LastAssignment";
3459
3458
  SyntaxKind4[SyntaxKind4["FirstCompoundAssignment"] = 64 /* PlusEqualsToken */] = "FirstCompoundAssignment";
@@ -3526,6 +3525,8 @@ var NodeFlags = /* @__PURE__ */ ((NodeFlags3) => {
3526
3525
  NodeFlags3[NodeFlags3["ContextFlags"] = 50720768] = "ContextFlags";
3527
3526
  NodeFlags3[NodeFlags3["TypeExcludesFlags"] = 40960] = "TypeExcludesFlags";
3528
3527
  NodeFlags3[NodeFlags3["PermanentlySetIncrementalFlags"] = 6291456] = "PermanentlySetIncrementalFlags";
3528
+ NodeFlags3[NodeFlags3["IdentifierHasExtendedUnicodeEscape"] = 128 /* ContainsThis */] = "IdentifierHasExtendedUnicodeEscape";
3529
+ NodeFlags3[NodeFlags3["IdentifierIsInJSDocNamespace"] = 2048 /* HasAsyncFunctions */] = "IdentifierIsInJSDocNamespace";
3529
3530
  return NodeFlags3;
3530
3531
  })(NodeFlags || {});
3531
3532
  var ModifierFlags = /* @__PURE__ */ ((ModifierFlags3) => {
@@ -6057,7 +6058,6 @@ var Diagnostics = {
6057
6058
  An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type: diag(1380, 1 /* Error */, "An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380", "An import alias cannot reference a declaration that was imported using 'import type'."),
6058
6059
  Unexpected_token_Did_you_mean_or_rbrace: diag(1381, 1 /* Error */, "Unexpected_token_Did_you_mean_or_rbrace_1381", "Unexpected token. Did you mean `{'}'}` or `}`?"),
6059
6060
  Unexpected_token_Did_you_mean_or_gt: diag(1382, 1 /* Error */, "Unexpected_token_Did_you_mean_or_gt_1382", "Unexpected token. Did you mean `{'>'}` or `>`?"),
6060
- Only_named_exports_may_use_export_type: diag(1383, 1 /* Error */, "Only_named_exports_may_use_export_type_1383", "Only named exports may use 'export type'."),
6061
6061
  Function_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1385, 1 /* Error */, "Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385", "Function type notation must be parenthesized when used in a union type."),
6062
6062
  Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1386, 1 /* Error */, "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386", "Constructor type notation must be parenthesized when used in a union type."),
6063
6063
  Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1387, 1 /* Error */, "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387", "Function type notation must be parenthesized when used in an intersection type."),
@@ -7146,6 +7146,8 @@ var Diagnostics = {
7146
7146
  package_json_scope_0_explicitly_maps_specifier_1_to_null: diag(6274, 3 /* Message */, "package_json_scope_0_explicitly_maps_specifier_1_to_null_6274", "package.json scope '{0}' explicitly maps specifier '{1}' to null."),
7147
7147
  package_json_scope_0_has_invalid_type_for_target_of_specifier_1: diag(6275, 3 /* Message */, "package_json_scope_0_has_invalid_type_for_target_of_specifier_1_6275", "package.json scope '{0}' has invalid type for target of specifier '{1}'"),
7148
7148
  Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6276, 3 /* Message */, "Export_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6276", "Export specifier '{0}' does not exist in package.json scope at path '{1}'."),
7149
+ Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update: diag(6277, 3 /* Message */, "Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_i_6277", "Resolution of non-relative name failed; trying with modern Node resolution features disabled to see if npm library needs configuration update."),
7150
+ There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings: diag(6278, 3 /* Message */, "There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The__6278", `There are types at '{0}', but this result could not be resolved when respecting package.json "exports". The '{1}' library may need to update its package.json or typings.`),
7149
7151
  Enable_project_compilation: diag(6302, 3 /* Message */, "Enable_project_compilation_6302", "Enable project compilation"),
7150
7152
  Composite_projects_may_not_disable_declaration_emit: diag(6304, 1 /* Error */, "Composite_projects_may_not_disable_declaration_emit_6304", "Composite projects may not disable declaration emit."),
7151
7153
  Output_file_0_has_not_been_built_from_source_file_1: diag(6305, 1 /* Error */, "Output_file_0_has_not_been_built_from_source_file_1_6305", "Output file '{0}' has not been built from source file '{1}'."),
@@ -8405,7 +8407,8 @@ function isIdentifierStart(ch, languageVersion) {
8405
8407
  return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch === 36 /* $ */ || ch === 95 /* _ */ || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion);
8406
8408
  }
8407
8409
  function isIdentifierPart(ch, languageVersion, identifierVariant) {
8408
- return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || (identifierVariant === 1 /* JSX */ ? ch === 45 /* minus */ || ch === 58 /* colon */ : false) || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion);
8410
+ return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || // "-" and ":" are valid in JSX Identifiers
8411
+ (identifierVariant === 1 /* JSX */ ? ch === 45 /* minus */ || ch === 58 /* colon */ : false) || ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion);
8409
8412
  }
8410
8413
  function isIdentifierText(name, languageVersion, identifierVariant) {
8411
8414
  let ch = codePointAt(name, 0);
@@ -10108,6 +10111,10 @@ function unescapeLeadingUnderscores(identifier) {
10108
10111
  function idText(identifierOrPrivateName) {
10109
10112
  return unescapeLeadingUnderscores(identifierOrPrivateName.escapedText);
10110
10113
  }
10114
+ function identifierToKeywordKind(node) {
10115
+ const token = stringToToken(node.escapedText);
10116
+ return token ? tryCast(token, isKeyword) : void 0;
10117
+ }
10111
10118
  function symbolName(symbol) {
10112
10119
  if (symbol.valueDeclaration && isPrivateIdentifierClassElementDeclaration(symbol.valueDeclaration)) {
10113
10120
  return idText(symbol.valueDeclaration.name);
@@ -10368,9 +10375,6 @@ function getJSDocThisTag(node) {
10368
10375
  function getJSDocReturnTag(node) {
10369
10376
  return getFirstJSDocTag(node, isJSDocReturnTag);
10370
10377
  }
10371
- function getJSDocSatisfiesTag(node) {
10372
- return getFirstJSDocTag(node, isJSDocSatisfiesTag);
10373
- }
10374
10378
  function getJSDocTypeTag(node) {
10375
10379
  const tag = getFirstJSDocTag(node, isJSDocTypeTag);
10376
10380
  if (tag && tag.typeExpression && tag.typeExpression.type) {
@@ -10403,15 +10407,17 @@ function getJSDocReturnType(node) {
10403
10407
  }
10404
10408
  }
10405
10409
  function getJSDocTagsWorker(node, noCache) {
10410
+ var _a2, _b;
10406
10411
  if (!canHaveJSDoc(node))
10407
10412
  return emptyArray;
10408
- let tags = node.jsDocCache;
10413
+ let tags = (_a2 = node.jsDoc) == null ? void 0 : _a2.jsDocCache;
10409
10414
  if (tags === void 0 || noCache) {
10410
10415
  const comments = getJSDocCommentsAndTags(node, noCache);
10411
10416
  Debug.assert(comments.length < 2 || comments[0] !== comments[1]);
10412
10417
  tags = flatMap(comments, (j) => isJSDoc(j) ? j.tags : j);
10413
10418
  if (!noCache) {
10414
- node.jsDocCache = tags;
10419
+ (_b = node.jsDoc) != null ? _b : node.jsDoc = [];
10420
+ node.jsDoc.jsDocCache = tags;
10415
10421
  }
10416
10422
  }
10417
10423
  return tags;
@@ -10570,28 +10576,42 @@ function isTemplateMiddleOrTemplateTail(node) {
10570
10576
  function isImportOrExportSpecifier(node) {
10571
10577
  return isImportSpecifier(node) || isExportSpecifier(node);
10572
10578
  }
10573
- function isTypeOnlyImportOrExportDeclaration(node) {
10579
+ function isTypeOnlyImportDeclaration(node) {
10574
10580
  switch (node.kind) {
10575
10581
  case 273 /* ImportSpecifier */:
10576
- case 278 /* ExportSpecifier */:
10577
10582
  return node.isTypeOnly || node.parent.parent.isTypeOnly;
10578
10583
  case 271 /* NamespaceImport */:
10579
10584
  return node.parent.isTypeOnly;
10580
10585
  case 270 /* ImportClause */:
10581
10586
  case 268 /* ImportEqualsDeclaration */:
10582
10587
  return node.isTypeOnly;
10583
- default:
10584
- return false;
10585
10588
  }
10589
+ return false;
10590
+ }
10591
+ function isTypeOnlyExportDeclaration(node) {
10592
+ switch (node.kind) {
10593
+ case 278 /* ExportSpecifier */:
10594
+ return node.isTypeOnly || node.parent.parent.isTypeOnly;
10595
+ case 275 /* ExportDeclaration */:
10596
+ return node.isTypeOnly && !!node.moduleSpecifier && !node.exportClause;
10597
+ case 277 /* NamespaceExport */:
10598
+ return node.parent.isTypeOnly;
10599
+ }
10600
+ return false;
10601
+ }
10602
+ function isTypeOnlyImportOrExportDeclaration(node) {
10603
+ return isTypeOnlyImportDeclaration(node) || isTypeOnlyExportDeclaration(node);
10586
10604
  }
10587
10605
  function isAssertionKey(node) {
10588
10606
  return isStringLiteral(node) || isIdentifier(node);
10589
10607
  }
10590
10608
  function isGeneratedIdentifier(node) {
10591
- return isIdentifier(node) && node.autoGenerate !== void 0;
10609
+ var _a2;
10610
+ return isIdentifier(node) && ((_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate) !== void 0;
10592
10611
  }
10593
10612
  function isGeneratedPrivateIdentifier(node) {
10594
- return isPrivateIdentifier(node) && node.autoGenerate !== void 0;
10613
+ var _a2;
10614
+ return isPrivateIdentifier(node) && ((_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate) !== void 0;
10595
10615
  }
10596
10616
  function isPrivateIdentifierClassElementDeclaration(node) {
10597
10617
  return (isPropertyDeclaration(node) || isMethodOrAccessor(node)) && isPrivateIdentifier(node.name);
@@ -10873,8 +10893,8 @@ function isExpressionKind(kind) {
10873
10893
  case 227 /* SpreadElement */:
10874
10894
  case 231 /* AsExpression */:
10875
10895
  case 229 /* OmittedExpression */:
10876
- case 357 /* CommaListExpression */:
10877
- case 356 /* PartiallyEmittedExpression */:
10896
+ case 356 /* CommaListExpression */:
10897
+ case 355 /* PartiallyEmittedExpression */:
10878
10898
  case 235 /* SatisfiesExpression */:
10879
10899
  return true;
10880
10900
  default:
@@ -11045,7 +11065,7 @@ function isDeclarationStatementKind(kind) {
11045
11065
  return kind === 259 /* FunctionDeclaration */ || kind === 279 /* MissingDeclaration */ || kind === 260 /* ClassDeclaration */ || kind === 261 /* InterfaceDeclaration */ || kind === 262 /* TypeAliasDeclaration */ || kind === 263 /* EnumDeclaration */ || kind === 264 /* ModuleDeclaration */ || kind === 269 /* ImportDeclaration */ || kind === 268 /* ImportEqualsDeclaration */ || kind === 275 /* ExportDeclaration */ || kind === 274 /* ExportAssignment */ || kind === 267 /* NamespaceExportDeclaration */;
11046
11066
  }
11047
11067
  function isStatementKindButNotDeclarationKind(kind) {
11048
- return kind === 249 /* BreakStatement */ || kind === 248 /* ContinueStatement */ || kind === 256 /* DebuggerStatement */ || kind === 243 /* DoStatement */ || kind === 241 /* ExpressionStatement */ || kind === 239 /* EmptyStatement */ || kind === 246 /* ForInStatement */ || kind === 247 /* ForOfStatement */ || kind === 245 /* ForStatement */ || kind === 242 /* IfStatement */ || kind === 253 /* LabeledStatement */ || kind === 250 /* ReturnStatement */ || kind === 252 /* SwitchStatement */ || kind === 254 /* ThrowStatement */ || kind === 255 /* TryStatement */ || kind === 240 /* VariableStatement */ || kind === 244 /* WhileStatement */ || kind === 251 /* WithStatement */ || kind === 355 /* NotEmittedStatement */ || kind === 359 /* EndOfDeclarationMarker */ || kind === 358 /* MergeDeclarationMarker */;
11068
+ return kind === 249 /* BreakStatement */ || kind === 248 /* ContinueStatement */ || kind === 256 /* DebuggerStatement */ || kind === 243 /* DoStatement */ || kind === 241 /* ExpressionStatement */ || kind === 239 /* EmptyStatement */ || kind === 246 /* ForInStatement */ || kind === 247 /* ForOfStatement */ || kind === 245 /* ForStatement */ || kind === 242 /* IfStatement */ || kind === 253 /* LabeledStatement */ || kind === 250 /* ReturnStatement */ || kind === 252 /* SwitchStatement */ || kind === 254 /* ThrowStatement */ || kind === 255 /* TryStatement */ || kind === 240 /* VariableStatement */ || kind === 244 /* WhileStatement */ || kind === 251 /* WithStatement */ || kind === 354 /* NotEmittedStatement */ || kind === 358 /* EndOfDeclarationMarker */ || kind === 357 /* MergeDeclarationMarker */;
11049
11069
  }
11050
11070
  function isDeclaration(node) {
11051
11071
  if (node.kind === 165 /* TypeParameter */) {
@@ -11497,7 +11517,7 @@ function getTokenPosOfNode(node, sourceFile, includeJsDoc) {
11497
11517
  if (includeJsDoc && hasJSDocNodes(node)) {
11498
11518
  return getTokenPosOfNode(node.jsDoc[0], sourceFile);
11499
11519
  }
11500
- if (node.kind === 354 /* SyntaxList */ && node._children.length > 0) {
11520
+ if (node.kind === 353 /* SyntaxList */ && node._children.length > 0) {
11501
11521
  return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc);
11502
11522
  }
11503
11523
  return skipTrivia(
@@ -11835,10 +11855,11 @@ function isComputedNonLiteralName(name) {
11835
11855
  return name.kind === 164 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression);
11836
11856
  }
11837
11857
  function tryGetTextOfPropertyName(name) {
11858
+ var _a2;
11838
11859
  switch (name.kind) {
11839
11860
  case 79 /* Identifier */:
11840
11861
  case 80 /* PrivateIdentifier */:
11841
- return name.autoGenerate ? void 0 : name.escapedText;
11862
+ return ((_a2 = name.emitNode) == null ? void 0 : _a2.autoGenerate) ? void 0 : name.escapedText;
11842
11863
  case 10 /* StringLiteral */:
11843
11864
  case 8 /* NumericLiteral */:
11844
11865
  case 14 /* NoSubstitutionTemplateLiteral */:
@@ -11956,6 +11977,20 @@ function getSpanOfTokenAtPosition(sourceFile, pos) {
11956
11977
  const start = scanner.getTokenPos();
11957
11978
  return createTextSpanFromBounds(start, scanner.getTextPos());
11958
11979
  }
11980
+ function scanTokenAtPosition(sourceFile, pos) {
11981
+ const scanner = createScanner(
11982
+ sourceFile.languageVersion,
11983
+ /*skipTrivia*/
11984
+ true,
11985
+ sourceFile.languageVariant,
11986
+ sourceFile.text,
11987
+ /*onError:*/
11988
+ void 0,
11989
+ pos
11990
+ );
11991
+ scanner.scan();
11992
+ return scanner.getToken();
11993
+ }
11959
11994
  function getErrorSpanForArrowFunction(sourceFile, node) {
11960
11995
  const pos = skipTrivia(sourceFile.text, node.pos);
11961
11996
  if (node.body && node.body.kind === 238 /* Block */) {
@@ -13556,7 +13591,8 @@ function isStringANonContextualKeyword(name) {
13556
13591
  const token = stringToToken(name);
13557
13592
  return token !== void 0 && isNonContextualKeyword(token);
13558
13593
  }
13559
- function isIdentifierANonContextualKeyword({ originalKeywordKind }) {
13594
+ function isIdentifierANonContextualKeyword(node) {
13595
+ const originalKeywordKind = identifierToKeywordKind(node);
13560
13596
  return !!originalKeywordKind && !isContextualKeyword(originalKeywordKind);
13561
13597
  }
13562
13598
  function getFunctionFlags(node) {
@@ -13732,7 +13768,7 @@ function getOperator(expression) {
13732
13768
  }
13733
13769
  function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
13734
13770
  switch (nodeKind) {
13735
- case 357 /* CommaListExpression */:
13771
+ case 356 /* CommaListExpression */:
13736
13772
  return 0 /* Comma */;
13737
13773
  case 227 /* SpreadElement */:
13738
13774
  return 1 /* Spread */;
@@ -14368,7 +14404,7 @@ function isThisInTypeQuery(node) {
14368
14404
  return node.parent.kind === 183 /* TypeQuery */;
14369
14405
  }
14370
14406
  function identifierIsThisKeyword(id) {
14371
- return id.originalKeywordKind === 108 /* ThisKeyword */;
14407
+ return id.escapedText === "this";
14372
14408
  }
14373
14409
  function getAllAccessorDeclarations(declarations, accessor) {
14374
14410
  let firstAccessor;
@@ -14667,7 +14703,7 @@ function getEffectiveModifierFlagsNoCache(node) {
14667
14703
  }
14668
14704
  function getSyntacticModifierFlagsNoCache(node) {
14669
14705
  let flags = canHaveModifiers(node) ? modifiersToFlags(node.modifiers) : 0 /* None */;
14670
- if (node.flags & 4 /* NestedNamespace */ || node.kind === 79 /* Identifier */ && node.isInJSDocNamespace) {
14706
+ if (node.flags & 4 /* NestedNamespace */ || node.kind === 79 /* Identifier */ && node.flags & 2048 /* IdentifierIsInJSDocNamespace */) {
14671
14707
  flags |= 1 /* Export */;
14672
14708
  }
14673
14709
  return flags;
@@ -15236,7 +15272,7 @@ function getLeftmostExpression(node, stopAtCallExpressions) {
15236
15272
  case 209 /* ElementAccessExpression */:
15237
15273
  case 208 /* PropertyAccessExpression */:
15238
15274
  case 232 /* NonNullExpression */:
15239
- case 356 /* PartiallyEmittedExpression */:
15275
+ case 355 /* PartiallyEmittedExpression */:
15240
15276
  case 235 /* SatisfiesExpression */:
15241
15277
  node = node.expression;
15242
15278
  continue;
@@ -15304,7 +15340,6 @@ function Identifier2(kind, pos, end) {
15304
15340
  this.parent = void 0;
15305
15341
  this.original = void 0;
15306
15342
  this.emitNode = void 0;
15307
- this.flowNode = void 0;
15308
15343
  }
15309
15344
  function SourceMapSource(fileName, text, skipTrivia2) {
15310
15345
  this.fileName = fileName;
@@ -16472,7 +16507,7 @@ function getContainingNodeArray(node) {
16472
16507
  return parent.types;
16473
16508
  case 186 /* TupleType */:
16474
16509
  case 206 /* ArrayLiteralExpression */:
16475
- case 357 /* CommaListExpression */:
16510
+ case 356 /* CommaListExpression */:
16476
16511
  case 272 /* NamedImports */:
16477
16512
  case 276 /* NamedExports */:
16478
16513
  return parent.elements;
@@ -16646,18 +16681,6 @@ function isNonNullAccess(node) {
16646
16681
  const kind = node.kind;
16647
16682
  return (kind === 208 /* PropertyAccessExpression */ || kind === 209 /* ElementAccessExpression */) && isNonNullExpression(node.expression);
16648
16683
  }
16649
- function isJSDocSatisfiesExpression(node) {
16650
- return isInJSFile(node) && isParenthesizedExpression(node) && !!getJSDocSatisfiesTag(node);
16651
- }
16652
- function getJSDocSatisfiesExpressionType(node) {
16653
- const type = getJSDocSatisfiesTypeNode(node);
16654
- Debug.assertIsDefined(type);
16655
- return type;
16656
- }
16657
- function getJSDocSatisfiesTypeNode(node) {
16658
- const tag = getJSDocSatisfiesTag(node);
16659
- return tag && tag.typeExpression && tag.typeExpression.type;
16660
- }
16661
16684
 
16662
16685
  // src/compiler/factory/baseNodeFactory.ts
16663
16686
  function createBaseNodeFactory() {
@@ -17262,7 +17285,6 @@ function createNodeFactory(flags, baseFactory2) {
17262
17285
  createRegularExpressionLiteral,
17263
17286
  createLiteralLikeNode,
17264
17287
  createIdentifier,
17265
- updateIdentifier,
17266
17288
  createTempVariable,
17267
17289
  createLoopVariable,
17268
17290
  createUniqueName,
@@ -17672,12 +17694,6 @@ function createNodeFactory(flags, baseFactory2) {
17672
17694
  get updateJSDocThrowsTag() {
17673
17695
  return getJSDocTypeLikeTagUpdateFunction(352 /* JSDocThrowsTag */);
17674
17696
  },
17675
- get createJSDocSatisfiesTag() {
17676
- return getJSDocTypeLikeTagCreateFunction(353 /* JSDocSatisfiesTag */);
17677
- },
17678
- get updateJSDocSatisfiesTag() {
17679
- return getJSDocTypeLikeTagUpdateFunction(353 /* JSDocSatisfiesTag */);
17680
- },
17681
17697
  createJSDocEnumTag,
17682
17698
  updateJSDocEnumTag,
17683
17699
  createJSDocUnknownTag,
@@ -18011,55 +18027,43 @@ function createNodeFactory(flags, baseFactory2) {
18011
18027
  );
18012
18028
  }
18013
18029
  }
18014
- function createBaseIdentifier(escapedText, originalKeywordKind) {
18030
+ function createBaseIdentifier(escapedText) {
18015
18031
  const node = baseFactory2.createBaseIdentifierNode(79 /* Identifier */);
18016
- node.originalKeywordKind = originalKeywordKind;
18017
18032
  node.escapedText = escapedText;
18018
- node.autoGenerate = void 0;
18019
- node.typeArguments = void 0;
18020
- node.hasExtendedUnicodeEscape = void 0;
18021
18033
  node.jsDoc = void 0;
18022
- node.jsDocCache = void 0;
18023
18034
  node.flowNode = void 0;
18024
18035
  node.symbol = void 0;
18025
18036
  return node;
18026
18037
  }
18027
18038
  function createBaseGeneratedIdentifier(text, autoGenerateFlags, prefix, suffix) {
18028
- const node = createBaseIdentifier(
18029
- escapeLeadingUnderscores(text),
18030
- /*originalKeywordKind*/
18031
- void 0
18032
- );
18033
- node.autoGenerate = {
18039
+ const node = createBaseIdentifier(escapeLeadingUnderscores(text));
18040
+ setIdentifierAutoGenerate(node, {
18034
18041
  flags: autoGenerateFlags,
18035
18042
  id: nextAutoGenerateId,
18036
18043
  prefix,
18037
18044
  suffix
18038
- };
18045
+ });
18039
18046
  nextAutoGenerateId++;
18040
18047
  return node;
18041
18048
  }
18042
- function createIdentifier(text, typeArguments, originalKeywordKind, hasExtendedUnicodeEscape) {
18049
+ function createIdentifier(text, originalKeywordKind, hasExtendedUnicodeEscape) {
18043
18050
  if (originalKeywordKind === void 0 && text) {
18044
18051
  originalKeywordKind = stringToToken(text);
18045
18052
  }
18046
18053
  if (originalKeywordKind === 79 /* Identifier */) {
18047
18054
  originalKeywordKind = void 0;
18048
18055
  }
18049
- const node = createBaseIdentifier(escapeLeadingUnderscores(text), originalKeywordKind);
18050
- node.typeArguments = asNodeArray(typeArguments);
18051
- node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape;
18052
- if (node.originalKeywordKind === 133 /* AwaitKeyword */) {
18056
+ const node = createBaseIdentifier(escapeLeadingUnderscores(text));
18057
+ if (hasExtendedUnicodeEscape)
18058
+ node.flags |= 128 /* IdentifierHasExtendedUnicodeEscape */;
18059
+ if (node.escapedText === "await") {
18053
18060
  node.transformFlags |= 67108864 /* ContainsPossibleTopLevelAwait */;
18054
18061
  }
18055
- if (node.hasExtendedUnicodeEscape) {
18062
+ if (node.flags & 128 /* IdentifierHasExtendedUnicodeEscape */) {
18056
18063
  node.transformFlags |= 1024 /* ContainsES2015 */;
18057
18064
  }
18058
18065
  return node;
18059
18066
  }
18060
- function updateIdentifier(node, typeArguments) {
18061
- return node.typeArguments !== typeArguments ? update(createIdentifier(idText(node), typeArguments), node) : node;
18062
- }
18063
18067
  function createTempVariable(recordTempVariable, reservedInNestedScopes, prefix, suffix) {
18064
18068
  let flags2 = 1 /* Auto */;
18065
18069
  if (reservedInNestedScopes)
@@ -18107,7 +18111,6 @@ function createNodeFactory(flags, baseFactory2) {
18107
18111
  function createBasePrivateIdentifier(escapedText) {
18108
18112
  const node = baseFactory2.createBasePrivateIdentifierNode(80 /* PrivateIdentifier */);
18109
18113
  node.escapedText = escapedText;
18110
- node.autoGenerate = void 0;
18111
18114
  node.transformFlags |= 16777216 /* ContainsClassFields */;
18112
18115
  return node;
18113
18116
  }
@@ -18118,12 +18121,12 @@ function createNodeFactory(flags, baseFactory2) {
18118
18121
  }
18119
18122
  function createBaseGeneratedPrivateIdentifier(text, autoGenerateFlags, prefix, suffix) {
18120
18123
  const node = createBasePrivateIdentifier(escapeLeadingUnderscores(text));
18121
- node.autoGenerate = {
18124
+ setIdentifierAutoGenerate(node, {
18122
18125
  flags: autoGenerateFlags,
18123
18126
  id: nextAutoGenerateId,
18124
18127
  prefix,
18125
18128
  suffix
18126
- };
18129
+ });
18127
18130
  nextAutoGenerateId++;
18128
18131
  return node;
18129
18132
  }
@@ -18285,7 +18288,6 @@ function createNodeFactory(flags, baseFactory2) {
18285
18288
  node.transformFlags = 1 /* ContainsTypeScript */;
18286
18289
  node.expression = void 0;
18287
18290
  node.jsDoc = void 0;
18288
- node.jsDocCache = void 0;
18289
18291
  return node;
18290
18292
  }
18291
18293
  function updateTypeParameterDeclaration(node, modifiers, name, constraint, defaultType) {
@@ -18306,7 +18308,6 @@ function createNodeFactory(flags, baseFactory2) {
18306
18308
  node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.dotDotDotToken) | propagateNameFlags(node.name) | propagateChildFlags(node.questionToken) | propagateChildFlags(node.initializer) | (((_a2 = node.questionToken) != null ? _a2 : node.type) ? 1 /* ContainsTypeScript */ : 0 /* None */) | (((_b = node.dotDotDotToken) != null ? _b : node.initializer) ? 1024 /* ContainsES2015 */ : 0 /* None */) | (modifiersToFlags(node.modifiers) & 16476 /* ParameterPropertyModifier */ ? 8192 /* ContainsTypeScriptClassSyntax */ : 0 /* None */);
18307
18309
  }
18308
18310
  node.jsDoc = void 0;
18309
- node.jsDocCache = void 0;
18310
18311
  return node;
18311
18312
  }
18312
18313
  function updateParameterDeclaration(node, modifiers, dotDotDotToken, name, questionToken, type, initializer) {
@@ -18334,7 +18335,6 @@ function createNodeFactory(flags, baseFactory2) {
18334
18335
  node.transformFlags = 1 /* ContainsTypeScript */;
18335
18336
  node.initializer = void 0;
18336
18337
  node.jsDoc = void 0;
18337
- node.jsDocCache = void 0;
18338
18338
  return node;
18339
18339
  }
18340
18340
  function updatePropertySignature(node, modifiers, name, questionToken, type) {
@@ -18357,7 +18357,6 @@ function createNodeFactory(flags, baseFactory2) {
18357
18357
  const isAmbient = node.flags & 16777216 /* Ambient */ || modifiersToFlags(node.modifiers) & 2 /* Ambient */;
18358
18358
  node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildFlags(node.initializer) | (isAmbient || node.questionToken || node.exclamationToken || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | (isComputedPropertyName(node.name) || modifiersToFlags(node.modifiers) & 32 /* Static */ && node.initializer ? 8192 /* ContainsTypeScriptClassSyntax */ : 0 /* None */) | 16777216 /* ContainsClassFields */;
18359
18359
  node.jsDoc = void 0;
18360
- node.jsDocCache = void 0;
18361
18360
  return node;
18362
18361
  }
18363
18362
  function updatePropertyDeclaration(node, modifiers, name, questionOrExclamationToken, type, initializer) {
@@ -18373,7 +18372,6 @@ function createNodeFactory(flags, baseFactory2) {
18373
18372
  node.type = type;
18374
18373
  node.transformFlags = 1 /* ContainsTypeScript */;
18375
18374
  node.jsDoc = void 0;
18376
- node.jsDocCache = void 0;
18377
18375
  node.locals = void 0;
18378
18376
  node.nextContainer = void 0;
18379
18377
  node.typeArguments = void 0;
@@ -18403,7 +18401,6 @@ function createNodeFactory(flags, baseFactory2) {
18403
18401
  }
18404
18402
  node.typeArguments = void 0;
18405
18403
  node.jsDoc = void 0;
18406
- node.jsDocCache = void 0;
18407
18404
  node.locals = void 0;
18408
18405
  node.nextContainer = void 0;
18409
18406
  node.flowNode = void 0;
@@ -18427,7 +18424,6 @@ function createNodeFactory(flags, baseFactory2) {
18427
18424
  node.illegalDecorators = void 0;
18428
18425
  node.modifiers = void 0;
18429
18426
  node.jsDoc = void 0;
18430
- node.jsDocCache = void 0;
18431
18427
  node.locals = void 0;
18432
18428
  node.nextContainer = void 0;
18433
18429
  node.endFlowNode = void 0;
@@ -18455,7 +18451,6 @@ function createNodeFactory(flags, baseFactory2) {
18455
18451
  node.type = void 0;
18456
18452
  node.typeArguments = void 0;
18457
18453
  node.jsDoc = void 0;
18458
- node.jsDocCache = void 0;
18459
18454
  node.locals = void 0;
18460
18455
  node.nextContainer = void 0;
18461
18456
  node.endFlowNode = void 0;
@@ -18488,7 +18483,6 @@ function createNodeFactory(flags, baseFactory2) {
18488
18483
  node.typeArguments = void 0;
18489
18484
  node.typeParameters = void 0;
18490
18485
  node.jsDoc = void 0;
18491
- node.jsDocCache = void 0;
18492
18486
  node.locals = void 0;
18493
18487
  node.nextContainer = void 0;
18494
18488
  node.flowNode = void 0;
@@ -18520,7 +18514,6 @@ function createNodeFactory(flags, baseFactory2) {
18520
18514
  node.typeParameters = void 0;
18521
18515
  node.type = void 0;
18522
18516
  node.jsDoc = void 0;
18523
- node.jsDocCache = void 0;
18524
18517
  node.locals = void 0;
18525
18518
  node.nextContainer = void 0;
18526
18519
  node.flowNode = void 0;
@@ -18545,7 +18538,6 @@ function createNodeFactory(flags, baseFactory2) {
18545
18538
  node.type = type;
18546
18539
  node.transformFlags = 1 /* ContainsTypeScript */;
18547
18540
  node.jsDoc = void 0;
18548
- node.jsDocCache = void 0;
18549
18541
  node.locals = void 0;
18550
18542
  node.nextContainer = void 0;
18551
18543
  node.typeArguments = void 0;
@@ -18561,7 +18553,6 @@ function createNodeFactory(flags, baseFactory2) {
18561
18553
  node.type = type;
18562
18554
  node.transformFlags = 1 /* ContainsTypeScript */;
18563
18555
  node.jsDoc = void 0;
18564
- node.jsDocCache = void 0;
18565
18556
  node.locals = void 0;
18566
18557
  node.nextContainer = void 0;
18567
18558
  node.typeArguments = void 0;
@@ -18578,7 +18569,6 @@ function createNodeFactory(flags, baseFactory2) {
18578
18569
  node.transformFlags = 1 /* ContainsTypeScript */;
18579
18570
  node.illegalDecorators = void 0;
18580
18571
  node.jsDoc = void 0;
18581
- node.jsDocCache = void 0;
18582
18572
  node.locals = void 0;
18583
18573
  node.nextContainer = void 0;
18584
18574
  node.typeArguments = void 0;
@@ -18629,7 +18619,6 @@ function createNodeFactory(flags, baseFactory2) {
18629
18619
  node.transformFlags = 1 /* ContainsTypeScript */;
18630
18620
  node.modifiers = void 0;
18631
18621
  node.jsDoc = void 0;
18632
- node.jsDocCache = void 0;
18633
18622
  node.locals = void 0;
18634
18623
  node.nextContainer = void 0;
18635
18624
  node.typeArguments = void 0;
@@ -18655,7 +18644,6 @@ function createNodeFactory(flags, baseFactory2) {
18655
18644
  node.type = type;
18656
18645
  node.transformFlags = 1 /* ContainsTypeScript */;
18657
18646
  node.jsDoc = void 0;
18658
- node.jsDocCache = void 0;
18659
18647
  node.locals = void 0;
18660
18648
  node.nextContainer = void 0;
18661
18649
  node.typeArguments = void 0;
@@ -18724,7 +18712,6 @@ function createNodeFactory(flags, baseFactory2) {
18724
18712
  node.type = type;
18725
18713
  node.transformFlags = 1 /* ContainsTypeScript */;
18726
18714
  node.jsDoc = void 0;
18727
- node.jsDocCache = void 0;
18728
18715
  return node;
18729
18716
  }
18730
18717
  function updateNamedTupleMember(node, dotDotDotToken, name, questionToken, type) {
@@ -18926,7 +18913,6 @@ function createNodeFactory(flags, baseFactory2) {
18926
18913
  node.multiLine = multiLine;
18927
18914
  node.transformFlags |= propagateChildrenFlags(node.properties);
18928
18915
  node.jsDoc = void 0;
18929
- node.jsDocCache = void 0;
18930
18916
  return node;
18931
18917
  }
18932
18918
  function updateObjectLiteralExpression(node, properties) {
@@ -18939,7 +18925,6 @@ function createNodeFactory(flags, baseFactory2) {
18939
18925
  node.name = name;
18940
18926
  node.transformFlags = propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | (isIdentifier(node.name) ? propagateIdentifierNameFlags(node.name) : propagateChildFlags(node.name) | 536870912 /* ContainsPrivateIdentifierInExpression */);
18941
18927
  node.jsDoc = void 0;
18942
- node.jsDocCache = void 0;
18943
18928
  node.flowNode = void 0;
18944
18929
  return node;
18945
18930
  }
@@ -18990,7 +18975,6 @@ function createNodeFactory(flags, baseFactory2) {
18990
18975
  node.argumentExpression = argumentExpression;
18991
18976
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.questionDotToken) | propagateChildFlags(node.argumentExpression);
18992
18977
  node.jsDoc = void 0;
18993
- node.jsDocCache = void 0;
18994
18978
  node.flowNode = void 0;
18995
18979
  return node;
18996
18980
  }
@@ -19141,7 +19125,6 @@ function createNodeFactory(flags, baseFactory2) {
19141
19125
  node.expression = expression;
19142
19126
  node.transformFlags = propagateChildFlags(node.expression);
19143
19127
  node.jsDoc = void 0;
19144
- node.jsDocCache = void 0;
19145
19128
  return node;
19146
19129
  }
19147
19130
  function updateParenthesizedExpression(node, expression) {
@@ -19162,7 +19145,6 @@ function createNodeFactory(flags, baseFactory2) {
19162
19145
  node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.asteriskToken) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (isAsyncGenerator ? 128 /* ContainsES2018 */ : isAsync ? 256 /* ContainsES2017 */ : isGenerator ? 2048 /* ContainsGenerator */ : 0 /* None */) | (node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
19163
19146
  node.typeArguments = void 0;
19164
19147
  node.jsDoc = void 0;
19165
- node.jsDocCache = void 0;
19166
19148
  node.locals = void 0;
19167
19149
  node.nextContainer = void 0;
19168
19150
  node.flowNode = void 0;
@@ -19185,7 +19167,6 @@ function createNodeFactory(flags, baseFactory2) {
19185
19167
  node.transformFlags = propagateChildrenFlags(node.modifiers) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.parameters) | propagateChildFlags(node.type) | propagateChildFlags(node.equalsGreaterThanToken) | propagateChildFlags(node.body) & ~67108864 /* ContainsPossibleTopLevelAwait */ | (node.typeParameters || node.type ? 1 /* ContainsTypeScript */ : 0 /* None */) | (isAsync ? 256 /* ContainsES2017 */ | 16384 /* ContainsLexicalThis */ : 0 /* None */) | 1024 /* ContainsES2015 */;
19186
19168
  node.typeArguments = void 0;
19187
19169
  node.jsDoc = void 0;
19188
- node.jsDocCache = void 0;
19189
19170
  node.locals = void 0;
19190
19171
  node.nextContainer = void 0;
19191
19172
  node.flowNode = void 0;
@@ -19283,7 +19264,6 @@ function createNodeFactory(flags, baseFactory2) {
19283
19264
  node.transformFlags |= 536870912 /* ContainsPrivateIdentifierInExpression */;
19284
19265
  }
19285
19266
  node.jsDoc = void 0;
19286
- node.jsDocCache = void 0;
19287
19267
  return node;
19288
19268
  }
19289
19269
  function propagateAssignmentPatternFlags(node) {
@@ -19425,7 +19405,6 @@ function createNodeFactory(flags, baseFactory2) {
19425
19405
  node.members = createNodeArray(members);
19426
19406
  node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateNameFlags(node.name) | propagateChildrenFlags(node.typeParameters) | propagateChildrenFlags(node.heritageClauses) | propagateChildrenFlags(node.members) | (node.typeParameters ? 1 /* ContainsTypeScript */ : 0 /* None */) | 1024 /* ContainsES2015 */;
19427
19407
  node.jsDoc = void 0;
19428
- node.jsDocCache = void 0;
19429
19408
  return node;
19430
19409
  }
19431
19410
  function updateClassExpression(node, modifiers, name, typeParameters, heritageClauses, members) {
@@ -19541,7 +19520,6 @@ function createNodeFactory(flags, baseFactory2) {
19541
19520
  node.multiLine = multiLine;
19542
19521
  node.transformFlags |= propagateChildrenFlags(node.statements);
19543
19522
  node.jsDoc = void 0;
19544
- node.jsDocCache = void 0;
19545
19523
  node.locals = void 0;
19546
19524
  node.nextContainer = void 0;
19547
19525
  return node;
@@ -19559,7 +19537,6 @@ function createNodeFactory(flags, baseFactory2) {
19559
19537
  }
19560
19538
  node.illegalDecorators = void 0;
19561
19539
  node.jsDoc = void 0;
19562
- node.jsDocCache = void 0;
19563
19540
  node.flowNode = void 0;
19564
19541
  return node;
19565
19542
  }
@@ -19569,7 +19546,6 @@ function createNodeFactory(flags, baseFactory2) {
19569
19546
  function createEmptyStatement() {
19570
19547
  const node = createBaseNode(239 /* EmptyStatement */);
19571
19548
  node.jsDoc = void 0;
19572
- node.jsDocCache = void 0;
19573
19549
  return node;
19574
19550
  }
19575
19551
  function createExpressionStatement(expression) {
@@ -19577,7 +19553,6 @@ function createNodeFactory(flags, baseFactory2) {
19577
19553
  node.expression = parenthesizerRules().parenthesizeExpressionOfExpressionStatement(expression);
19578
19554
  node.transformFlags |= propagateChildFlags(node.expression);
19579
19555
  node.jsDoc = void 0;
19580
- node.jsDocCache = void 0;
19581
19556
  node.flowNode = void 0;
19582
19557
  return node;
19583
19558
  }
@@ -19591,7 +19566,6 @@ function createNodeFactory(flags, baseFactory2) {
19591
19566
  node.elseStatement = asEmbeddedStatement(elseStatement);
19592
19567
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thenStatement) | propagateChildFlags(node.elseStatement);
19593
19568
  node.jsDoc = void 0;
19594
- node.jsDocCache = void 0;
19595
19569
  node.flowNode = void 0;
19596
19570
  return node;
19597
19571
  }
@@ -19604,7 +19578,6 @@ function createNodeFactory(flags, baseFactory2) {
19604
19578
  node.expression = expression;
19605
19579
  node.transformFlags |= propagateChildFlags(node.statement) | propagateChildFlags(node.expression);
19606
19580
  node.jsDoc = void 0;
19607
- node.jsDocCache = void 0;
19608
19581
  node.flowNode = void 0;
19609
19582
  return node;
19610
19583
  }
@@ -19617,7 +19590,6 @@ function createNodeFactory(flags, baseFactory2) {
19617
19590
  node.statement = asEmbeddedStatement(statement);
19618
19591
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement);
19619
19592
  node.jsDoc = void 0;
19620
- node.jsDocCache = void 0;
19621
19593
  node.flowNode = void 0;
19622
19594
  return node;
19623
19595
  }
@@ -19632,7 +19604,6 @@ function createNodeFactory(flags, baseFactory2) {
19632
19604
  node.statement = asEmbeddedStatement(statement);
19633
19605
  node.transformFlags |= propagateChildFlags(node.initializer) | propagateChildFlags(node.condition) | propagateChildFlags(node.incrementor) | propagateChildFlags(node.statement);
19634
19606
  node.jsDoc = void 0;
19635
- node.jsDocCache = void 0;
19636
19607
  node.locals = void 0;
19637
19608
  node.nextContainer = void 0;
19638
19609
  node.flowNode = void 0;
@@ -19648,7 +19619,6 @@ function createNodeFactory(flags, baseFactory2) {
19648
19619
  node.statement = asEmbeddedStatement(statement);
19649
19620
  node.transformFlags |= propagateChildFlags(node.initializer) | propagateChildFlags(node.expression) | propagateChildFlags(node.statement);
19650
19621
  node.jsDoc = void 0;
19651
- node.jsDocCache = void 0;
19652
19622
  node.locals = void 0;
19653
19623
  node.nextContainer = void 0;
19654
19624
  node.flowNode = void 0;
@@ -19667,7 +19637,6 @@ function createNodeFactory(flags, baseFactory2) {
19667
19637
  if (awaitModifier)
19668
19638
  node.transformFlags |= 128 /* ContainsES2018 */;
19669
19639
  node.jsDoc = void 0;
19670
- node.jsDocCache = void 0;
19671
19640
  node.locals = void 0;
19672
19641
  node.nextContainer = void 0;
19673
19642
  node.flowNode = void 0;
@@ -19681,7 +19650,6 @@ function createNodeFactory(flags, baseFactory2) {
19681
19650
  node.label = asName(label);
19682
19651
  node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
19683
19652
  node.jsDoc = void 0;
19684
- node.jsDocCache = void 0;
19685
19653
  node.flowNode = void 0;
19686
19654
  return node;
19687
19655
  }
@@ -19693,7 +19661,6 @@ function createNodeFactory(flags, baseFactory2) {
19693
19661
  node.label = asName(label);
19694
19662
  node.transformFlags |= propagateChildFlags(node.label) | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
19695
19663
  node.jsDoc = void 0;
19696
- node.jsDocCache = void 0;
19697
19664
  node.flowNode = void 0;
19698
19665
  return node;
19699
19666
  }
@@ -19705,7 +19672,6 @@ function createNodeFactory(flags, baseFactory2) {
19705
19672
  node.expression = expression;
19706
19673
  node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 4194304 /* ContainsHoistedDeclarationOrCompletion */;
19707
19674
  node.jsDoc = void 0;
19708
- node.jsDocCache = void 0;
19709
19675
  node.flowNode = void 0;
19710
19676
  return node;
19711
19677
  }
@@ -19718,7 +19684,6 @@ function createNodeFactory(flags, baseFactory2) {
19718
19684
  node.statement = asEmbeddedStatement(statement);
19719
19685
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.statement);
19720
19686
  node.jsDoc = void 0;
19721
- node.jsDocCache = void 0;
19722
19687
  node.flowNode = void 0;
19723
19688
  return node;
19724
19689
  }
@@ -19731,7 +19696,6 @@ function createNodeFactory(flags, baseFactory2) {
19731
19696
  node.caseBlock = caseBlock;
19732
19697
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.caseBlock);
19733
19698
  node.jsDoc = void 0;
19734
- node.jsDocCache = void 0;
19735
19699
  node.flowNode = void 0;
19736
19700
  node.possiblyExhaustive = false;
19737
19701
  return node;
@@ -19745,7 +19709,6 @@ function createNodeFactory(flags, baseFactory2) {
19745
19709
  node.statement = asEmbeddedStatement(statement);
19746
19710
  node.transformFlags |= propagateChildFlags(node.label) | propagateChildFlags(node.statement);
19747
19711
  node.jsDoc = void 0;
19748
- node.jsDocCache = void 0;
19749
19712
  node.flowNode = void 0;
19750
19713
  return node;
19751
19714
  }
@@ -19757,7 +19720,6 @@ function createNodeFactory(flags, baseFactory2) {
19757
19720
  node.expression = expression;
19758
19721
  node.transformFlags |= propagateChildFlags(node.expression);
19759
19722
  node.jsDoc = void 0;
19760
- node.jsDocCache = void 0;
19761
19723
  node.flowNode = void 0;
19762
19724
  return node;
19763
19725
  }
@@ -19771,7 +19733,6 @@ function createNodeFactory(flags, baseFactory2) {
19771
19733
  node.finallyBlock = finallyBlock;
19772
19734
  node.transformFlags |= propagateChildFlags(node.tryBlock) | propagateChildFlags(node.catchClause) | propagateChildFlags(node.finallyBlock);
19773
19735
  node.jsDoc = void 0;
19774
- node.jsDocCache = void 0;
19775
19736
  node.flowNode = void 0;
19776
19737
  return node;
19777
19738
  }
@@ -19781,7 +19742,6 @@ function createNodeFactory(flags, baseFactory2) {
19781
19742
  function createDebuggerStatement() {
19782
19743
  const node = createBaseNode(256 /* DebuggerStatement */);
19783
19744
  node.jsDoc = void 0;
19784
- node.jsDocCache = void 0;
19785
19745
  node.flowNode = void 0;
19786
19746
  return node;
19787
19747
  }
@@ -19794,7 +19754,6 @@ function createNodeFactory(flags, baseFactory2) {
19794
19754
  node.initializer = asInitializer(initializer);
19795
19755
  node.transformFlags |= propagateNameFlags(node.name) | propagateChildFlags(node.initializer) | (((_a2 = node.exclamationToken) != null ? _a2 : node.type) ? 1 /* ContainsTypeScript */ : 0 /* None */);
19796
19756
  node.jsDoc = void 0;
19797
- node.jsDocCache = void 0;
19798
19757
  return node;
19799
19758
  }
19800
19759
  function updateVariableDeclaration(node, name, exclamationToken, type, initializer) {
@@ -19833,7 +19792,6 @@ function createNodeFactory(flags, baseFactory2) {
19833
19792
  node.illegalDecorators = void 0;
19834
19793
  node.typeArguments = void 0;
19835
19794
  node.jsDoc = void 0;
19836
- node.jsDocCache = void 0;
19837
19795
  node.locals = void 0;
19838
19796
  node.nextContainer = void 0;
19839
19797
  node.endFlowNode = void 0;
@@ -19865,7 +19823,6 @@ function createNodeFactory(flags, baseFactory2) {
19865
19823
  }
19866
19824
  }
19867
19825
  node.jsDoc = void 0;
19868
- node.jsDocCache = void 0;
19869
19826
  return node;
19870
19827
  }
19871
19828
  function updateClassDeclaration(node, modifiers, name, typeParameters, heritageClauses, members) {
@@ -19881,7 +19838,6 @@ function createNodeFactory(flags, baseFactory2) {
19881
19838
  node.transformFlags = 1 /* ContainsTypeScript */;
19882
19839
  node.illegalDecorators = void 0;
19883
19840
  node.jsDoc = void 0;
19884
- node.jsDocCache = void 0;
19885
19841
  return node;
19886
19842
  }
19887
19843
  function updateInterfaceDeclaration(node, modifiers, name, typeParameters, heritageClauses, members) {
@@ -19902,7 +19858,6 @@ function createNodeFactory(flags, baseFactory2) {
19902
19858
  node.transformFlags = 1 /* ContainsTypeScript */;
19903
19859
  node.illegalDecorators = void 0;
19904
19860
  node.jsDoc = void 0;
19905
- node.jsDocCache = void 0;
19906
19861
  node.locals = void 0;
19907
19862
  node.nextContainer = void 0;
19908
19863
  return node;
@@ -19925,7 +19880,6 @@ function createNodeFactory(flags, baseFactory2) {
19925
19880
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
19926
19881
  node.illegalDecorators = void 0;
19927
19882
  node.jsDoc = void 0;
19928
- node.jsDocCache = void 0;
19929
19883
  return node;
19930
19884
  }
19931
19885
  function updateEnumDeclaration(node, modifiers, name, members) {
@@ -19951,7 +19905,6 @@ function createNodeFactory(flags, baseFactory2) {
19951
19905
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
19952
19906
  node.illegalDecorators = void 0;
19953
19907
  node.jsDoc = void 0;
19954
- node.jsDocCache = void 0;
19955
19908
  node.locals = void 0;
19956
19909
  node.nextContainer = void 0;
19957
19910
  return node;
@@ -19970,7 +19923,6 @@ function createNodeFactory(flags, baseFactory2) {
19970
19923
  node.statements = createNodeArray(statements);
19971
19924
  node.transformFlags |= propagateChildrenFlags(node.statements);
19972
19925
  node.jsDoc = void 0;
19973
- node.jsDocCache = void 0;
19974
19926
  return node;
19975
19927
  }
19976
19928
  function updateModuleBlock(node, statements) {
@@ -19994,7 +19946,6 @@ function createNodeFactory(flags, baseFactory2) {
19994
19946
  node.illegalDecorators = void 0;
19995
19947
  node.modifiers = void 0;
19996
19948
  node.jsDoc = void 0;
19997
- node.jsDocCache = void 0;
19998
19949
  return node;
19999
19950
  }
20000
19951
  function updateNamespaceExportDeclaration(node, name) {
@@ -20020,7 +19971,6 @@ function createNodeFactory(flags, baseFactory2) {
20020
19971
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
20021
19972
  node.illegalDecorators = void 0;
20022
19973
  node.jsDoc = void 0;
20023
- node.jsDocCache = void 0;
20024
19974
  return node;
20025
19975
  }
20026
19976
  function updateImportEqualsDeclaration(node, modifiers, isTypeOnly, name, moduleReference) {
@@ -20042,7 +19992,6 @@ function createNodeFactory(flags, baseFactory2) {
20042
19992
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
20043
19993
  node.illegalDecorators = void 0;
20044
19994
  node.jsDoc = void 0;
20045
- node.jsDocCache = void 0;
20046
19995
  return node;
20047
19996
  }
20048
19997
  function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause) {
@@ -20154,7 +20103,6 @@ function createNodeFactory(flags, baseFactory2) {
20154
20103
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
20155
20104
  node.illegalDecorators = void 0;
20156
20105
  node.jsDoc = void 0;
20157
- node.jsDocCache = void 0;
20158
20106
  return node;
20159
20107
  }
20160
20108
  function updateExportAssignment(node, modifiers, expression) {
@@ -20177,7 +20125,6 @@ function createNodeFactory(flags, baseFactory2) {
20177
20125
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
20178
20126
  node.illegalDecorators = void 0;
20179
20127
  node.jsDoc = void 0;
20180
- node.jsDocCache = void 0;
20181
20128
  return node;
20182
20129
  }
20183
20130
  function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) {
@@ -20207,7 +20154,6 @@ function createNodeFactory(flags, baseFactory2) {
20207
20154
  node.transformFlags |= propagateChildFlags(node.propertyName) | propagateChildFlags(node.name);
20208
20155
  node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
20209
20156
  node.jsDoc = void 0;
20210
- node.jsDocCache = void 0;
20211
20157
  return node;
20212
20158
  }
20213
20159
  function updateExportSpecifier(node, isTypeOnly, propertyName, name) {
@@ -20216,7 +20162,6 @@ function createNodeFactory(flags, baseFactory2) {
20216
20162
  function createMissingDeclaration() {
20217
20163
  const node = createBaseDeclaration(279 /* MissingDeclaration */);
20218
20164
  node.jsDoc = void 0;
20219
- node.jsDocCache = void 0;
20220
20165
  return node;
20221
20166
  }
20222
20167
  function createExternalModuleReference(expression) {
@@ -20257,7 +20202,6 @@ function createNodeFactory(flags, baseFactory2) {
20257
20202
  node.type = type;
20258
20203
  node.transformFlags = propagateChildrenFlags(node.parameters) | (node.type ? 1 /* ContainsTypeScript */ : 0 /* None */);
20259
20204
  node.jsDoc = void 0;
20260
- node.jsDocCache = void 0;
20261
20205
  node.locals = void 0;
20262
20206
  node.nextContainer = void 0;
20263
20207
  node.typeArguments = void 0;
@@ -20289,7 +20233,6 @@ function createNodeFactory(flags, baseFactory2) {
20289
20233
  node.parameters = createNodeArray(parameters);
20290
20234
  node.type = type;
20291
20235
  node.jsDoc = void 0;
20292
- node.jsDocCache = void 0;
20293
20236
  node.locals = void 0;
20294
20237
  node.nextContainer = void 0;
20295
20238
  return node;
@@ -20617,7 +20560,6 @@ function createNodeFactory(flags, baseFactory2) {
20617
20560
  node.statements = createNodeArray(statements);
20618
20561
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildrenFlags(node.statements);
20619
20562
  node.jsDoc = void 0;
20620
- node.jsDocCache = void 0;
20621
20563
  return node;
20622
20564
  }
20623
20565
  function updateCaseClause(node, expression, statements) {
@@ -20674,7 +20616,6 @@ function createNodeFactory(flags, baseFactory2) {
20674
20616
  node.questionToken = void 0;
20675
20617
  node.exclamationToken = void 0;
20676
20618
  node.jsDoc = void 0;
20677
- node.jsDocCache = void 0;
20678
20619
  return node;
20679
20620
  }
20680
20621
  function updatePropertyAssignment(node, name, initializer) {
@@ -20700,7 +20641,6 @@ function createNodeFactory(flags, baseFactory2) {
20700
20641
  node.questionToken = void 0;
20701
20642
  node.exclamationToken = void 0;
20702
20643
  node.jsDoc = void 0;
20703
- node.jsDocCache = void 0;
20704
20644
  return node;
20705
20645
  }
20706
20646
  function updateShorthandPropertyAssignment(node, name, objectAssignmentInitializer) {
@@ -20721,7 +20661,6 @@ function createNodeFactory(flags, baseFactory2) {
20721
20661
  node.expression = parenthesizerRules().parenthesizeExpressionForDisallowedComma(expression);
20722
20662
  node.transformFlags |= propagateChildFlags(node.expression) | 128 /* ContainsES2018 */ | 65536 /* ContainsObjectRestOrSpread */;
20723
20663
  node.jsDoc = void 0;
20724
- node.jsDocCache = void 0;
20725
20664
  return node;
20726
20665
  }
20727
20666
  function updateSpreadAssignment(node, expression) {
@@ -20733,7 +20672,6 @@ function createNodeFactory(flags, baseFactory2) {
20733
20672
  node.initializer = initializer && parenthesizerRules().parenthesizeExpressionForDisallowedComma(initializer);
20734
20673
  node.transformFlags |= propagateChildFlags(node.name) | propagateChildFlags(node.initializer) | 1 /* ContainsTypeScript */;
20735
20674
  node.jsDoc = void 0;
20736
- node.jsDocCache = void 0;
20737
20675
  return node;
20738
20676
  }
20739
20677
  function updateEnumMember(node, name, initializer) {
@@ -20915,18 +20853,18 @@ function createNodeFactory(flags, baseFactory2) {
20915
20853
  return node;
20916
20854
  }
20917
20855
  function createSyntaxList(children) {
20918
- const node = createBaseNode(354 /* SyntaxList */);
20856
+ const node = createBaseNode(353 /* SyntaxList */);
20919
20857
  node._children = children;
20920
20858
  return node;
20921
20859
  }
20922
20860
  function createNotEmittedStatement(original) {
20923
- const node = createBaseNode(355 /* NotEmittedStatement */);
20861
+ const node = createBaseNode(354 /* NotEmittedStatement */);
20924
20862
  node.original = original;
20925
20863
  setTextRange(node, original);
20926
20864
  return node;
20927
20865
  }
20928
20866
  function createPartiallyEmittedExpression(expression, original) {
20929
- const node = createBaseNode(356 /* PartiallyEmittedExpression */);
20867
+ const node = createBaseNode(355 /* PartiallyEmittedExpression */);
20930
20868
  node.expression = expression;
20931
20869
  node.original = original;
20932
20870
  node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
@@ -20948,7 +20886,7 @@ function createNodeFactory(flags, baseFactory2) {
20948
20886
  return node;
20949
20887
  }
20950
20888
  function createCommaListExpression(elements) {
20951
- const node = createBaseNode(357 /* CommaListExpression */);
20889
+ const node = createBaseNode(356 /* CommaListExpression */);
20952
20890
  node.elements = createNodeArray(sameFlatMap(elements, flattenCommaElements));
20953
20891
  node.transformFlags |= propagateChildrenFlags(node.elements);
20954
20892
  return node;
@@ -20957,19 +20895,19 @@ function createNodeFactory(flags, baseFactory2) {
20957
20895
  return node.elements !== elements ? update(createCommaListExpression(elements), node) : node;
20958
20896
  }
20959
20897
  function createEndOfDeclarationMarker(original) {
20960
- const node = createBaseNode(359 /* EndOfDeclarationMarker */);
20898
+ const node = createBaseNode(358 /* EndOfDeclarationMarker */);
20961
20899
  node.emitNode = {};
20962
20900
  node.original = original;
20963
20901
  return node;
20964
20902
  }
20965
20903
  function createMergeDeclarationMarker(original) {
20966
- const node = createBaseNode(358 /* MergeDeclarationMarker */);
20904
+ const node = createBaseNode(357 /* MergeDeclarationMarker */);
20967
20905
  node.emitNode = {};
20968
20906
  node.original = original;
20969
20907
  return node;
20970
20908
  }
20971
20909
  function createSyntheticReferenceExpression(expression, thisArg) {
20972
- const node = createBaseNode(360 /* SyntheticReferenceExpression */);
20910
+ const node = createBaseNode(359 /* SyntheticReferenceExpression */);
20973
20911
  node.expression = expression;
20974
20912
  node.thisArg = thisArg;
20975
20913
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg);
@@ -20979,36 +20917,32 @@ function createNodeFactory(flags, baseFactory2) {
20979
20917
  return node.expression !== expression || node.thisArg !== thisArg ? update(createSyntheticReferenceExpression(expression, thisArg), node) : node;
20980
20918
  }
20981
20919
  function cloneGeneratedIdentifier(node) {
20982
- const clone2 = createBaseIdentifier(
20983
- node.escapedText,
20984
- /*originalKeywordKind*/
20985
- void 0
20986
- );
20920
+ const clone2 = createBaseIdentifier(node.escapedText);
20987
20921
  clone2.flags |= node.flags & ~8 /* Synthesized */;
20988
- clone2.autoGenerate = { ...node.autoGenerate };
20989
20922
  clone2.transformFlags = node.transformFlags;
20990
20923
  setOriginalNode(clone2, node);
20924
+ setIdentifierAutoGenerate(clone2, { ...node.emitNode.autoGenerate });
20991
20925
  return clone2;
20992
20926
  }
20993
20927
  function cloneIdentifier(node) {
20994
- const clone2 = createBaseIdentifier(node.escapedText, node.originalKeywordKind);
20928
+ const clone2 = createBaseIdentifier(node.escapedText);
20995
20929
  clone2.flags |= node.flags & ~8 /* Synthesized */;
20996
- clone2.typeArguments = node.typeArguments;
20997
- clone2.hasExtendedUnicodeEscape = node.hasExtendedUnicodeEscape;
20998
20930
  clone2.jsDoc = node.jsDoc;
20999
- clone2.jsDocCache = node.jsDocCache;
21000
20931
  clone2.flowNode = node.flowNode;
21001
20932
  clone2.symbol = node.symbol;
21002
20933
  clone2.transformFlags = node.transformFlags;
21003
20934
  setOriginalNode(clone2, node);
20935
+ const typeArguments = getIdentifierTypeArguments(node);
20936
+ if (typeArguments)
20937
+ setIdentifierTypeArguments(clone2, typeArguments);
21004
20938
  return clone2;
21005
20939
  }
21006
20940
  function cloneGeneratedPrivateIdentifier(node) {
21007
20941
  const clone2 = createBasePrivateIdentifier(node.escapedText);
21008
20942
  clone2.flags |= node.flags & ~8 /* Synthesized */;
21009
- clone2.autoGenerate = { ...node.autoGenerate };
21010
20943
  clone2.transformFlags = node.transformFlags;
21011
20944
  setOriginalNode(clone2, node);
20945
+ setIdentifierAutoGenerate(clone2, { ...node.emitNode.autoGenerate });
21012
20946
  return clone2;
21013
20947
  }
21014
20948
  function clonePrivateIdentifier(node) {
@@ -21213,7 +21147,7 @@ function createNodeFactory(flags, baseFactory2) {
21213
21147
  return updateSatisfiesExpression(outerExpression, expression, outerExpression.type);
21214
21148
  case 232 /* NonNullExpression */:
21215
21149
  return updateNonNullExpression(outerExpression, expression);
21216
- case 356 /* PartiallyEmittedExpression */:
21150
+ case 355 /* PartiallyEmittedExpression */:
21217
21151
  return updatePartiallyEmittedExpression(outerExpression, expression);
21218
21152
  }
21219
21153
  }
@@ -21749,7 +21683,7 @@ function getTransformFlagsSubtreeExclusions(kind) {
21749
21683
  case 213 /* TypeAssertionExpression */:
21750
21684
  case 235 /* SatisfiesExpression */:
21751
21685
  case 231 /* AsExpression */:
21752
- case 356 /* PartiallyEmittedExpression */:
21686
+ case 355 /* PartiallyEmittedExpression */:
21753
21687
  case 214 /* ParenthesizedExpression */:
21754
21688
  case 106 /* SuperKeyword */:
21755
21689
  return -2147483648 /* OuterExpressionExcludes */;
@@ -22216,6 +22150,26 @@ function getTypeNode(node) {
22216
22150
  var _a2;
22217
22151
  return (_a2 = node.emitNode) == null ? void 0 : _a2.typeNode;
22218
22152
  }
22153
+ function setIdentifierTypeArguments(node, typeArguments) {
22154
+ getOrCreateEmitNode(node).identifierTypeArguments = typeArguments;
22155
+ return node;
22156
+ }
22157
+ function getIdentifierTypeArguments(node) {
22158
+ var _a2;
22159
+ return (_a2 = node.emitNode) == null ? void 0 : _a2.identifierTypeArguments;
22160
+ }
22161
+ function setIdentifierAutoGenerate(node, autoGenerate) {
22162
+ getOrCreateEmitNode(node).autoGenerate = autoGenerate;
22163
+ return node;
22164
+ }
22165
+ function setIdentifierGeneratedImportReference(node, value) {
22166
+ getOrCreateEmitNode(node).generatedImportReference = value;
22167
+ return node;
22168
+ }
22169
+ function getIdentifierGeneratedImportReference(node) {
22170
+ var _a2;
22171
+ return (_a2 = node.emitNode) == null ? void 0 : _a2.generatedImportReference;
22172
+ }
22219
22173
 
22220
22174
  // src/compiler/factory/emitHelpers.ts
22221
22175
  function createEmitHelperFactory(context) {
@@ -23276,10 +23230,10 @@ function isMetaProperty(node) {
23276
23230
  return node.kind === 233 /* MetaProperty */;
23277
23231
  }
23278
23232
  function isPartiallyEmittedExpression(node) {
23279
- return node.kind === 356 /* PartiallyEmittedExpression */;
23233
+ return node.kind === 355 /* PartiallyEmittedExpression */;
23280
23234
  }
23281
23235
  function isCommaListExpression(node) {
23282
- return node.kind === 357 /* CommaListExpression */;
23236
+ return node.kind === 356 /* CommaListExpression */;
23283
23237
  }
23284
23238
  function isTemplateSpan(node) {
23285
23239
  return node.kind === 236 /* TemplateSpan */;
@@ -23402,10 +23356,10 @@ function isExportSpecifier(node) {
23402
23356
  return node.kind === 278 /* ExportSpecifier */;
23403
23357
  }
23404
23358
  function isNotEmittedStatement(node) {
23405
- return node.kind === 355 /* NotEmittedStatement */;
23359
+ return node.kind === 354 /* NotEmittedStatement */;
23406
23360
  }
23407
23361
  function isSyntheticReference(node) {
23408
- return node.kind === 360 /* SyntheticReferenceExpression */;
23362
+ return node.kind === 359 /* SyntheticReferenceExpression */;
23409
23363
  }
23410
23364
  function isExternalModuleReference(node) {
23411
23365
  return node.kind === 280 /* ExternalModuleReference */;
@@ -23572,9 +23526,6 @@ function isJSDocPropertyTag(node) {
23572
23526
  function isJSDocImplementsTag(node) {
23573
23527
  return node.kind === 332 /* JSDocImplementsTag */;
23574
23528
  }
23575
- function isJSDocSatisfiesTag(node) {
23576
- return node.kind === 353 /* JSDocSatisfiesTag */;
23577
- }
23578
23529
 
23579
23530
  // src/compiler/factory/utilities.ts
23580
23531
  function createEmptyExports(factory2) {
@@ -23930,7 +23881,7 @@ function startsWithUseStrict(statements) {
23930
23881
  return firstStatement !== void 0 && isPrologueDirective(firstStatement) && isUseStrictPrologue(firstStatement);
23931
23882
  }
23932
23883
  function isCommaSequence(node) {
23933
- return node.kind === 223 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind === 357 /* CommaListExpression */;
23884
+ return node.kind === 223 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind === 356 /* CommaListExpression */;
23934
23885
  }
23935
23886
  function isJSDocTypeAssertion(node) {
23936
23887
  return isParenthesizedExpression(node) && isInJSFile(node) && !!getJSDocTypeTag(node);
@@ -23953,7 +23904,7 @@ function isOuterExpression(node, kinds = 15 /* All */) {
23953
23904
  return (kinds & 2 /* TypeAssertions */) !== 0;
23954
23905
  case 232 /* NonNullExpression */:
23955
23906
  return (kinds & 4 /* NonNullAssertions */) !== 0;
23956
- case 356 /* PartiallyEmittedExpression */:
23907
+ case 355 /* PartiallyEmittedExpression */:
23957
23908
  return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0;
23958
23909
  }
23959
23910
  return false;
@@ -24445,13 +24396,16 @@ function elideNodes(factory2, nodes) {
24445
24396
  return setTextRange(factory2.createNodeArray([], nodes.hasTrailingComma), nodes);
24446
24397
  }
24447
24398
  function getNodeForGeneratedName(name) {
24448
- if (name.autoGenerate.flags & 4 /* Node */) {
24449
- const autoGenerateId = name.autoGenerate.id;
24399
+ var _a2;
24400
+ const autoGenerate = name.emitNode.autoGenerate;
24401
+ if (autoGenerate.flags & 4 /* Node */) {
24402
+ const autoGenerateId = autoGenerate.id;
24450
24403
  let node = name;
24451
24404
  let original = node.original;
24452
24405
  while (original) {
24453
24406
  node = original;
24454
- if (isMemberName(node) && (node.autoGenerate === void 0 || !!(node.autoGenerate.flags & 4 /* Node */) && node.autoGenerate.id !== autoGenerateId)) {
24407
+ const autoGenerate2 = (_a2 = node.emitNode) == null ? void 0 : _a2.autoGenerate;
24408
+ if (isMemberName(node) && (autoGenerate2 === void 0 || !!(autoGenerate2.flags & 4 /* Node */) && autoGenerate2.id !== autoGenerateId)) {
24455
24409
  break;
24456
24410
  }
24457
24411
  original = node.original;
@@ -24942,7 +24896,7 @@ var forEachChildTable = {
24942
24896
  [279 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) {
24943
24897
  return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers);
24944
24898
  },
24945
- [357 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
24899
+ [356 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
24946
24900
  return visitNodes(cbNode, cbNodes, node.elements);
24947
24901
  },
24948
24902
  [281 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) {
@@ -25014,7 +24968,6 @@ var forEachChildTable = {
25014
24968
  [347 /* JSDocTypeTag */]: forEachChildInJSDocTypeLikeTag,
25015
24969
  [346 /* JSDocThisTag */]: forEachChildInJSDocTypeLikeTag,
25016
24970
  [343 /* JSDocEnumTag */]: forEachChildInJSDocTypeLikeTag,
25017
- [353 /* JSDocSatisfiesTag */]: forEachChildInJSDocTypeLikeTag,
25018
24971
  [352 /* JSDocThrowsTag */]: forEachChildInJSDocTypeLikeTag,
25019
24972
  [342 /* JSDocOverloadTag */]: forEachChildInJSDocTypeLikeTag,
25020
24973
  [326 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) {
@@ -25034,7 +24987,7 @@ var forEachChildTable = {
25034
24987
  [339 /* JSDocReadonlyTag */]: forEachChildInJSDocTag,
25035
24988
  [334 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag,
25036
24989
  [340 /* JSDocOverrideTag */]: forEachChildInJSDocTag,
25037
- [356 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
24990
+ [355 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
25038
24991
  };
25039
24992
  function forEachChildInCallOrConstructSignature(node, cbNode, cbNodes) {
25040
24993
  return visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
@@ -26051,8 +26004,6 @@ var Parser;
26051
26004
  const pos = getNodePos();
26052
26005
  const result = kind === 79 /* Identifier */ ? factory2.createIdentifier(
26053
26006
  "",
26054
- /*typeArguments*/
26055
- void 0,
26056
26007
  /*originalKeywordKind*/
26057
26008
  void 0
26058
26009
  ) : isTemplateLiteralKind(kind) ? factory2.createTemplateLiteralLikeNode(
@@ -26087,13 +26038,7 @@ var Parser;
26087
26038
  const text = internIdentifier(scanner.getTokenValue());
26088
26039
  const hasExtendedUnicodeEscape = scanner.hasExtendedUnicodeEscape();
26089
26040
  nextTokenWithoutCheck();
26090
- return finishNode(factory2.createIdentifier(
26091
- text,
26092
- /*typeArguments*/
26093
- void 0,
26094
- originalKeywordKind,
26095
- hasExtendedUnicodeEscape
26096
- ), pos);
26041
+ return finishNode(factory2.createIdentifier(text, originalKeywordKind, hasExtendedUnicodeEscape), pos);
26097
26042
  }
26098
26043
  if (token() === 80 /* PrivateIdentifier */) {
26099
26044
  parseErrorAtCurrentToken(privateIdentifierDiagnosticMessage || Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
@@ -26435,6 +26380,7 @@ var Parser;
26435
26380
  return parseElement();
26436
26381
  }
26437
26382
  function currentNode(parsingContext2, pos) {
26383
+ var _a2;
26438
26384
  if (!syntaxCursor || !isReusableParsingContext(parsingContext2) || parseErrorBeforeNextFinishedNode) {
26439
26385
  return void 0;
26440
26386
  }
@@ -26449,8 +26395,8 @@ var Parser;
26449
26395
  if (!canReuseNode(node, parsingContext2)) {
26450
26396
  return void 0;
26451
26397
  }
26452
- if (canHaveJSDoc(node) && node.jsDocCache) {
26453
- node.jsDocCache = void 0;
26398
+ if (canHaveJSDoc(node) && ((_a2 = node.jsDoc) == null ? void 0 : _a2.jsDocCache)) {
26399
+ node.jsDoc.jsDocCache = void 0;
26454
26400
  }
26455
26401
  return node;
26456
26402
  }
@@ -26509,7 +26455,7 @@ var Parser;
26509
26455
  return true;
26510
26456
  case 171 /* MethodDeclaration */:
26511
26457
  const methodDeclaration = node;
26512
- const nameIsConstructor = methodDeclaration.name.kind === 79 /* Identifier */ && methodDeclaration.name.originalKeywordKind === 135 /* ConstructorKeyword */;
26458
+ const nameIsConstructor = methodDeclaration.name.kind === 79 /* Identifier */ && methodDeclaration.name.escapedText === "constructor";
26513
26459
  return !nameIsConstructor;
26514
26460
  }
26515
26461
  }
@@ -26731,13 +26677,10 @@ var Parser;
26731
26677
  function parseEntityName(allowReservedWords, diagnosticMessage) {
26732
26678
  const pos = getNodePos();
26733
26679
  let entity = allowReservedWords ? parseIdentifierName(diagnosticMessage) : parseIdentifier(diagnosticMessage);
26734
- let dotPos = getNodePos();
26735
26680
  while (parseOptional(24 /* DotToken */)) {
26736
26681
  if (token() === 29 /* LessThanToken */) {
26737
- entity.jsdocDotPos = dotPos;
26738
26682
  break;
26739
26683
  }
26740
- dotPos = getNodePos();
26741
26684
  entity = finishNode(
26742
26685
  factory2.createQualifiedName(
26743
26686
  entity,
@@ -31105,9 +31048,6 @@ var Parser;
31105
31048
  case "overload":
31106
31049
  tag = parseOverloadTag(start2, tagName, margin, indentText);
31107
31050
  break;
31108
- case "satisfies":
31109
- tag = parseSatisfiesTag(start2, tagName, margin, indentText);
31110
- break;
31111
31051
  case "see":
31112
31052
  tag = parseSeeTag(start2, tagName, margin, indentText);
31113
31053
  break;
@@ -31416,17 +31356,6 @@ var Parser;
31416
31356
  const className = parseExpressionWithTypeArgumentsForAugments();
31417
31357
  return finishNode(factory2.createJSDocAugmentsTag(tagName, className, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2);
31418
31358
  }
31419
- function parseSatisfiesTag(start2, tagName, margin, indentText) {
31420
- if (some(tags, isJSDocSatisfiesTag)) {
31421
- parseErrorAt(tagName.pos, scanner.getTokenPos(), Diagnostics._0_tag_already_specified, tagName.escapedText);
31422
- }
31423
- const typeExpression = parseJSDocTypeExpression(
31424
- /*mayOmitBraces*/
31425
- false
31426
- );
31427
- const comments2 = margin !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), margin, indentText) : void 0;
31428
- return finishNode(factory2.createJSDocSatisfiesTag(tagName, typeExpression, comments2), start2);
31429
- }
31430
31359
  function parseExpressionWithTypeArgumentsForAugments() {
31431
31360
  const usedBrace = parseOptional(18 /* OpenBraceToken */);
31432
31361
  const pos = getNodePos();
@@ -31531,7 +31460,7 @@ var Parser;
31531
31460
  return finishNode(jsDocNamespaceNode, pos);
31532
31461
  }
31533
31462
  if (nested) {
31534
- typeNameOrNamespaceName.isInJSDocNamespace = true;
31463
+ typeNameOrNamespaceName.flags |= 2048 /* IdentifierIsInJSDocNamespace */;
31535
31464
  }
31536
31465
  return typeNameOrNamespaceName;
31537
31466
  }
@@ -31735,12 +31664,7 @@ var Parser;
31735
31664
  const end2 = scanner.getTextPos();
31736
31665
  const originalKeywordKind = token();
31737
31666
  const text = internIdentifier(scanner.getTokenValue());
31738
- const result = finishNode(factory2.createIdentifier(
31739
- text,
31740
- /*typeArguments*/
31741
- void 0,
31742
- originalKeywordKind
31743
- ), pos, end2);
31667
+ const result = finishNode(factory2.createIdentifier(text, originalKeywordKind), pos, end2);
31744
31668
  nextTokenJSDoc();
31745
31669
  return result;
31746
31670
  }
@@ -34337,7 +34261,8 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
34337
34261
  if (returnValue) {
34338
34262
  result[keyText] = value;
34339
34263
  }
34340
- if (jsonConversionNotifier && (parentOption || isRootOptionMap(knownOptions))) {
34264
+ if (jsonConversionNotifier && // Current callbacks are only on known parent option or if we are setting values in the root
34265
+ (parentOption || isRootOptionMap(knownOptions))) {
34341
34266
  const isValidOptionValue = isCompilerOptionsValue(option, value);
34342
34267
  if (parentOption) {
34343
34268
  if (isValidOptionValue) {
@@ -35599,7 +35524,7 @@ function resolvedTypeScriptOnly(resolved) {
35599
35524
  Debug.assert(extensionIsTS(resolved.extension));
35600
35525
  return { fileName: resolved.path, packageId: resolved.packageId };
35601
35526
  }
35602
- function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache) {
35527
+ function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, legacyResult) {
35603
35528
  if (resultFromCache) {
35604
35529
  resultFromCache.failedLookupLocations = updateResolutionField(resultFromCache.failedLookupLocations, failedLookupLocations);
35605
35530
  resultFromCache.affectingLocations = updateResolutionField(resultFromCache.affectingLocations, affectingLocations);
@@ -35617,7 +35542,8 @@ function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibra
35617
35542
  },
35618
35543
  failedLookupLocations: initializeResolutionField(failedLookupLocations),
35619
35544
  affectingLocations: initializeResolutionField(affectingLocations),
35620
- resolutionDiagnostics: initializeResolutionField(diagnostics)
35545
+ resolutionDiagnostics: initializeResolutionField(diagnostics),
35546
+ node10Result: legacyResult
35621
35547
  };
35622
35548
  }
35623
35549
  function initializeResolutionField(value) {
@@ -36647,7 +36573,7 @@ function nodeNextJsonConfigResolver(moduleName, containingFile, host) {
36647
36573
  );
36648
36574
  }
36649
36575
  function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference) {
36650
- var _a2, _b;
36576
+ var _a2, _b, _c, _d;
36651
36577
  const traceEnabled = isTraceEnabled(compilerOptions, host);
36652
36578
  const failedLookupLocations = [];
36653
36579
  const affectingLocations = [];
@@ -36674,44 +36600,60 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
36674
36600
  if (getEmitModuleResolutionKind(compilerOptions) === 2 /* Node10 */) {
36675
36601
  const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
36676
36602
  const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
36677
- result = priorityExtensions && tryResolve(priorityExtensions) || secondaryExtensions && tryResolve(secondaryExtensions) || void 0;
36603
+ result = priorityExtensions && tryResolve(priorityExtensions, state) || secondaryExtensions && tryResolve(secondaryExtensions, state) || void 0;
36678
36604
  } else {
36679
- result = tryResolve(extensions);
36605
+ result = tryResolve(extensions, state);
36606
+ }
36607
+ let legacyResult;
36608
+ if (((_a2 = result == null ? void 0 : result.value) == null ? void 0 : _a2.isExternalLibraryImport) && !isConfigLookup && extensions & (1 /* TypeScript */ | 4 /* Declaration */) && features & 8 /* Exports */ && !isExternalModuleNameRelative(moduleName) && !extensionIsOk(1 /* TypeScript */ | 4 /* Declaration */, result.value.resolved.extension) && conditions.indexOf("import") > -1) {
36609
+ traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update);
36610
+ const diagnosticState = {
36611
+ ...state,
36612
+ features: state.features & ~8 /* Exports */,
36613
+ failedLookupLocations: [],
36614
+ affectingLocations: [],
36615
+ reportDiagnostic: noop
36616
+ };
36617
+ const diagnosticResult = tryResolve(extensions & (1 /* TypeScript */ | 4 /* Declaration */), diagnosticState);
36618
+ if ((_b = diagnosticResult == null ? void 0 : diagnosticResult.value) == null ? void 0 : _b.isExternalLibraryImport) {
36619
+ legacyResult = diagnosticResult.value.resolved.path;
36620
+ }
36680
36621
  }
36681
36622
  return createResolvedModuleWithFailedLookupLocations(
36682
- (_a2 = result == null ? void 0 : result.value) == null ? void 0 : _a2.resolved,
36683
- (_b = result == null ? void 0 : result.value) == null ? void 0 : _b.isExternalLibraryImport,
36623
+ (_c = result == null ? void 0 : result.value) == null ? void 0 : _c.resolved,
36624
+ (_d = result == null ? void 0 : result.value) == null ? void 0 : _d.isExternalLibraryImport,
36684
36625
  failedLookupLocations,
36685
36626
  affectingLocations,
36686
36627
  diagnostics,
36687
- state.resultFromCache
36628
+ state.resultFromCache,
36629
+ legacyResult
36688
36630
  );
36689
- function tryResolve(extensions2) {
36690
- const loader = (extensions3, candidate, onlyRecordFailures, state2) => nodeLoadModuleByRelativeName(
36631
+ function tryResolve(extensions2, state2) {
36632
+ const loader = (extensions3, candidate, onlyRecordFailures, state3) => nodeLoadModuleByRelativeName(
36691
36633
  extensions3,
36692
36634
  candidate,
36693
36635
  onlyRecordFailures,
36694
- state2,
36636
+ state3,
36695
36637
  /*considerPackageJson*/
36696
36638
  true
36697
36639
  );
36698
- const resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions2, moduleName, containingDirectory, loader, state);
36640
+ const resolved = tryLoadModuleUsingOptionalResolutionSettings(extensions2, moduleName, containingDirectory, loader, state2);
36699
36641
  if (resolved) {
36700
36642
  return toSearchResult({ resolved, isExternalLibraryImport: pathContainsNodeModules(resolved.path) });
36701
36643
  }
36702
36644
  if (!isExternalModuleNameRelative(moduleName)) {
36703
36645
  let resolved2;
36704
36646
  if (features & 2 /* Imports */ && startsWith(moduleName, "#")) {
36705
- resolved2 = loadModuleFromImports(extensions2, moduleName, containingDirectory, state, cache, redirectedReference);
36647
+ resolved2 = loadModuleFromImports(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
36706
36648
  }
36707
36649
  if (!resolved2 && features & 4 /* SelfName */) {
36708
- resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state, cache, redirectedReference);
36650
+ resolved2 = loadModuleFromSelfNameReference(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
36709
36651
  }
36710
36652
  if (!resolved2) {
36711
36653
  if (traceEnabled) {
36712
36654
  trace(host, Diagnostics.Loading_module_0_from_node_modules_folder_target_file_types_Colon_1, moduleName, formatExtensions(extensions2));
36713
36655
  }
36714
- resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state, cache, redirectedReference);
36656
+ resolved2 = loadModuleFromNearestNodeModulesDirectory(extensions2, moduleName, containingDirectory, state2, cache, redirectedReference);
36715
36657
  }
36716
36658
  if (!resolved2)
36717
36659
  return void 0;
@@ -36730,7 +36672,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
36730
36672
  candidate,
36731
36673
  /*onlyRecordFailures*/
36732
36674
  false,
36733
- state,
36675
+ state2,
36734
36676
  /*considerPackageJson*/
36735
36677
  true
36736
36678
  );
@@ -37963,7 +37905,7 @@ function getModuleInstanceStateWorker(node, visited) {
37963
37905
  case 264 /* ModuleDeclaration */:
37964
37906
  return getModuleInstanceState(node, visited);
37965
37907
  case 79 /* Identifier */:
37966
- if (node.isInJSDocNamespace) {
37908
+ if (node.flags & 2048 /* IdentifierIsInJSDocNamespace */) {
37967
37909
  return 0 /* NonInstantiated */;
37968
37910
  }
37969
37911
  }
@@ -38400,6 +38342,7 @@ function createBinder() {
38400
38342
  } else if (containerFlags & 64 /* IsInterface */) {
38401
38343
  seenThisKeyword = false;
38402
38344
  bindChildren(node);
38345
+ Debug.assertNotNode(node, isIdentifier);
38403
38346
  node.flags = seenThisKeyword ? node.flags | 128 /* ContainsThis */ : node.flags & ~128 /* ContainsThis */;
38404
38347
  } else {
38405
38348
  bindChildren(node);
@@ -39559,13 +39502,14 @@ function createBinder() {
39559
39502
  }
39560
39503
  function checkContextualIdentifier(node) {
39561
39504
  if (!file.parseDiagnostics.length && !(node.flags & 16777216 /* Ambient */) && !(node.flags & 8388608 /* JSDoc */) && !isIdentifierName(node)) {
39562
- if (inStrictMode && node.originalKeywordKind >= 117 /* FirstFutureReservedWord */ && node.originalKeywordKind <= 125 /* LastFutureReservedWord */) {
39505
+ const originalKeywordKind = identifierToKeywordKind(node);
39506
+ if (inStrictMode && originalKeywordKind >= 117 /* FirstFutureReservedWord */ && originalKeywordKind <= 125 /* LastFutureReservedWord */) {
39563
39507
  file.bindDiagnostics.push(createDiagnosticForNode2(
39564
39508
  node,
39565
39509
  getStrictModeIdentifierMessage(node),
39566
39510
  declarationNameToString(node)
39567
39511
  ));
39568
- } else if (node.originalKeywordKind === 133 /* AwaitKeyword */) {
39512
+ } else if (originalKeywordKind === 133 /* AwaitKeyword */) {
39569
39513
  if (isExternalModule(file) && isInTopLevelContext(node)) {
39570
39514
  file.bindDiagnostics.push(createDiagnosticForNode2(
39571
39515
  node,
@@ -39579,7 +39523,7 @@ function createBinder() {
39579
39523
  declarationNameToString(node)
39580
39524
  ));
39581
39525
  }
39582
- } else if (node.originalKeywordKind === 125 /* YieldKeyword */ && node.flags & 8192 /* YieldContext */) {
39526
+ } else if (originalKeywordKind === 125 /* YieldKeyword */ && node.flags & 8192 /* YieldContext */) {
39583
39527
  file.bindDiagnostics.push(createDiagnosticForNode2(
39584
39528
  node,
39585
39529
  Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here,
@@ -39791,7 +39735,7 @@ function createBinder() {
39791
39735
  function bindWorker(node) {
39792
39736
  switch (node.kind) {
39793
39737
  case 79 /* Identifier */:
39794
- if (node.isInJSDocNamespace) {
39738
+ if (node.flags & 2048 /* IdentifierIsInJSDocNamespace */) {
39795
39739
  let parentNode = node.parent;
39796
39740
  while (parentNode && !isJSDocTypeAlias(parentNode)) {
39797
39741
  parentNode = parentNode.parent;
@@ -40615,8 +40559,12 @@ function createBinder() {
40615
40559
  return false;
40616
40560
  }
40617
40561
  if (currentFlow === unreachableFlow) {
40618
- const reportError = isStatementButNotDeclaration(node) && node.kind !== 239 /* EmptyStatement */ || // report error on class declarations
40619
- node.kind === 260 /* ClassDeclaration */ || node.kind === 264 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node);
40562
+ const reportError = (
40563
+ // report error on all statements except empty ones
40564
+ isStatementButNotDeclaration(node) && node.kind !== 239 /* EmptyStatement */ || // report error on class declarations
40565
+ node.kind === 260 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set
40566
+ node.kind === 264 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)
40567
+ );
40620
40568
  if (reportError) {
40621
40569
  currentFlow = reportedUnreachableFlow;
40622
40570
  if (!options.allowUnreachableCode) {
@@ -43482,7 +43430,7 @@ function createTypeChecker(host) {
43482
43430
  if (result && errorLocation && meaning & 111551 /* Value */ && result.flags & 2097152 /* Alias */ && !(result.flags & 111551 /* Value */) && !isValidTypeOnlyAliasUseSite(errorLocation)) {
43483
43431
  const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(result, 111551 /* Value */);
43484
43432
  if (typeOnlyDeclaration) {
43485
- const message = typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ ? Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type : Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type;
43433
+ const message = typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 275 /* ExportDeclaration */ || typeOnlyDeclaration.kind === 277 /* NamespaceExport */ ? Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type : Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type;
43486
43434
  const unescapedName = unescapeLeadingUnderscores(name);
43487
43435
  addTypeOnlyDeclarationRelatedInfo(
43488
43436
  error(errorLocation, message, unescapedName),
@@ -43502,7 +43450,7 @@ function createTypeChecker(host) {
43502
43450
  diagnostic,
43503
43451
  createDiagnosticForNode(
43504
43452
  typeOnlyDeclaration,
43505
- typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here,
43453
+ typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 275 /* ExportDeclaration */ || typeOnlyDeclaration.kind === 277 /* NamespaceExport */ ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here,
43506
43454
  unescapedName
43507
43455
  )
43508
43456
  );
@@ -43881,10 +43829,10 @@ function createTypeChecker(host) {
43881
43829
  false
43882
43830
  ) && !node.isTypeOnly) {
43883
43831
  const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(getSymbolOfDeclaration(node));
43884
- const isExport = typeOnlyDeclaration.kind === 278 /* ExportSpecifier */;
43832
+ const isExport = typeOnlyDeclaration.kind === 278 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 275 /* ExportDeclaration */;
43885
43833
  const message = isExport ? Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type : Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type;
43886
43834
  const relatedMessage = isExport ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here;
43887
- const name = unescapeLeadingUnderscores(typeOnlyDeclaration.name.escapedText);
43835
+ const name = typeOnlyDeclaration.kind === 275 /* ExportDeclaration */ ? "*" : unescapeLeadingUnderscores(typeOnlyDeclaration.name.escapedText);
43888
43836
  addRelatedInfo(error(node.moduleReference, message), createDiagnosticForNode(typeOnlyDeclaration, relatedMessage, name));
43889
43837
  }
43890
43838
  }
@@ -44115,15 +44063,19 @@ function createTypeChecker(host) {
44115
44063
  return result;
44116
44064
  }
44117
44065
  function getExportOfModule(symbol, name, specifier, dontResolveAlias) {
44066
+ var _a2;
44118
44067
  if (symbol.flags & 1536 /* Module */) {
44119
44068
  const exportSymbol = getExportsOfSymbol(symbol).get(name.escapedText);
44120
44069
  const resolved = resolveSymbol(exportSymbol, dontResolveAlias);
44070
+ const exportStarDeclaration = (_a2 = getSymbolLinks(symbol).typeOnlyExportStarMap) == null ? void 0 : _a2.get(name.escapedText);
44121
44071
  markSymbolOfAliasDeclarationIfTypeOnly(
44122
44072
  specifier,
44123
44073
  exportSymbol,
44124
44074
  resolved,
44125
44075
  /*overwriteEmpty*/
44126
- false
44076
+ false,
44077
+ exportStarDeclaration,
44078
+ name.escapedText
44127
44079
  );
44128
44080
  return resolved;
44129
44081
  }
@@ -44450,7 +44402,7 @@ function createTypeChecker(host) {
44450
44402
  }
44451
44403
  return flags;
44452
44404
  }
44453
- function markSymbolOfAliasDeclarationIfTypeOnly(aliasDeclaration, immediateTarget, finalTarget, overwriteEmpty) {
44405
+ function markSymbolOfAliasDeclarationIfTypeOnly(aliasDeclaration, immediateTarget, finalTarget, overwriteEmpty, exportStarDeclaration, exportStarName) {
44454
44406
  if (!aliasDeclaration || isPropertyAccessExpression(aliasDeclaration))
44455
44407
  return false;
44456
44408
  const sourceSymbol = getSymbolOfDeclaration(aliasDeclaration);
@@ -44459,6 +44411,14 @@ function createTypeChecker(host) {
44459
44411
  links2.typeOnlyDeclaration = aliasDeclaration;
44460
44412
  return true;
44461
44413
  }
44414
+ if (exportStarDeclaration) {
44415
+ const links2 = getSymbolLinks(sourceSymbol);
44416
+ links2.typeOnlyDeclaration = exportStarDeclaration;
44417
+ if (sourceSymbol.escapedName !== exportStarName) {
44418
+ links2.typeOnlyExportStarName = exportStarName;
44419
+ }
44420
+ return true;
44421
+ }
44462
44422
  const links = getSymbolLinks(sourceSymbol);
44463
44423
  return markSymbolOfAliasDeclarationIfTypeOnlyWorker(links, immediateTarget, overwriteEmpty) || markSymbolOfAliasDeclarationIfTypeOnlyWorker(links, finalTarget, overwriteEmpty);
44464
44424
  }
@@ -44480,7 +44440,8 @@ function createTypeChecker(host) {
44480
44440
  return links.typeOnlyDeclaration || void 0;
44481
44441
  }
44482
44442
  if (links.typeOnlyDeclaration) {
44483
- return getAllSymbolFlags(resolveAlias(links.typeOnlyDeclaration.symbol)) & include ? links.typeOnlyDeclaration : void 0;
44443
+ const resolved = links.typeOnlyDeclaration.kind === 275 /* ExportDeclaration */ ? resolveSymbol(getExportsOfModule(links.typeOnlyDeclaration.symbol.parent).get(links.typeOnlyExportStarName || symbol.escapedName)) : resolveAlias(links.typeOnlyDeclaration.symbol);
44444
+ return getAllSymbolFlags(resolved) & include ? links.typeOnlyDeclaration : void 0;
44484
44445
  }
44485
44446
  return void 0;
44486
44447
  }
@@ -44801,6 +44762,8 @@ function createTypeChecker(host) {
44801
44762
  /*isError*/
44802
44763
  false,
44803
44764
  errorNode,
44765
+ currentSourceFile,
44766
+ mode,
44804
44767
  resolvedModule,
44805
44768
  moduleReference
44806
44769
  );
@@ -44886,6 +44849,8 @@ function createTypeChecker(host) {
44886
44849
  /*isError*/
44887
44850
  noImplicitAny && !!moduleNotFoundError,
44888
44851
  errorNode,
44852
+ currentSourceFile,
44853
+ mode,
44889
44854
  resolvedModule,
44890
44855
  moduleReference
44891
44856
  );
@@ -44940,26 +44905,37 @@ function createTypeChecker(host) {
44940
44905
  return importSourceWithoutExtension;
44941
44906
  }
44942
44907
  }
44943
- function errorOnImplicitAnyModule(isError, errorNode, { packageId, resolvedFileName }, moduleReference) {
44944
- const errorInfo = !isExternalModuleNameRelative(moduleReference) && packageId ? typesPackageExists(packageId.name) ? chainDiagnosticMessages(
44945
- /*details*/
44946
- void 0,
44947
- Diagnostics.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1,
44948
- packageId.name,
44949
- mangleScopedPackageName(packageId.name)
44950
- ) : packageBundlesTypes(packageId.name) ? chainDiagnosticMessages(
44951
- /*details*/
44952
- void 0,
44953
- Diagnostics.If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1,
44954
- packageId.name,
44955
- moduleReference
44956
- ) : chainDiagnosticMessages(
44957
- /*details*/
44958
- void 0,
44959
- Diagnostics.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0,
44960
- moduleReference,
44961
- mangleScopedPackageName(packageId.name)
44962
- ) : void 0;
44908
+ function errorOnImplicitAnyModule(isError, errorNode, sourceFile, mode, { packageId, resolvedFileName }, moduleReference) {
44909
+ var _a2, _b;
44910
+ let errorInfo;
44911
+ if (!isExternalModuleNameRelative(moduleReference) && packageId) {
44912
+ const node10Result = (_b = (_a2 = sourceFile.resolvedModules) == null ? void 0 : _a2.get(moduleReference, mode)) == null ? void 0 : _b.node10Result;
44913
+ errorInfo = node10Result ? chainDiagnosticMessages(
44914
+ /*details*/
44915
+ void 0,
44916
+ Diagnostics.There_are_types_at_0_but_this_result_could_not_be_resolved_when_respecting_package_json_exports_The_1_library_may_need_to_update_its_package_json_or_typings,
44917
+ node10Result,
44918
+ node10Result.indexOf(nodeModulesPathPart + "@types/") > -1 ? `@types/${mangleScopedPackageName(packageId.name)}` : packageId.name
44919
+ ) : typesPackageExists(packageId.name) ? chainDiagnosticMessages(
44920
+ /*details*/
44921
+ void 0,
44922
+ Diagnostics.If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_1,
44923
+ packageId.name,
44924
+ mangleScopedPackageName(packageId.name)
44925
+ ) : packageBundlesTypes(packageId.name) ? chainDiagnosticMessages(
44926
+ /*details*/
44927
+ void 0,
44928
+ Diagnostics.If_the_0_package_actually_exposes_this_module_try_adding_a_new_declaration_d_ts_file_containing_declare_module_1,
44929
+ packageId.name,
44930
+ moduleReference
44931
+ ) : chainDiagnosticMessages(
44932
+ /*details*/
44933
+ void 0,
44934
+ Diagnostics.Try_npm_i_save_dev_types_Slash_1_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0,
44935
+ moduleReference,
44936
+ mangleScopedPackageName(packageId.name)
44937
+ );
44938
+ }
44963
44939
  errorOrSuggestion(isError, errorNode, chainDiagnosticMessages(
44964
44940
  errorInfo,
44965
44941
  Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type,
@@ -45119,7 +45095,12 @@ function createTypeChecker(host) {
45119
45095
  }
45120
45096
  function getExportsOfModule(moduleSymbol) {
45121
45097
  const links = getSymbolLinks(moduleSymbol);
45122
- return links.resolvedExports || (links.resolvedExports = getExportsOfModuleWorker(moduleSymbol));
45098
+ if (!links.resolvedExports) {
45099
+ const { exports, typeOnlyExportStarMap } = getExportsOfModuleWorker(moduleSymbol);
45100
+ links.resolvedExports = exports;
45101
+ links.typeOnlyExportStarMap = typeOnlyExportStarMap;
45102
+ }
45103
+ return links.resolvedExports;
45123
45104
  }
45124
45105
  function extendExportSymbols(target, source, lookupTable, exportNode) {
45125
45106
  if (!source)
@@ -45147,9 +45128,21 @@ function createTypeChecker(host) {
45147
45128
  }
45148
45129
  function getExportsOfModuleWorker(moduleSymbol) {
45149
45130
  const visitedSymbols = [];
45131
+ let typeOnlyExportStarMap;
45132
+ const nonTypeOnlyNames = /* @__PURE__ */ new Set();
45150
45133
  moduleSymbol = resolveExternalModuleSymbol(moduleSymbol);
45151
- return visit(moduleSymbol) || emptySymbols;
45152
- function visit(symbol) {
45134
+ const exports = visit(moduleSymbol) || emptySymbols;
45135
+ if (typeOnlyExportStarMap) {
45136
+ nonTypeOnlyNames.forEach((name) => typeOnlyExportStarMap.delete(name));
45137
+ }
45138
+ return {
45139
+ exports,
45140
+ typeOnlyExportStarMap
45141
+ };
45142
+ function visit(symbol, exportStar, isTypeOnly) {
45143
+ if (!isTypeOnly && (symbol == null ? void 0 : symbol.exports)) {
45144
+ symbol.exports.forEach((_, name) => nonTypeOnlyNames.add(name));
45145
+ }
45153
45146
  if (!(symbol && symbol.exports && pushIfUnique(visitedSymbols, symbol))) {
45154
45147
  return;
45155
45148
  }
@@ -45161,7 +45154,7 @@ function createTypeChecker(host) {
45161
45154
  if (exportStars.declarations) {
45162
45155
  for (const node of exportStars.declarations) {
45163
45156
  const resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier);
45164
- const exportedSymbols = visit(resolvedModule);
45157
+ const exportedSymbols = visit(resolvedModule, node, isTypeOnly || node.isTypeOnly);
45165
45158
  extendExportSymbols(
45166
45159
  nestedSymbols,
45167
45160
  exportedSymbols,
@@ -45185,6 +45178,13 @@ function createTypeChecker(host) {
45185
45178
  });
45186
45179
  extendExportSymbols(symbols, nestedSymbols);
45187
45180
  }
45181
+ if (exportStar == null ? void 0 : exportStar.isTypeOnly) {
45182
+ typeOnlyExportStarMap != null ? typeOnlyExportStarMap : typeOnlyExportStarMap = /* @__PURE__ */ new Map();
45183
+ symbols.forEach((_, escapedName) => typeOnlyExportStarMap.set(
45184
+ escapedName,
45185
+ exportStar
45186
+ ));
45187
+ }
45188
45188
  return symbols;
45189
45189
  }
45190
45190
  }
@@ -46422,7 +46422,8 @@ function createTypeChecker(host) {
46422
46422
  const isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol
46423
46423
  forEach(symbol.declarations, (declaration) => declaration.parent.kind === 308 /* SourceFile */ || declaration.parent.kind === 265 /* ModuleBlock */));
46424
46424
  if (isStaticMethodSymbol || isNonLocalFunctionSymbol) {
46425
- return (!!(context.flags & 4096 /* UseTypeOfFunction */) || ((_a4 = context.visitedTypes) == null ? void 0 : _a4.has(typeId))) && (!(context.flags & 8 /* UseStructuralFallback */) || isValueSymbolAccessible(symbol, context.enclosingDeclaration));
46425
+ return (!!(context.flags & 4096 /* UseTypeOfFunction */) || ((_a4 = context.visitedTypes) == null ? void 0 : _a4.has(typeId))) && // it is type of the symbol uses itself recursively
46426
+ (!(context.flags & 8 /* UseStructuralFallback */) || isValueSymbolAccessible(symbol, context.enclosingDeclaration));
46426
46427
  }
46427
46428
  }
46428
46429
  }
@@ -46514,7 +46515,9 @@ function createTypeChecker(host) {
46514
46515
  const abstractSignatures = filter(resolved.constructSignatures, (signature) => !!(signature.flags & 4 /* Abstract */));
46515
46516
  if (some(abstractSignatures)) {
46516
46517
  const types = map(abstractSignatures, getOrCreateTypeFromSignature);
46517
- const typeElementCount = resolved.callSignatures.length + (resolved.constructSignatures.length - abstractSignatures.length) + resolved.indexInfos.length + (context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ ? countWhere(resolved.properties, (p) => !(p.flags & 4194304 /* Prototype */)) : length(resolved.properties));
46518
+ const typeElementCount = resolved.callSignatures.length + (resolved.constructSignatures.length - abstractSignatures.length) + resolved.indexInfos.length + // exclude `prototype` when writing a class expression as a type literal, as per
46519
+ // the logic in `createTypeNodesFromResolvedType`.
46520
+ (context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ ? countWhere(resolved.properties, (p) => !(p.flags & 4194304 /* Prototype */)) : length(resolved.properties));
46518
46521
  if (typeElementCount) {
46519
46522
  types.push(getResolvedTypeWithoutAbstractConstructSignatures(resolved));
46520
46523
  }
@@ -46613,13 +46616,17 @@ function createTypeChecker(host) {
46613
46616
  let qualifier = root.qualifier;
46614
46617
  if (qualifier) {
46615
46618
  if (isIdentifier(qualifier)) {
46616
- qualifier = factory.updateIdentifier(qualifier, typeArguments);
46619
+ if (typeArguments !== getIdentifierTypeArguments(qualifier)) {
46620
+ qualifier = setIdentifierTypeArguments(factory.cloneNode(qualifier), typeArguments);
46621
+ }
46617
46622
  } else {
46618
- qualifier = factory.updateQualifiedName(
46619
- qualifier,
46620
- qualifier.left,
46621
- factory.updateIdentifier(qualifier.right, typeArguments)
46622
- );
46623
+ if (typeArguments !== getIdentifierTypeArguments(qualifier.right)) {
46624
+ qualifier = factory.updateQualifiedName(
46625
+ qualifier,
46626
+ qualifier.left,
46627
+ setIdentifierTypeArguments(factory.cloneNode(qualifier.right), typeArguments)
46628
+ );
46629
+ }
46623
46630
  }
46624
46631
  }
46625
46632
  typeArguments = ref.typeArguments;
@@ -46639,13 +46646,17 @@ function createTypeChecker(host) {
46639
46646
  let typeArguments = root.typeArguments;
46640
46647
  let typeName = root.typeName;
46641
46648
  if (isIdentifier(typeName)) {
46642
- typeName = factory.updateIdentifier(typeName, typeArguments);
46649
+ if (typeArguments !== getIdentifierTypeArguments(typeName)) {
46650
+ typeName = setIdentifierTypeArguments(factory.cloneNode(typeName), typeArguments);
46651
+ }
46643
46652
  } else {
46644
- typeName = factory.updateQualifiedName(
46645
- typeName,
46646
- typeName.left,
46647
- factory.updateIdentifier(typeName.right, typeArguments)
46648
- );
46653
+ if (typeArguments !== getIdentifierTypeArguments(typeName.right)) {
46654
+ typeName = factory.updateQualifiedName(
46655
+ typeName,
46656
+ typeName.left,
46657
+ setIdentifierTypeArguments(factory.cloneNode(typeName.right), typeArguments)
46658
+ );
46659
+ }
46649
46660
  }
46650
46661
  typeArguments = ref.typeArguments;
46651
46662
  const ids = getAccessStack(ref);
@@ -47176,9 +47187,11 @@ function createTypeChecker(host) {
47176
47187
  if (accessibleSymbolChain) {
47177
47188
  return accessibleSymbolChain;
47178
47189
  }
47179
- if (// If this is the last part of outputting the symbol, always output. The cases apply only to parent symbols.
47180
- endOfChain || // If a parent symbol is an anonymous type, don't write it.
47181
- !(symbol2.flags & (2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */))) {
47190
+ if (
47191
+ // If this is the last part of outputting the symbol, always output. The cases apply only to parent symbols.
47192
+ endOfChain || // If a parent symbol is an anonymous type, don't write it.
47193
+ !(symbol2.flags & (2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */))
47194
+ ) {
47182
47195
  if (!endOfChain && !yieldModuleSymbol && !!forEach(symbol2.declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {
47183
47196
  return;
47184
47197
  }
@@ -47357,7 +47370,11 @@ function createTypeChecker(host) {
47357
47370
  if (!nonRootParts || isEntityName(nonRootParts)) {
47358
47371
  if (nonRootParts) {
47359
47372
  const lastId = isIdentifier(nonRootParts) ? nonRootParts : nonRootParts.right;
47360
- lastId.typeArguments = void 0;
47373
+ setIdentifierTypeArguments(
47374
+ lastId,
47375
+ /*typeArguments*/
47376
+ void 0
47377
+ );
47361
47378
  }
47362
47379
  return factory.createImportTypeNode(lit, assertion, nonRootParts, typeParameterNodes, isTypeOf);
47363
47380
  } else {
@@ -47374,8 +47391,12 @@ function createTypeChecker(host) {
47374
47391
  return factory.createTypeQueryNode(entityName);
47375
47392
  } else {
47376
47393
  const lastId = isIdentifier(entityName) ? entityName : entityName.right;
47377
- const lastTypeArgs = lastId.typeArguments;
47378
- lastId.typeArguments = void 0;
47394
+ const lastTypeArgs = getIdentifierTypeArguments(lastId);
47395
+ setIdentifierTypeArguments(
47396
+ lastId,
47397
+ /*typeArguments*/
47398
+ void 0
47399
+ );
47379
47400
  return factory.createTypeReferenceNode(entityName, lastTypeArgs);
47380
47401
  }
47381
47402
  function createAccessFromSymbolChain(chain2, index, stopper) {
@@ -47419,7 +47440,9 @@ function createTypeChecker(host) {
47419
47440
  return factory.createIndexedAccessTypeNode(factory.createTypeReferenceNode(LHS, typeParameterNodes), factory.createLiteralTypeNode(factory.createStringLiteral(symbolName2)));
47420
47441
  }
47421
47442
  }
47422
- const identifier = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */);
47443
+ const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 33554432 /* NoAsciiEscaping */);
47444
+ if (typeParameterNodes)
47445
+ setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes));
47423
47446
  identifier.symbol = symbol2;
47424
47447
  if (index > stopper) {
47425
47448
  const LHS = createAccessFromSymbolChain(chain2, index - 1, stopper);
@@ -47477,7 +47500,9 @@ function createTypeChecker(host) {
47477
47500
  text = `${rawtext}_${i}`;
47478
47501
  }
47479
47502
  if (text !== rawtext) {
47480
- result = factory.createIdentifier(text, result.typeArguments);
47503
+ const typeArguments = getIdentifierTypeArguments(result);
47504
+ result = factory.createIdentifier(text);
47505
+ setIdentifierTypeArguments(result, typeArguments);
47481
47506
  }
47482
47507
  (context.typeParameterNamesByTextNextNameCount || (context.typeParameterNamesByTextNextNameCount = /* @__PURE__ */ new Map())).set(rawtext, i);
47483
47508
  (context.typeParameterNames || (context.typeParameterNames = /* @__PURE__ */ new Map())).set(getTypeId(type), result);
@@ -47501,7 +47526,9 @@ function createTypeChecker(host) {
47501
47526
  if (index === 0) {
47502
47527
  context.flags ^= 16777216 /* InInitialEntityName */;
47503
47528
  }
47504
- const identifier = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */);
47529
+ const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 33554432 /* NoAsciiEscaping */);
47530
+ if (typeParameterNodes)
47531
+ setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes));
47505
47532
  identifier.symbol = symbol2;
47506
47533
  return index > 0 ? factory.createQualifiedName(createEntityNameFromSymbolChain(chain2, index - 1), identifier) : identifier;
47507
47534
  }
@@ -47524,7 +47551,9 @@ function createTypeChecker(host) {
47524
47551
  return factory.createStringLiteral(getSpecifierForModuleSymbol(symbol2, context));
47525
47552
  }
47526
47553
  if (index === 0 || canUsePropertyAccess(symbolName2, languageVersion)) {
47527
- const identifier = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */);
47554
+ const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 33554432 /* NoAsciiEscaping */);
47555
+ if (typeParameterNodes)
47556
+ setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes));
47528
47557
  identifier.symbol = symbol2;
47529
47558
  return index > 0 ? factory.createPropertyAccessExpression(createExpressionFromSymbolChain(chain2, index - 1), identifier) : identifier;
47530
47559
  } else {
@@ -47539,8 +47568,11 @@ function createTypeChecker(host) {
47539
47568
  expression = factory.createNumericLiteral(+symbolName2);
47540
47569
  }
47541
47570
  if (!expression) {
47542
- expression = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */);
47543
- expression.symbol = symbol2;
47571
+ const identifier = setEmitFlags(factory.createIdentifier(symbolName2), 33554432 /* NoAsciiEscaping */);
47572
+ if (typeParameterNodes)
47573
+ setIdentifierTypeArguments(identifier, factory.createNodeArray(typeParameterNodes));
47574
+ identifier.symbol = symbol2;
47575
+ expression = identifier;
47544
47576
  }
47545
47577
  return factory.createElementAccessExpression(createExpressionFromSymbolChain(chain2, index - 1), expression);
47546
47578
  }
@@ -47800,7 +47832,8 @@ function createTypeChecker(host) {
47800
47832
  }
47801
47833
  if (isLiteralImportTypeNode(node)) {
47802
47834
  const nodeSymbol = getNodeLinks(node).resolvedSymbol;
47803
- if (isInJSDoc(node) && nodeSymbol && (!node.isTypeOf && !(nodeSymbol.flags & 788968 /* Type */) || // The import type had type arguments autofilled by js fallback logic
47835
+ if (isInJSDoc(node) && nodeSymbol && // The import type resolved using jsdoc fallback logic
47836
+ (!node.isTypeOf && !(nodeSymbol.flags & 788968 /* Type */) || // The import type had type arguments autofilled by js fallback logic
47804
47837
  !(length(node.typeArguments) >= getMinTypeArgumentCount(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(nodeSymbol))))) {
47805
47838
  return setOriginalNode(typeToTypeNodeHelper(getTypeFromTypeNode(node), context), node);
47806
47839
  }
@@ -49317,8 +49350,10 @@ function createTypeChecker(host) {
49317
49350
  }
49318
49351
  }
49319
49352
  function getNameOfSymbolAsWritten(symbol, context) {
49320
- if (context && symbol.escapedName === "default" /* Default */ && !(context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */) && (!(context.flags & 16777216 /* InInitialEntityName */) || // if the symbol is synthesized, it will only be referenced externally it must print as `default`
49321
- !symbol.declarations || context.enclosingDeclaration && findAncestor(symbol.declarations[0], isDefaultBindingContext) !== findAncestor(context.enclosingDeclaration, isDefaultBindingContext))) {
49353
+ if (context && symbol.escapedName === "default" /* Default */ && !(context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */) && // If it's not the first part of an entity name, it must print as `default`
49354
+ (!(context.flags & 16777216 /* InInitialEntityName */) || // if the symbol is synthesized, it will only be referenced externally it must print as `default`
49355
+ !symbol.declarations || // if not in the same binding context (source file, module declaration), it must print as `default`
49356
+ context.enclosingDeclaration && findAncestor(symbol.declarations[0], isDefaultBindingContext) !== findAncestor(context.enclosingDeclaration, isDefaultBindingContext))) {
49322
49357
  return "default";
49323
49358
  }
49324
49359
  if (symbol.declarations && symbol.declarations.length) {
@@ -49839,19 +49874,10 @@ function createTypeChecker(host) {
49839
49874
  }
49840
49875
  }
49841
49876
  if (hasOnlyExpressionInitializer(declaration) && !!declaration.initializer) {
49842
- if (isInJSFile(declaration)) {
49843
- const initializer = declaration.initializer;
49844
- if (!isJSDocSatisfiesExpression(initializer)) {
49845
- const typeNode = getJSDocSatisfiesTypeNode(declaration);
49846
- if (typeNode) {
49847
- return checkSatisfiesExpressionWorker(initializer, typeNode, checkMode);
49848
- }
49849
- }
49850
- if (!isParameter(declaration)) {
49851
- const containerObjectType = getJSContainerObjectType(declaration, getSymbolOfDeclaration(declaration), getDeclaredExpandoInitializer(declaration));
49852
- if (containerObjectType) {
49853
- return containerObjectType;
49854
- }
49877
+ if (isInJSFile(declaration) && !isParameter(declaration)) {
49878
+ const containerObjectType = getJSContainerObjectType(declaration, getSymbolOfDeclaration(declaration), getDeclaredExpandoInitializer(declaration));
49879
+ if (containerObjectType) {
49880
+ return containerObjectType;
49855
49881
  }
49856
49882
  }
49857
49883
  const type = widenTypeInferredFromInitializer(declaration, checkDeclarationInitializer(declaration, checkMode));
@@ -50654,7 +50680,10 @@ function createTypeChecker(host) {
50654
50680
  function getWriteTypeOfSymbol(symbol) {
50655
50681
  const checkFlags = getCheckFlags(symbol);
50656
50682
  if (symbol.flags & 4 /* Property */) {
50657
- return checkFlags & 2 /* SyntheticProperty */ ? checkFlags & 65536 /* DeferredType */ ? getWriteTypeOfSymbolWithDeferredType(symbol) || getTypeOfSymbolWithDeferredType(symbol) : symbol.links.writeType || symbol.links.type : getTypeOfSymbol(symbol);
50683
+ return checkFlags & 2 /* SyntheticProperty */ ? checkFlags & 65536 /* DeferredType */ ? getWriteTypeOfSymbolWithDeferredType(symbol) || getTypeOfSymbolWithDeferredType(symbol) : (
50684
+ // NOTE: cast to TransientSymbol should be safe because only TransientSymbols can have CheckFlags.SyntheticProperty
50685
+ symbol.links.writeType || symbol.links.type
50686
+ ) : getTypeOfSymbol(symbol);
50658
50687
  }
50659
50688
  if (symbol.flags & 98304 /* Accessor */) {
50660
50689
  return checkFlags & 1 /* Instantiated */ ? getWriteTypeOfInstantiatedSymbol(symbol) : getWriteTypeOfAccessors(symbol);
@@ -51384,7 +51413,7 @@ function createTypeChecker(host) {
51384
51413
  const links = getSymbolLinks(symbol);
51385
51414
  if (!links[resolutionKind]) {
51386
51415
  const isStatic2 = resolutionKind === "resolvedExports" /* resolvedExports */;
51387
- const earlySymbols = !isStatic2 ? symbol.members : symbol.flags & 1536 /* Module */ ? getExportsOfModuleWorker(symbol) : symbol.exports;
51416
+ const earlySymbols = !isStatic2 ? symbol.members : symbol.flags & 1536 /* Module */ ? getExportsOfModuleWorker(symbol).exports : symbol.exports;
51388
51417
  links[resolutionKind] = earlySymbols || emptySymbols;
51389
51418
  const lateSymbols = createSymbolTable();
51390
51419
  for (const decl of symbol.declarations || emptyArray) {
@@ -59071,7 +59100,11 @@ function createTypeChecker(host) {
59071
59100
  if (variances === emptyArray) {
59072
59101
  return 1 /* Unknown */;
59073
59102
  }
59074
- const varianceResult = relateVariances(source2.aliasTypeArguments, target2.aliasTypeArguments, variances, intersectionState);
59103
+ const params = getSymbolLinks(source2.aliasSymbol).typeParameters;
59104
+ const minParams = getMinTypeArgumentCount(params);
59105
+ const sourceTypes = fillMissingTypeArguments(source2.aliasTypeArguments, params, minParams, isInJSFile(source2.aliasSymbol.valueDeclaration));
59106
+ const targetTypes = fillMissingTypeArguments(target2.aliasTypeArguments, params, minParams, isInJSFile(source2.aliasSymbol.valueDeclaration));
59107
+ const varianceResult = relateVariances(sourceTypes, targetTypes, variances, intersectionState);
59075
59108
  if (varianceResult !== void 0) {
59076
59109
  return varianceResult;
59077
59110
  }
@@ -61054,19 +61087,22 @@ function createTypeChecker(host) {
61054
61087
  break;
61055
61088
  case 166 /* Parameter */:
61056
61089
  const param = declaration;
61057
- if (isIdentifier(param.name) && (isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.indexOf(param) > -1 && (resolveName(
61058
- param,
61059
- param.name.escapedText,
61060
- 788968 /* Type */,
61061
- void 0,
61062
- param.name.escapedText,
61063
- /*isUse*/
61064
- true
61065
- ) || param.name.originalKeywordKind && isTypeNodeKind(param.name.originalKeywordKind))) {
61066
- const newName = "arg" + param.parent.parameters.indexOf(param);
61067
- const typeName = declarationNameToString(param.name) + (param.dotDotDotToken ? "[]" : "");
61068
- errorOrSuggestion(noImplicitAny, declaration, Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, newName, typeName);
61069
- return;
61090
+ if (isIdentifier(param.name)) {
61091
+ const originalKeywordKind = identifierToKeywordKind(param.name);
61092
+ if ((isCallSignatureDeclaration(param.parent) || isMethodSignature(param.parent) || isFunctionTypeNode(param.parent)) && param.parent.parameters.indexOf(param) > -1 && (resolveName(
61093
+ param,
61094
+ param.name.escapedText,
61095
+ 788968 /* Type */,
61096
+ void 0,
61097
+ param.name.escapedText,
61098
+ /*isUse*/
61099
+ true
61100
+ ) || originalKeywordKind && isTypeNodeKind(originalKeywordKind))) {
61101
+ const newName = "arg" + param.parent.parameters.indexOf(param);
61102
+ const typeName = declarationNameToString(param.name) + (param.dotDotDotToken ? "[]" : "");
61103
+ errorOrSuggestion(noImplicitAny, declaration, Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1, newName, typeName);
61104
+ return;
61105
+ }
61070
61106
  }
61071
61107
  diagnostic = declaration.dotDotDotToken ? noImplicitAny ? Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : Diagnostics.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage : noImplicitAny ? Diagnostics.Parameter_0_implicitly_has_an_1_type : Diagnostics.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage;
61072
61108
  break;
@@ -61254,6 +61290,10 @@ function createTypeChecker(host) {
61254
61290
  function isTypeParameterAtTopLevel(type, typeParameter) {
61255
61291
  return !!(type === typeParameter || type.flags & 3145728 /* UnionOrIntersection */ && some(type.types, (t) => isTypeParameterAtTopLevel(t, typeParameter)) || type.flags & 16777216 /* Conditional */ && (getTrueTypeFromConditionalType(type) === typeParameter || getFalseTypeFromConditionalType(type) === typeParameter));
61256
61292
  }
61293
+ function isTypeParameterAtTopLevelInReturnType(signature, typeParameter) {
61294
+ const typePredicate = getTypePredicateOfSignature(signature);
61295
+ return typePredicate ? !!typePredicate.type && isTypeParameterAtTopLevel(typePredicate.type, typeParameter) : isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), typeParameter);
61296
+ }
61257
61297
  function createEmptyObjectTypeFromStringLiteral(type) {
61258
61298
  const members = createSymbolTable();
61259
61299
  forEachType(type, (t) => {
@@ -61528,7 +61568,11 @@ function createTypeChecker(host) {
61528
61568
  }
61529
61569
  if (source.aliasSymbol && source.aliasSymbol === target.aliasSymbol) {
61530
61570
  if (source.aliasTypeArguments) {
61531
- inferFromTypeArguments(source.aliasTypeArguments, target.aliasTypeArguments, getAliasVariances(source.aliasSymbol));
61571
+ const params = getSymbolLinks(source.aliasSymbol).typeParameters;
61572
+ const minParams = getMinTypeArgumentCount(params);
61573
+ const sourceTypes = fillMissingTypeArguments(source.aliasTypeArguments, params, minParams, isInJSFile(source.aliasSymbol.valueDeclaration));
61574
+ const targetTypes = fillMissingTypeArguments(target.aliasTypeArguments, params, minParams, isInJSFile(source.aliasSymbol.valueDeclaration));
61575
+ inferFromTypeArguments(sourceTypes, targetTypes, getAliasVariances(source.aliasSymbol));
61532
61576
  }
61533
61577
  return;
61534
61578
  }
@@ -62121,7 +62165,7 @@ function createTypeChecker(host) {
62121
62165
  function getCovariantInference(inference, signature) {
62122
62166
  const candidates = unionObjectAndArrayLiteralCandidates(inference.candidates);
62123
62167
  const primitiveConstraint = hasPrimitiveConstraint(inference.typeParameter) || isConstTypeVariable(inference.typeParameter);
62124
- const widenLiteralTypes = !primitiveConstraint && inference.topLevel && (inference.isFixed || !isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), inference.typeParameter));
62168
+ const widenLiteralTypes = !primitiveConstraint && inference.topLevel && (inference.isFixed || !isTypeParameterAtTopLevelInReturnType(signature, inference.typeParameter));
62125
62169
  const baseCandidates = primitiveConstraint ? sameMap(candidates, getRegularTypeOfLiteralType) : widenLiteralTypes ? sameMap(candidates, getWidenedLiteralType) : candidates;
62126
62170
  const unwidenedType = inference.priority & 416 /* PriorityImpliesCombination */ ? getUnionType(baseCandidates, 2 /* Subtype */) : getCommonSupertype(baseCandidates);
62127
62171
  return getWidenedType(unwidenedType);
@@ -63935,18 +63979,20 @@ function createTypeChecker(host) {
63935
63979
  return narrowTypeByTypeFacts(type, nonPrimitiveType, 128 /* TypeofEQHostObject */);
63936
63980
  }
63937
63981
  function narrowTypeByTypeFacts(type, impliedType, facts) {
63938
- return mapType(type, (t) => // We first check if a constituent is a subtype of the implied type. If so, we either keep or eliminate
63939
- // the constituent based on its type facts. We use the strict subtype relation because it treats `object`
63940
- // as a subtype of `{}`, and we need the type facts check because function types are subtypes of `object`,
63941
- // but are classified as "function" according to `typeof`.
63942
- isTypeRelatedTo(t, impliedType, strictSubtypeRelation) ? getTypeFacts(t) & facts ? t : neverType : (
63943
- // We next check if the consituent is a supertype of the implied type. If so, we substitute the implied
63944
- // type. This handles top types like `unknown` and `{}`, and supertypes like `{ toString(): string }`.
63945
- isTypeSubtypeOf(impliedType, t) ? impliedType : (
63946
- // Neither the constituent nor the implied type is a subtype of the other, however their domains may still
63947
- // overlap. For example, an unconstrained type parameter and type `string`. If the type facts indicate
63948
- // possible overlap, we form an intersection. Otherwise, we eliminate the constituent.
63949
- getTypeFacts(t) & facts ? getIntersectionType([t, impliedType]) : neverType
63982
+ return mapType(type, (t) => (
63983
+ // We first check if a constituent is a subtype of the implied type. If so, we either keep or eliminate
63984
+ // the constituent based on its type facts. We use the strict subtype relation because it treats `object`
63985
+ // as a subtype of `{}`, and we need the type facts check because function types are subtypes of `object`,
63986
+ // but are classified as "function" according to `typeof`.
63987
+ isTypeRelatedTo(t, impliedType, strictSubtypeRelation) ? getTypeFacts(t) & facts ? t : neverType : (
63988
+ // We next check if the consituent is a supertype of the implied type. If so, we substitute the implied
63989
+ // type. This handles top types like `unknown` and `{}`, and supertypes like `{ toString(): string }`.
63990
+ isTypeSubtypeOf(impliedType, t) ? impliedType : (
63991
+ // Neither the constituent nor the implied type is a subtype of the other, however their domains may still
63992
+ // overlap. For example, an unconstrained type parameter and type `string`. If the type facts indicate
63993
+ // possible overlap, we form an intersection. Otherwise, we eliminate the constituent.
63994
+ getTypeFacts(t) & facts ? getIntersectionType([t, impliedType]) : neverType
63995
+ )
63950
63996
  )
63951
63997
  ));
63952
63998
  }
@@ -64962,7 +65008,7 @@ function createTypeChecker(host) {
64962
65008
  }
64963
65009
  }
64964
65010
  function getContextualTypeForVariableLikeDeclaration(declaration, contextFlags) {
64965
- const typeNode = getEffectiveTypeAnnotationNode(declaration) || (isInJSFile(declaration) ? getJSDocSatisfiesTypeNode(declaration) : void 0);
65011
+ const typeNode = getEffectiveTypeAnnotationNode(declaration);
64966
65012
  if (typeNode) {
64967
65013
  return getTypeFromTypeNode(typeNode);
64968
65014
  }
@@ -65569,16 +65615,8 @@ function createTypeChecker(host) {
65569
65615
  Debug.assert(parent.parent.kind === 225 /* TemplateExpression */);
65570
65616
  return getContextualTypeForSubstitutionExpression(parent.parent, node);
65571
65617
  case 214 /* ParenthesizedExpression */: {
65572
- if (isInJSFile(parent)) {
65573
- if (isJSDocSatisfiesExpression(parent)) {
65574
- return getTypeFromTypeNode(getJSDocSatisfiesExpressionType(parent));
65575
- }
65576
- const typeTag = getJSDocTypeTag(parent);
65577
- if (typeTag && !isConstTypeReference(typeTag.typeExpression.type)) {
65578
- return getTypeFromTypeNode(typeTag.typeExpression.type);
65579
- }
65580
- }
65581
- return getContextualType(parent, contextFlags);
65618
+ const tag = isInJSFile(parent) ? getJSDocTypeTag(parent) : void 0;
65619
+ return !tag ? getContextualType(parent, contextFlags) : isJSDocTypeTag(tag) && isConstTypeReference(tag.typeExpression.type) ? getContextualType(parent, contextFlags) : getTypeFromTypeNode(tag.typeExpression.type);
65582
65620
  }
65583
65621
  case 232 /* NonNullExpression */:
65584
65622
  return getContextualType(parent, contextFlags);
@@ -69782,15 +69820,12 @@ function createTypeChecker(host) {
69782
69820
  }
69783
69821
  function checkSatisfiesExpression(node) {
69784
69822
  checkSourceElement(node.type);
69785
- return checkSatisfiesExpressionWorker(node.expression, node.type);
69786
- }
69787
- function checkSatisfiesExpressionWorker(expression, target, checkMode) {
69788
- const exprType = checkExpression(expression, checkMode);
69789
- const targetType = getTypeFromTypeNode(target);
69823
+ const exprType = checkExpression(node.expression);
69824
+ const targetType = getTypeFromTypeNode(node.type);
69790
69825
  if (isErrorType(targetType)) {
69791
69826
  return targetType;
69792
69827
  }
69793
- checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, target, expression, Diagnostics.Type_0_does_not_satisfy_the_expected_type_1);
69828
+ checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, node.type, node.expression, Diagnostics.Type_0_does_not_satisfy_the_expected_type_1);
69794
69829
  return exprType;
69795
69830
  }
69796
69831
  function checkMetaProperty(node) {
@@ -71528,7 +71563,8 @@ function createTypeChecker(host) {
71528
71563
  }
71529
71564
  }
71530
71565
  function isIndirectCall(node) {
71531
- return node.parent.kind === 214 /* ParenthesizedExpression */ && isNumericLiteral(node.left) && node.left.text === "0" && (isCallExpression(node.parent.parent) && node.parent.parent.expression === node.parent || node.parent.parent.kind === 212 /* TaggedTemplateExpression */) && (isAccessExpression(node.right) || isIdentifier(node.right) && node.right.escapedText === "eval");
71566
+ return node.parent.kind === 214 /* ParenthesizedExpression */ && isNumericLiteral(node.left) && node.left.text === "0" && (isCallExpression(node.parent.parent) && node.parent.parent.expression === node.parent || node.parent.parent.kind === 212 /* TaggedTemplateExpression */) && // special-case for "eval" because it's the only non-access case where an indirect call actually affects behavior.
71567
+ (isAccessExpression(node.right) || isIdentifier(node.right) && node.right.escapedText === "eval");
71532
71568
  }
71533
71569
  function checkForDisallowedESSymbolOperand(operator2) {
71534
71570
  const offendingSymbolOperand = maybeTypeOfKindConsideringBaseConstraint(leftType, 12288 /* ESSymbolLike */) ? left : maybeTypeOfKindConsideringBaseConstraint(rightType, 12288 /* ESSymbolLike */) ? right : void 0;
@@ -72148,14 +72184,9 @@ function createTypeChecker(host) {
72148
72184
  }
72149
72185
  }
72150
72186
  function checkParenthesizedExpression(node, checkMode) {
72151
- if (hasJSDocNodes(node)) {
72152
- if (isJSDocSatisfiesExpression(node)) {
72153
- return checkSatisfiesExpressionWorker(node.expression, getJSDocSatisfiesExpressionType(node), checkMode);
72154
- }
72155
- if (isJSDocTypeAssertion(node)) {
72156
- const type = getJSDocTypeAssertionType(node);
72157
- return checkAssertionWorker(type, type, node.expression, checkMode);
72158
- }
72187
+ if (hasJSDocNodes(node) && isJSDocTypeAssertion(node)) {
72188
+ const type = getJSDocTypeAssertionType(node);
72189
+ return checkAssertionWorker(type, type, node.expression, checkMode);
72159
72190
  }
72160
72191
  return checkExpression(node.expression, checkMode);
72161
72192
  }
@@ -72863,8 +72894,11 @@ function createTypeChecker(host) {
72863
72894
  }
72864
72895
  function checkTypeReferenceNode(node) {
72865
72896
  checkGrammarTypeArguments(node, node.typeArguments);
72866
- if (node.kind === 180 /* TypeReference */ && node.typeName.jsdocDotPos !== void 0 && !isInJSFile(node) && !isInJSDoc(node)) {
72867
- grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments);
72897
+ if (node.kind === 180 /* TypeReference */ && !isInJSFile(node) && !isInJSDoc(node) && node.typeArguments && node.typeName.end !== node.typeArguments.pos) {
72898
+ const sourceFile = getSourceFileOfNode(node);
72899
+ if (scanTokenAtPosition(sourceFile, node.typeName.end) === 24 /* DotToken */) {
72900
+ grammarErrorAtPos(node, skipTrivia(sourceFile.text, node.typeName.end), 1, Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments);
72901
+ }
72868
72902
  }
72869
72903
  forEach(node.typeArguments, checkSourceElement);
72870
72904
  const type = getTypeFromTypeReference(node);
@@ -73854,9 +73888,6 @@ function createTypeChecker(host) {
73854
73888
  function checkJSDocTypeTag(node) {
73855
73889
  checkSourceElement(node.typeExpression);
73856
73890
  }
73857
- function checkJSDocSatisfiesTag(node) {
73858
- checkSourceElement(node.typeExpression);
73859
- }
73860
73891
  function checkJSDocLinkLikeTag(node) {
73861
73892
  if (node.name) {
73862
73893
  resolveJSDocMemberName(
@@ -77132,12 +77163,8 @@ function createTypeChecker(host) {
77132
77163
  }
77133
77164
  function checkGrammarExportDeclaration(node) {
77134
77165
  var _a2;
77135
- if (node.isTypeOnly) {
77136
- if (((_a2 = node.exportClause) == null ? void 0 : _a2.kind) === 276 /* NamedExports */) {
77137
- return checkGrammarNamedImportsOrExports(node.exportClause);
77138
- } else {
77139
- return grammarErrorOnNode(node, Diagnostics.Only_named_exports_may_use_export_type);
77140
- }
77166
+ if (node.isTypeOnly && ((_a2 = node.exportClause) == null ? void 0 : _a2.kind) === 276 /* NamedExports */) {
77167
+ return checkGrammarNamedImportsOrExports(node.exportClause);
77141
77168
  }
77142
77169
  return false;
77143
77170
  }
@@ -77461,8 +77488,6 @@ function createTypeChecker(host) {
77461
77488
  case 338 /* JSDocProtectedTag */:
77462
77489
  case 337 /* JSDocPrivateTag */:
77463
77490
  return checkJSDocAccessibilityModifiers(node);
77464
- case 353 /* JSDocSatisfiesTag */:
77465
- return checkJSDocSatisfiesTag(node);
77466
77491
  case 196 /* IndexedAccessType */:
77467
77492
  return checkIndexedAccessType(node);
77468
77493
  case 197 /* MappedType */:
@@ -78478,8 +78503,9 @@ function createTypeChecker(host) {
78478
78503
  }
78479
78504
  }
78480
78505
  function getReferencedImportDeclaration(nodeIn) {
78481
- if (nodeIn.generatedImportReference) {
78482
- return nodeIn.generatedImportReference;
78506
+ const specifier = getIdentifierGeneratedImportReference(nodeIn);
78507
+ if (specifier) {
78508
+ return specifier;
78483
78509
  }
78484
78510
  const node = getParseTreeNode(nodeIn, isIdentifier);
78485
78511
  if (node) {
@@ -78623,7 +78649,12 @@ function createTypeChecker(host) {
78623
78649
  return false;
78624
78650
  const symbol = getSymbolOfDeclaration(node);
78625
78651
  const signaturesOfSymbol = getSignaturesOfSymbol(symbol);
78626
- return signaturesOfSymbol.length > 1 || signaturesOfSymbol.length === 1 && signaturesOfSymbol[0].declaration !== node;
78652
+ return signaturesOfSymbol.length > 1 || // If there is single signature for the symbol, it is overload if that signature isn't coming from the node
78653
+ // e.g.: function foo(a: string): string;
78654
+ // function foo(a: any) { // This is implementation of the overloads
78655
+ // return a;
78656
+ // }
78657
+ signaturesOfSymbol.length === 1 && signaturesOfSymbol[0].declaration !== node;
78627
78658
  }
78628
78659
  return false;
78629
78660
  }
@@ -80452,7 +80483,7 @@ function createTypeChecker(host) {
80452
80483
  }
80453
80484
  function checkGrammarNameInLetOrConstDeclarations(name) {
80454
80485
  if (name.kind === 79 /* Identifier */) {
80455
- if (name.originalKeywordKind === 119 /* LetKeyword */) {
80486
+ if (name.escapedText === "let") {
80456
80487
  return grammarErrorOnNode(name, Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations);
80457
80488
  }
80458
80489
  } else {
@@ -81256,12 +81287,6 @@ function visitEachChild(node, visitor, context, nodesVisitor = visitNodes2, toke
81256
81287
  return fn === void 0 ? node : fn(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor);
81257
81288
  }
81258
81289
  var visitEachChildTable = {
81259
- [79 /* Identifier */]: function visitEachChildOfIdentifier(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
81260
- return context.factory.updateIdentifier(
81261
- node,
81262
- nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)
81263
- );
81264
- },
81265
81290
  [163 /* QualifiedName */]: function visitEachChildOfQualifiedName(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
81266
81291
  return context.factory.updateQualifiedName(
81267
81292
  node,
@@ -82276,13 +82301,13 @@ var visitEachChildTable = {
82276
82301
  );
82277
82302
  },
82278
82303
  // Transformation nodes
82279
- [356 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
82304
+ [355 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
82280
82305
  return context.factory.updatePartiallyEmittedExpression(
82281
82306
  node,
82282
82307
  nodeVisitor(node.expression, visitor, isExpression)
82283
82308
  );
82284
82309
  },
82285
- [357 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
82310
+ [356 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
82286
82311
  return context.factory.updateCommaListExpression(
82287
82312
  node,
82288
82313
  nodesVisitor(node.elements, visitor, isExpression)
@@ -86297,7 +86322,7 @@ function transformClassFields(context) {
86297
86322
  if (isClassWithConstructorReference) {
86298
86323
  enableSubstitutionForClassAliases();
86299
86324
  const alias = factory2.cloneNode(temp);
86300
- alias.autoGenerate.flags &= ~8 /* ReservedInNestedScopes */;
86325
+ alias.emitNode.autoGenerate.flags &= ~8 /* ReservedInNestedScopes */;
86301
86326
  classAliases[getOriginalNodeId(node)] = alias;
86302
86327
  }
86303
86328
  setEmitFlags(classExpression, 131072 /* Indented */ | getEmitFlags(classExpression));
@@ -88863,7 +88888,7 @@ function transformES2018(context) {
88863
88888
  return visitObjectLiteralExpression(node);
88864
88889
  case 223 /* BinaryExpression */:
88865
88890
  return visitBinaryExpression(node, expressionResultIsUnused2);
88866
- case 357 /* CommaListExpression */:
88891
+ case 356 /* CommaListExpression */:
88867
88892
  return visitCommaListExpression(node, expressionResultIsUnused2);
88868
88893
  case 295 /* CatchClause */:
88869
88894
  return visitCatchClause(node);
@@ -90433,7 +90458,7 @@ function transformJsx(context) {
90433
90458
  factory2.createIdentifier(name),
90434
90459
  generatedName
90435
90460
  );
90436
- generatedName.generatedImportReference = specifier;
90461
+ setIdentifierGeneratedImportReference(generatedName, specifier);
90437
90462
  specifierSourceImports.set(name, specifier);
90438
90463
  return generatedName;
90439
90464
  }
@@ -91441,7 +91466,7 @@ function transformES2015(context) {
91441
91466
  return visitParenthesizedExpression(node, expressionResultIsUnused2);
91442
91467
  case 223 /* BinaryExpression */:
91443
91468
  return visitBinaryExpression(node, expressionResultIsUnused2);
91444
- case 357 /* CommaListExpression */:
91469
+ case 356 /* CommaListExpression */:
91445
91470
  return visitCommaListExpression(node, expressionResultIsUnused2);
91446
91471
  case 14 /* NoSubstitutionTemplateLiteral */:
91447
91472
  case 15 /* TemplateHead */:
@@ -91576,7 +91601,7 @@ function transformES2015(context) {
91576
91601
  return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = factory2.createUniqueName("arguments"));
91577
91602
  }
91578
91603
  }
91579
- if (node.hasExtendedUnicodeEscape) {
91604
+ if (node.flags & 128 /* IdentifierHasExtendedUnicodeEscape */) {
91580
91605
  return setOriginalNode(setTextRange(
91581
91606
  factory2.createIdentifier(unescapeLeadingUnderscores(node.escapedText)),
91582
91607
  node
@@ -94457,7 +94482,7 @@ function transformES5(context) {
94457
94482
  return node;
94458
94483
  }
94459
94484
  function trySubstituteReservedName(name) {
94460
- const token = name.originalKeywordKind || (nodeIsSynthesized(name) ? stringToToken(idText(name)) : void 0);
94485
+ const token = identifierToKeywordKind(name);
94461
94486
  if (token !== void 0 && token >= 81 /* FirstReservedWord */ && token <= 116 /* LastReservedWord */) {
94462
94487
  return setTextRange(factory2.createStringLiteralFromNode(name), name);
94463
94488
  }
@@ -94593,7 +94618,7 @@ function transformGenerators(context) {
94593
94618
  switch (node.kind) {
94594
94619
  case 223 /* BinaryExpression */:
94595
94620
  return visitBinaryExpression(node);
94596
- case 357 /* CommaListExpression */:
94621
+ case 356 /* CommaListExpression */:
94597
94622
  return visitCommaListExpression(node);
94598
94623
  case 224 /* ConditionalExpression */:
94599
94624
  return visitConditionalExpression(node);
@@ -96932,9 +96957,9 @@ function transformModule(context) {
96932
96957
  return visitFunctionDeclaration(node);
96933
96958
  case 260 /* ClassDeclaration */:
96934
96959
  return visitClassDeclaration(node);
96935
- case 358 /* MergeDeclarationMarker */:
96960
+ case 357 /* MergeDeclarationMarker */:
96936
96961
  return visitMergeDeclarationMarker(node);
96937
- case 359 /* EndOfDeclarationMarker */:
96962
+ case 358 /* EndOfDeclarationMarker */:
96938
96963
  return visitEndOfDeclarationMarker(node);
96939
96964
  default:
96940
96965
  return visitor(node);
@@ -96951,7 +96976,7 @@ function transformModule(context) {
96951
96976
  return visitExpressionStatement(node);
96952
96977
  case 214 /* ParenthesizedExpression */:
96953
96978
  return visitParenthesizedExpression(node, valueIsDiscarded);
96954
- case 356 /* PartiallyEmittedExpression */:
96979
+ case 355 /* PartiallyEmittedExpression */:
96955
96980
  return visitPartiallyEmittedExpression(node, valueIsDiscarded);
96956
96981
  case 210 /* CallExpression */:
96957
96982
  if (isImportCall(node) && currentSourceFile.impliedNodeFormat === void 0) {
@@ -98125,7 +98150,7 @@ function transformModule(context) {
98125
98150
  return factory2.createPropertyAccessExpression(externalHelpersModuleName, node);
98126
98151
  }
98127
98152
  return node;
98128
- } else if (!(isGeneratedIdentifier(node) && !(node.autoGenerate.flags & 64 /* AllowNameSubstitution */)) && !isLocalName(node)) {
98153
+ } else if (!(isGeneratedIdentifier(node) && !(node.emitNode.autoGenerate.flags & 64 /* AllowNameSubstitution */)) && !isLocalName(node)) {
98129
98154
  const exportContainer = resolver.getReferencedExportContainer(node, isExportName(node));
98130
98155
  if (exportContainer && exportContainer.kind === 308 /* SourceFile */) {
98131
98156
  return setTextRange(
@@ -99067,9 +99092,9 @@ function transformSystemModule(context) {
99067
99092
  return visitCatchClause(node);
99068
99093
  case 238 /* Block */:
99069
99094
  return visitBlock(node);
99070
- case 358 /* MergeDeclarationMarker */:
99095
+ case 357 /* MergeDeclarationMarker */:
99071
99096
  return visitMergeDeclarationMarker(node);
99072
- case 359 /* EndOfDeclarationMarker */:
99097
+ case 358 /* EndOfDeclarationMarker */:
99073
99098
  return visitEndOfDeclarationMarker(node);
99074
99099
  default:
99075
99100
  return visitor(node);
@@ -99225,7 +99250,7 @@ function transformSystemModule(context) {
99225
99250
  return visitExpressionStatement(node);
99226
99251
  case 214 /* ParenthesizedExpression */:
99227
99252
  return visitParenthesizedExpression(node, valueIsDiscarded);
99228
- case 356 /* PartiallyEmittedExpression */:
99253
+ case 355 /* PartiallyEmittedExpression */:
99229
99254
  return visitPartiallyEmittedExpression(node, valueIsDiscarded);
99230
99255
  case 223 /* BinaryExpression */:
99231
99256
  if (isDestructuringAssignment(node)) {
@@ -101912,7 +101937,7 @@ function noEmitNotification(hint, node, callback) {
101912
101937
  }
101913
101938
  function transformNodes(resolver, host, factory2, options, nodes, transformers, allowDtsFiles) {
101914
101939
  var _a2, _b;
101915
- const enabledSyntaxKindFeatures = new Array(361 /* Count */);
101940
+ const enabledSyntaxKindFeatures = new Array(360 /* Count */);
101916
101941
  let lexicalEnvironmentVariableDeclarations;
101917
101942
  let lexicalEnvironmentFunctionDeclarations;
101918
101943
  let lexicalEnvironmentStatements;
@@ -103786,7 +103811,6 @@ function createPrinter(printerOptions = {}, handlers = {}) {
103786
103811
  case 346 /* JSDocThisTag */:
103787
103812
  case 347 /* JSDocTypeTag */:
103788
103813
  case 352 /* JSDocThrowsTag */:
103789
- case 353 /* JSDocSatisfiesTag */:
103790
103814
  return emitJSDocSimpleTypedTag(node);
103791
103815
  case 348 /* JSDocTemplateTag */:
103792
103816
  return emitJSDocTemplateTag(node);
@@ -103794,9 +103818,9 @@ function createPrinter(printerOptions = {}, handlers = {}) {
103794
103818
  return emitJSDocTypedefTag(node);
103795
103819
  case 350 /* JSDocSeeTag */:
103796
103820
  return emitJSDocSeeTag(node);
103797
- case 355 /* NotEmittedStatement */:
103798
- case 359 /* EndOfDeclarationMarker */:
103799
- case 358 /* MergeDeclarationMarker */:
103821
+ case 354 /* NotEmittedStatement */:
103822
+ case 358 /* EndOfDeclarationMarker */:
103823
+ case 357 /* MergeDeclarationMarker */:
103800
103824
  return;
103801
103825
  }
103802
103826
  if (isExpression(node)) {
@@ -103895,18 +103919,18 @@ function createPrinter(printerOptions = {}, handlers = {}) {
103895
103919
  return emitJsxSelfClosingElement(node);
103896
103920
  case 285 /* JsxFragment */:
103897
103921
  return emitJsxFragment(node);
103898
- case 354 /* SyntaxList */:
103922
+ case 353 /* SyntaxList */:
103899
103923
  return Debug.fail("SyntaxList should not be printed");
103900
- case 355 /* NotEmittedStatement */:
103924
+ case 354 /* NotEmittedStatement */:
103901
103925
  return;
103902
- case 356 /* PartiallyEmittedExpression */:
103926
+ case 355 /* PartiallyEmittedExpression */:
103903
103927
  return emitPartiallyEmittedExpression(node);
103904
- case 357 /* CommaListExpression */:
103928
+ case 356 /* CommaListExpression */:
103905
103929
  return emitCommaList(node);
103906
- case 358 /* MergeDeclarationMarker */:
103907
- case 359 /* EndOfDeclarationMarker */:
103930
+ case 357 /* MergeDeclarationMarker */:
103931
+ case 358 /* EndOfDeclarationMarker */:
103908
103932
  return;
103909
- case 360 /* SyntheticReferenceExpression */:
103933
+ case 359 /* SyntheticReferenceExpression */:
103910
103934
  return Debug.fail("SyntheticReferenceExpression should not be printed");
103911
103935
  }
103912
103936
  }
@@ -104079,7 +104103,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
104079
104103
  /*includeTrivia*/
104080
104104
  false
104081
104105
  ), node.symbol);
104082
- emitList(node, node.typeArguments, 53776 /* TypeParameters */);
104106
+ emitList(node, getIdentifierTypeArguments(node), 53776 /* TypeParameters */);
104083
104107
  }
104084
104108
  function emitPrivateIdentifier(node) {
104085
104109
  write(getTextOfNode2(
@@ -106797,10 +106821,11 @@ function createPrinter(printerOptions = {}, handlers = {}) {
106797
106821
  }
106798
106822
  }
106799
106823
  function generateName(name) {
106800
- if ((name.autoGenerate.flags & 7 /* KindMask */) === 4 /* Node */) {
106801
- return generateNameCached(getNodeForGeneratedName(name), isPrivateIdentifier(name), name.autoGenerate.flags, name.autoGenerate.prefix, name.autoGenerate.suffix);
106824
+ const autoGenerate = name.emitNode.autoGenerate;
106825
+ if ((autoGenerate.flags & 7 /* KindMask */) === 4 /* Node */) {
106826
+ return generateNameCached(getNodeForGeneratedName(name), isPrivateIdentifier(name), autoGenerate.flags, autoGenerate.prefix, autoGenerate.suffix);
106802
106827
  } else {
106803
- const autoGenerateId = name.autoGenerate.id;
106828
+ const autoGenerateId = autoGenerate.id;
106804
106829
  return autoGeneratedIdToGeneratedName[autoGenerateId] || (autoGeneratedIdToGeneratedName[autoGenerateId] = makeName(name));
106805
106830
  }
106806
106831
  }
@@ -107080,16 +107105,17 @@ function createPrinter(printerOptions = {}, handlers = {}) {
107080
107105
  }
107081
107106
  }
107082
107107
  function makeName(name) {
107083
- const prefix = formatGeneratedNamePart(name.autoGenerate.prefix, generateName);
107084
- const suffix = formatGeneratedNamePart(name.autoGenerate.suffix);
107085
- switch (name.autoGenerate.flags & 7 /* KindMask */) {
107108
+ const autoGenerate = name.emitNode.autoGenerate;
107109
+ const prefix = formatGeneratedNamePart(autoGenerate.prefix, generateName);
107110
+ const suffix = formatGeneratedNamePart(autoGenerate.suffix);
107111
+ switch (autoGenerate.flags & 7 /* KindMask */) {
107086
107112
  case 1 /* Auto */:
107087
- return makeTempVariableName(TempFlags.Auto, !!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix);
107113
+ return makeTempVariableName(TempFlags.Auto, !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */), isPrivateIdentifier(name), prefix, suffix);
107088
107114
  case 2 /* Loop */:
107089
107115
  Debug.assertNode(name, isIdentifier);
107090
107116
  return makeTempVariableName(
107091
107117
  TempFlags._i,
107092
- !!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */),
107118
+ !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */),
107093
107119
  /*privateName*/
107094
107120
  false,
107095
107121
  prefix,
@@ -107098,16 +107124,16 @@ function createPrinter(printerOptions = {}, handlers = {}) {
107098
107124
  case 3 /* Unique */:
107099
107125
  return makeUniqueName(
107100
107126
  idText(name),
107101
- name.autoGenerate.flags & 32 /* FileLevel */ ? isFileLevelUniqueName2 : isUniqueName,
107102
- !!(name.autoGenerate.flags & 16 /* Optimistic */),
107103
- !!(name.autoGenerate.flags & 8 /* ReservedInNestedScopes */),
107127
+ autoGenerate.flags & 32 /* FileLevel */ ? isFileLevelUniqueName2 : isUniqueName,
107128
+ !!(autoGenerate.flags & 16 /* Optimistic */),
107129
+ !!(autoGenerate.flags & 8 /* ReservedInNestedScopes */),
107104
107130
  isPrivateIdentifier(name),
107105
107131
  prefix,
107106
107132
  suffix
107107
107133
  );
107108
107134
  }
107109
107135
  return Debug.fail(`Unsupported GeneratedIdentifierKind: ${Debug.formatEnum(
107110
- name.autoGenerate.flags & 7 /* KindMask */,
107136
+ autoGenerate.flags & 7 /* KindMask */,
107111
107137
  GeneratedIdentifierFlags,
107112
107138
  /*isFlags*/
107113
107139
  true
@@ -107152,7 +107178,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
107152
107178
  emitLeadingComments(
107153
107179
  pos,
107154
107180
  /*isEmittedNode*/
107155
- node.kind !== 355 /* NotEmittedStatement */
107181
+ node.kind !== 354 /* NotEmittedStatement */
107156
107182
  );
107157
107183
  }
107158
107184
  if (!skipLeadingComments || pos >= 0 && (emitFlags & 1024 /* NoLeadingComments */) !== 0) {
@@ -107176,7 +107202,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
107176
107202
  containerPos = savedContainerPos;
107177
107203
  containerEnd = savedContainerEnd;
107178
107204
  declarationListContainerEnd = savedDeclarationListContainerEnd;
107179
- if (!skipTrailingComments && node.kind !== 355 /* NotEmittedStatement */) {
107205
+ if (!skipTrailingComments && node.kind !== 354 /* NotEmittedStatement */) {
107180
107206
  emitTrailingComments(end);
107181
107207
  }
107182
107208
  }
@@ -107448,7 +107474,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
107448
107474
  }
107449
107475
  } else {
107450
107476
  const source = sourceMapRange.source || sourceMapSource;
107451
- if (node.kind !== 355 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) {
107477
+ if (node.kind !== 354 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) {
107452
107478
  emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos));
107453
107479
  }
107454
107480
  if (emitFlags & 128 /* NoNestedSourceMaps */) {
@@ -107463,7 +107489,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
107463
107489
  if (emitFlags & 128 /* NoNestedSourceMaps */) {
107464
107490
  sourceMapsDisabled = false;
107465
107491
  }
107466
- if (node.kind !== 355 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) {
107492
+ if (node.kind !== 354 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) {
107467
107493
  emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end);
107468
107494
  }
107469
107495
  }
@@ -109037,7 +109063,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
109037
109063
  const oldSourceFiles = oldProgram.getSourceFiles();
109038
109064
  for (const oldSourceFile of oldSourceFiles) {
109039
109065
  const newFile = getSourceFileByPath(oldSourceFile.resolvedPath);
109040
- if (shouldCreateNewSourceFile || !newFile || newFile.impliedNodeFormat !== oldSourceFile.impliedNodeFormat || oldSourceFile.resolvedPath === oldSourceFile.path && newFile.resolvedPath !== oldSourceFile.path) {
109066
+ if (shouldCreateNewSourceFile || !newFile || newFile.impliedNodeFormat !== oldSourceFile.impliedNodeFormat || // old file wasn't redirect but new file is
109067
+ oldSourceFile.resolvedPath === oldSourceFile.path && newFile.resolvedPath !== oldSourceFile.path) {
109041
109068
  host.onReleaseOldSourceFile(oldSourceFile, oldProgram.getCompilerOptions(), !!getSourceFileByPath(oldSourceFile.path));
109042
109069
  }
109043
109070
  }
@@ -113733,7 +113760,8 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
113733
113760
  const name = loader.nameAndMode.getName(entry);
113734
113761
  const mode = loader.nameAndMode.getMode(entry, containingSourceFile);
113735
113762
  let resolution = resolutionsInFile.get(name, mode);
113736
- if (!seenNamesInFile.has(name, mode) && unmatchedRedirects || !resolution || resolution.isInvalidated || hasInvalidatedNonRelativeUnresolvedImport && !isExternalModuleNameRelative(name) && shouldRetryResolution(resolution)) {
113763
+ if (!seenNamesInFile.has(name, mode) && unmatchedRedirects || !resolution || resolution.isInvalidated || // If the name is unresolved import that was invalidated, recalculate
113764
+ hasInvalidatedNonRelativeUnresolvedImport && !isExternalModuleNameRelative(name) && shouldRetryResolution(resolution)) {
113737
113765
  const existingResolution = resolution;
113738
113766
  resolution = loader.resolve(name, mode);
113739
113767
  if (resolutionHost.onDiscoveredSymlink && resolutionIsSymlink(resolution)) {