typescript 5.2.0-dev.20230803 → 5.2.0-dev.20230804

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.
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.2";
38
- version = `${versionMajorMinor}.0-dev.20230803`;
38
+ version = `${versionMajorMinor}.0-dev.20230804`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -46831,7 +46831,7 @@ ${lanes.join("\n")}
46831
46831
  return symbol;
46832
46832
  }
46833
46833
  if (symbol.flags & 2097152 /* Alias */) {
46834
- const targetFlags = getAllSymbolFlags(symbol);
46834
+ const targetFlags = getSymbolFlags(symbol);
46835
46835
  if (targetFlags & meaning) {
46836
46836
  return symbol;
46837
46837
  }
@@ -47591,7 +47591,7 @@ ${lanes.join("\n")}
47591
47591
  /*isUse*/
47592
47592
  false
47593
47593
  ));
47594
- const allFlags = symbol && getAllSymbolFlags(symbol);
47594
+ const allFlags = symbol && getSymbolFlags(symbol);
47595
47595
  if (symbol && allFlags !== void 0 && !(allFlags & 111551 /* Value */)) {
47596
47596
  const rawName = unescapeLeadingUnderscores(name);
47597
47597
  if (isES2015OrLaterConstructorName(name)) {
@@ -48327,11 +48327,23 @@ ${lanes.join("\n")}
48327
48327
  }
48328
48328
  return void 0;
48329
48329
  }
48330
- function getAllSymbolFlags(symbol) {
48331
- let flags = symbol.flags;
48330
+ function getSymbolFlags(symbol, excludeTypeOnlyMeanings, excludeLocalMeanings) {
48331
+ const typeOnlyDeclaration = excludeTypeOnlyMeanings && getTypeOnlyAliasDeclaration(symbol);
48332
+ const typeOnlyDeclarationIsExportStar = typeOnlyDeclaration && isExportDeclaration(typeOnlyDeclaration);
48333
+ const typeOnlyResolution = typeOnlyDeclaration && (typeOnlyDeclarationIsExportStar ? resolveExternalModuleName(
48334
+ typeOnlyDeclaration.moduleSpecifier,
48335
+ typeOnlyDeclaration.moduleSpecifier,
48336
+ /*ignoreErrors*/
48337
+ true
48338
+ ) : resolveAlias(typeOnlyDeclaration.symbol));
48339
+ const typeOnlyExportStarTargets = typeOnlyDeclarationIsExportStar && typeOnlyResolution ? getExportsOfModule(typeOnlyResolution) : void 0;
48340
+ let flags = excludeLocalMeanings ? 0 /* None */ : symbol.flags;
48332
48341
  let seenSymbols;
48333
48342
  while (symbol.flags & 2097152 /* Alias */) {
48334
- const target = resolveAlias(symbol);
48343
+ const target = getExportSymbolOfValueSymbolIfExported(resolveAlias(symbol));
48344
+ if (!typeOnlyDeclarationIsExportStar && target === typeOnlyResolution || (typeOnlyExportStarTargets == null ? void 0 : typeOnlyExportStarTargets.get(target.escapedName)) === target) {
48345
+ break;
48346
+ }
48335
48347
  if (target === unknownSymbol) {
48336
48348
  return 67108863 /* All */;
48337
48349
  }
@@ -48389,7 +48401,7 @@ ${lanes.join("\n")}
48389
48401
  }
48390
48402
  if (links.typeOnlyDeclaration) {
48391
48403
  const resolved = links.typeOnlyDeclaration.kind === 278 /* ExportDeclaration */ ? resolveSymbol(getExportsOfModule(links.typeOnlyDeclaration.symbol.parent).get(links.typeOnlyExportStarName || symbol.escapedName)) : resolveAlias(links.typeOnlyDeclaration.symbol);
48392
- return getAllSymbolFlags(resolved) & include ? links.typeOnlyDeclaration : void 0;
48404
+ return getSymbolFlags(resolved) & include ? links.typeOnlyDeclaration : void 0;
48393
48405
  }
48394
48406
  return void 0;
48395
48407
  }
@@ -48400,7 +48412,11 @@ ${lanes.join("\n")}
48400
48412
  const symbol = getSymbolOfDeclaration(node);
48401
48413
  const target = resolveAlias(symbol);
48402
48414
  if (target) {
48403
- const markAlias = target === unknownSymbol || getAllSymbolFlags(target) & 111551 /* Value */ && !isConstEnumOrConstEnumOnlyModule(target) && !getTypeOnlyAliasDeclaration(symbol, 111551 /* Value */);
48415
+ const markAlias = target === unknownSymbol || getSymbolFlags(
48416
+ symbol,
48417
+ /*excludeTypeOnlyMeanings*/
48418
+ true
48419
+ ) & 111551 /* Value */ && !isConstEnumOrConstEnumOnlyModule(target);
48404
48420
  if (markAlias) {
48405
48421
  markAliasSymbolAsReferenced(symbol);
48406
48422
  }
@@ -48415,7 +48431,7 @@ ${lanes.join("\n")}
48415
48431
  if (!node)
48416
48432
  return Debug.fail();
48417
48433
  if (isInternalModuleImportEqualsDeclaration(node)) {
48418
- if (getAllSymbolFlags(resolveSymbol(symbol)) & 111551 /* Value */) {
48434
+ if (getSymbolFlags(resolveSymbol(symbol)) & 111551 /* Value */) {
48419
48435
  checkExpressionCached(node.moduleReference);
48420
48436
  }
48421
48437
  }
@@ -49266,7 +49282,7 @@ ${lanes.join("\n")}
49266
49282
  return getMergedSymbol(symbol && (symbol.flags & 1048576 /* ExportValue */) !== 0 && symbol.exportSymbol || symbol);
49267
49283
  }
49268
49284
  function symbolIsValue(symbol, includeTypeOnlyMembers) {
49269
- return !!(symbol.flags & 111551 /* Value */ || symbol.flags & 2097152 /* Alias */ && getAllSymbolFlags(symbol) & 111551 /* Value */ && (includeTypeOnlyMembers || !getTypeOnlyAliasDeclaration(symbol)));
49285
+ return !!(symbol.flags & 111551 /* Value */ || symbol.flags & 2097152 /* Alias */ && getSymbolFlags(symbol, !includeTypeOnlyMembers) & 111551 /* Value */);
49270
49286
  }
49271
49287
  function findConstructorDeclaration(node) {
49272
49288
  const members = node.members;
@@ -49533,7 +49549,7 @@ ${lanes.join("\n")}
49533
49549
  }
49534
49550
  const shouldResolveAlias = symbolFromSymbolTable.flags & 2097152 /* Alias */ && !getDeclarationOfKind(symbolFromSymbolTable, 281 /* ExportSpecifier */);
49535
49551
  symbolFromSymbolTable = shouldResolveAlias ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable;
49536
- const flags = shouldResolveAlias ? getAllSymbolFlags(symbolFromSymbolTable) : symbolFromSymbolTable.flags;
49552
+ const flags = shouldResolveAlias ? getSymbolFlags(symbolFromSymbolTable) : symbolFromSymbolTable.flags;
49537
49553
  if (flags & meaning) {
49538
49554
  qualify = true;
49539
49555
  return true;
@@ -52395,7 +52411,7 @@ ${lanes.join("\n")}
52395
52411
  return !exports ? [] : filter(arrayFrom(exports.values()), (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */));
52396
52412
  }
52397
52413
  function isTypeOnlyNamespace(symbol) {
52398
- return every(getNamespaceMembersForSerialization(symbol), (m) => !(getAllSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
52414
+ return every(getNamespaceMembersForSerialization(symbol), (m) => !(getSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
52399
52415
  }
52400
52416
  function serializeModule(symbol, symbolName2, modifierFlags) {
52401
52417
  const members = getNamespaceMembersForSerialization(symbol);
@@ -54667,7 +54683,7 @@ ${lanes.join("\n")}
54667
54683
  true
54668
54684
  );
54669
54685
  const declaredType = firstDefined(exportSymbol == null ? void 0 : exportSymbol.declarations, (d) => isExportAssignment(d) ? tryGetTypeFromEffectiveTypeNode(d) : void 0);
54670
- links.type = (exportSymbol == null ? void 0 : exportSymbol.declarations) && isDuplicatedCommonJSExport(exportSymbol.declarations) && symbol.declarations.length ? getFlowTypeFromCommonJSExport(exportSymbol) : isDuplicatedCommonJSExport(symbol.declarations) ? autoType : declaredType ? declaredType : getAllSymbolFlags(targetSymbol) & 111551 /* Value */ ? getTypeOfSymbol(targetSymbol) : errorType;
54686
+ links.type = (exportSymbol == null ? void 0 : exportSymbol.declarations) && isDuplicatedCommonJSExport(exportSymbol.declarations) && symbol.declarations.length ? getFlowTypeFromCommonJSExport(exportSymbol) : isDuplicatedCommonJSExport(symbol.declarations) ? autoType : declaredType ? declaredType : getSymbolFlags(targetSymbol) & 111551 /* Value */ ? getTypeOfSymbol(targetSymbol) : errorType;
54671
54687
  }
54672
54688
  return links.type;
54673
54689
  }
@@ -62277,6 +62293,7 @@ ${lanes.join("\n")}
62277
62293
  let errorInfo;
62278
62294
  let relatedInfo;
62279
62295
  let maybeKeys;
62296
+ let maybeKeysSet;
62280
62297
  let sourceStack;
62281
62298
  let targetStack;
62282
62299
  let maybeCount = 0;
@@ -63146,9 +63163,13 @@ ${lanes.join("\n")}
63146
63163
  }
63147
63164
  if (!maybeKeys) {
63148
63165
  maybeKeys = [];
63166
+ maybeKeysSet = /* @__PURE__ */ new Set();
63149
63167
  sourceStack = [];
63150
63168
  targetStack = [];
63151
63169
  } else {
63170
+ if (maybeKeysSet.has(id)) {
63171
+ return 3 /* Maybe */;
63172
+ }
63152
63173
  const broadestEquivalentId = id.startsWith("*") ? getRelationKey(
63153
63174
  source2,
63154
63175
  target2,
@@ -63157,10 +63178,8 @@ ${lanes.join("\n")}
63157
63178
  /*ignoreConstraints*/
63158
63179
  true
63159
63180
  ) : void 0;
63160
- for (let i = 0; i < maybeCount; i++) {
63161
- if (id === maybeKeys[i] || broadestEquivalentId && broadestEquivalentId === maybeKeys[i]) {
63162
- return 3 /* Maybe */;
63163
- }
63181
+ if (broadestEquivalentId && maybeKeysSet.has(broadestEquivalentId)) {
63182
+ return 3 /* Maybe */;
63164
63183
  }
63165
63184
  if (sourceDepth === 100 || targetDepth === 100) {
63166
63185
  overflow = true;
@@ -63169,6 +63188,7 @@ ${lanes.join("\n")}
63169
63188
  }
63170
63189
  const maybeStart = maybeCount;
63171
63190
  maybeKeys[maybeCount] = id;
63191
+ maybeKeysSet.add(id);
63172
63192
  maybeCount++;
63173
63193
  const saveExpandingFlags = expandingFlags;
63174
63194
  if (recursionFlags & 1 /* Source */) {
@@ -63221,17 +63241,34 @@ ${lanes.join("\n")}
63221
63241
  if (result2) {
63222
63242
  if (result2 === -1 /* True */ || sourceDepth === 0 && targetDepth === 0) {
63223
63243
  if (result2 === -1 /* True */ || result2 === 3 /* Maybe */) {
63224
- for (let i = maybeStart; i < maybeCount; i++) {
63225
- relation.set(maybeKeys[i], 1 /* Succeeded */ | propagatingVarianceFlags);
63226
- }
63244
+ resetMaybeStack(
63245
+ /*markAllAsSucceeded*/
63246
+ true
63247
+ );
63248
+ } else {
63249
+ resetMaybeStack(
63250
+ /*markAllAsSucceeded*/
63251
+ false
63252
+ );
63227
63253
  }
63228
- maybeCount = maybeStart;
63229
63254
  }
63230
63255
  } else {
63231
63256
  relation.set(id, (reportErrors2 ? 4 /* Reported */ : 0) | 2 /* Failed */ | propagatingVarianceFlags);
63232
- maybeCount = maybeStart;
63257
+ resetMaybeStack(
63258
+ /*markAllAsSucceeded*/
63259
+ false
63260
+ );
63233
63261
  }
63234
63262
  return result2;
63263
+ function resetMaybeStack(markAllAsSucceeded) {
63264
+ for (let i = maybeStart; i < maybeCount; i++) {
63265
+ maybeKeysSet.delete(maybeKeys[i]);
63266
+ if (markAllAsSucceeded) {
63267
+ relation.set(maybeKeys[i], 1 /* Succeeded */ | propagatingVarianceFlags);
63268
+ }
63269
+ }
63270
+ maybeCount = maybeStart;
63271
+ }
63235
63272
  }
63236
63273
  function structuredTypeRelatedTo(source2, target2, reportErrors2, intersectionState) {
63237
63274
  const saveErrorInfo = captureErrorCalculationState();
@@ -68675,9 +68712,13 @@ ${lanes.join("\n")}
68675
68712
  symbol,
68676
68713
  /*excludes*/
68677
68714
  111551 /* Value */
68678
- ) && !isInTypeQuery(location) && !getTypeOnlyAliasDeclaration(symbol, 111551 /* Value */)) {
68715
+ ) && !isInTypeQuery(location)) {
68679
68716
  const target = resolveAlias(symbol);
68680
- if (getAllSymbolFlags(target) & (111551 /* Value */ | 1048576 /* ExportValue */)) {
68717
+ if (getSymbolFlags(
68718
+ symbol,
68719
+ /*excludeTypeOnlyMeanings*/
68720
+ true
68721
+ ) & (111551 /* Value */ | 1048576 /* ExportValue */)) {
68681
68722
  if (getIsolatedModules(compilerOptions) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(location) || !isConstEnumOrConstEnumOnlyModule(getExportSymbolOfValueSymbolIfExported(target))) {
68682
68723
  markAliasSymbolAsReferenced(symbol);
68683
68724
  } else {
@@ -79480,9 +79521,6 @@ ${lanes.join("\n")}
79480
79521
  if ((getCombinedNodeFlagsCached(node) & 7 /* BlockScoped */) !== 0 || isParameterDeclaration(node)) {
79481
79522
  return;
79482
79523
  }
79483
- if (node.kind === 260 /* VariableDeclaration */ && !node.initializer) {
79484
- return;
79485
- }
79486
79524
  const symbol = getSymbolOfDeclaration(node);
79487
79525
  if (symbol.flags & 1 /* FunctionScopedVariable */) {
79488
79526
  if (!isIdentifier(node.name))
@@ -82104,7 +82142,7 @@ ${lanes.join("\n")}
82104
82142
  }
82105
82143
  return;
82106
82144
  }
82107
- const targetFlags = getAllSymbolFlags(target);
82145
+ const targetFlags = getSymbolFlags(target);
82108
82146
  const excludedMeanings = (symbol.flags & (111551 /* Value */ | 1048576 /* ExportValue */) ? 111551 /* Value */ : 0) | (symbol.flags & 788968 /* Type */ ? 788968 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0);
82109
82147
  if (targetFlags & excludedMeanings) {
82110
82148
  const message = node.kind === 281 /* ExportSpecifier */ ? Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;
@@ -82262,7 +82300,7 @@ ${lanes.join("\n")}
82262
82300
  if (node.moduleReference.kind !== 283 /* ExternalModuleReference */) {
82263
82301
  const target = resolveAlias(getSymbolOfDeclaration(node));
82264
82302
  if (target !== unknownSymbol) {
82265
- const targetFlags = getAllSymbolFlags(target);
82303
+ const targetFlags = getSymbolFlags(target);
82266
82304
  if (targetFlags & 111551 /* Value */) {
82267
82305
  const moduleName = getFirstIdentifier(node.moduleReference);
82268
82306
  if (!(resolveEntityName(moduleName, 111551 /* Value */ | 1920 /* Namespace */).flags & 1920 /* Namespace */)) {
@@ -82402,7 +82440,7 @@ ${lanes.join("\n")}
82402
82440
  markExportAsReferenced(node);
82403
82441
  }
82404
82442
  const target = symbol && (symbol.flags & 2097152 /* Alias */ ? resolveAlias(symbol) : symbol);
82405
- if (!target || getAllSymbolFlags(target) & 111551 /* Value */) {
82443
+ if (!target || getSymbolFlags(target) & 111551 /* Value */) {
82406
82444
  checkExpressionCached(node.propertyName || node.name);
82407
82445
  }
82408
82446
  }
@@ -82447,7 +82485,7 @@ ${lanes.join("\n")}
82447
82485
  ));
82448
82486
  if (sym) {
82449
82487
  markAliasReferenced(sym, id);
82450
- if (getAllSymbolFlags(sym) & 111551 /* Value */) {
82488
+ if (getSymbolFlags(sym) & 111551 /* Value */) {
82451
82489
  checkExpressionCached(id);
82452
82490
  if (!isIllegalExportDefaultInCJS && !(node.flags & 33554432 /* Ambient */) && compilerOptions.verbatimModuleSyntax && getTypeOnlyAliasDeclaration(sym, 111551 /* Value */)) {
82453
82491
  error2(
@@ -83694,7 +83732,7 @@ ${lanes.join("\n")}
83694
83732
  return symbolLinks2.exportsSomeValue;
83695
83733
  function isValue(s) {
83696
83734
  s = resolveSymbol(s);
83697
- return s && !!(getAllSymbolFlags(s) & 111551 /* Value */);
83735
+ return s && !!(getSymbolFlags(s) & 111551 /* Value */);
83698
83736
  }
83699
83737
  }
83700
83738
  function isNameOfModuleOrEnumDeclaration(node) {
@@ -83824,7 +83862,11 @@ ${lanes.join("\n")}
83824
83862
  case 276 /* ImportSpecifier */:
83825
83863
  case 281 /* ExportSpecifier */:
83826
83864
  const symbol = getSymbolOfDeclaration(node);
83827
- return !!symbol && isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol, 111551 /* Value */);
83865
+ return !!symbol && isAliasResolvedToValue(
83866
+ symbol,
83867
+ /*excludeTypeOnlyValues*/
83868
+ true
83869
+ );
83828
83870
  case 278 /* ExportDeclaration */:
83829
83871
  const exportClause = node.exportClause;
83830
83872
  return !!exportClause && (isNamespaceExport(exportClause) || some(exportClause.elements, isValueAliasDeclaration));
@@ -83841,7 +83883,7 @@ ${lanes.join("\n")}
83841
83883
  const isValue = isAliasResolvedToValue(getSymbolOfDeclaration(node));
83842
83884
  return isValue && node.moduleReference && !nodeIsMissing(node.moduleReference);
83843
83885
  }
83844
- function isAliasResolvedToValue(symbol) {
83886
+ function isAliasResolvedToValue(symbol, excludeTypeOnlyValues) {
83845
83887
  if (!symbol) {
83846
83888
  return false;
83847
83889
  }
@@ -83849,7 +83891,12 @@ ${lanes.join("\n")}
83849
83891
  if (target === unknownSymbol) {
83850
83892
  return true;
83851
83893
  }
83852
- return !!((getAllSymbolFlags(target) ?? -1) & 111551 /* Value */) && (shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target));
83894
+ return !!(getSymbolFlags(
83895
+ symbol,
83896
+ excludeTypeOnlyValues,
83897
+ /*excludeLocalMeanings*/
83898
+ true
83899
+ ) & 111551 /* Value */) && (shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target));
83853
83900
  }
83854
83901
  function isConstEnumOrConstEnumOnlyModule(s) {
83855
83902
  return isConstEnumSymbol(s) || !!s.constEnumOnlyModule;
@@ -83863,7 +83910,7 @@ ${lanes.join("\n")}
83863
83910
  return true;
83864
83911
  }
83865
83912
  const target = getSymbolLinks(symbol).aliasTarget;
83866
- if (target && getEffectiveModifierFlags(node) & 1 /* Export */ && getAllSymbolFlags(target) & 111551 /* Value */ && (shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target))) {
83913
+ if (target && getEffectiveModifierFlags(node) & 1 /* Export */ && getSymbolFlags(target) & 111551 /* Value */ && (shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target))) {
83867
83914
  return true;
83868
83915
  }
83869
83916
  }
@@ -159650,6 +159697,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
159650
159697
  return cls;
159651
159698
  }
159652
159699
  break;
159700
+ case 81 /* PrivateIdentifier */:
159701
+ if (tryCast(location.parent, isPropertyDeclaration)) {
159702
+ return findAncestor(location, isClassLike);
159703
+ }
159704
+ break;
159653
159705
  case 80 /* Identifier */: {
159654
159706
  const originalKeywordKind = identifierToKeywordKind(location);
159655
159707
  if (originalKeywordKind) {
@@ -1774,9 +1774,11 @@ declare namespace ts {
1774
1774
  };
1775
1775
  }) | ExportDeclaration & {
1776
1776
  readonly isTypeOnly: true;
1777
+ readonly moduleSpecifier: Expression;
1777
1778
  } | NamespaceExport & {
1778
1779
  readonly parent: ExportDeclaration & {
1779
1780
  readonly isTypeOnly: true;
1781
+ readonly moduleSpecifier: Expression;
1780
1782
  };
1781
1783
  };
1782
1784
  type TypeOnlyAliasDeclaration = TypeOnlyImportDeclaration | TypeOnlyExportDeclaration;
package/lib/typescript.js CHANGED
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.2";
38
- version = `${versionMajorMinor}.0-dev.20230803`;
38
+ version = `${versionMajorMinor}.0-dev.20230804`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -46831,7 +46831,7 @@ ${lanes.join("\n")}
46831
46831
  return symbol;
46832
46832
  }
46833
46833
  if (symbol.flags & 2097152 /* Alias */) {
46834
- const targetFlags = getAllSymbolFlags(symbol);
46834
+ const targetFlags = getSymbolFlags(symbol);
46835
46835
  if (targetFlags & meaning) {
46836
46836
  return symbol;
46837
46837
  }
@@ -47591,7 +47591,7 @@ ${lanes.join("\n")}
47591
47591
  /*isUse*/
47592
47592
  false
47593
47593
  ));
47594
- const allFlags = symbol && getAllSymbolFlags(symbol);
47594
+ const allFlags = symbol && getSymbolFlags(symbol);
47595
47595
  if (symbol && allFlags !== void 0 && !(allFlags & 111551 /* Value */)) {
47596
47596
  const rawName = unescapeLeadingUnderscores(name);
47597
47597
  if (isES2015OrLaterConstructorName(name)) {
@@ -48327,11 +48327,23 @@ ${lanes.join("\n")}
48327
48327
  }
48328
48328
  return void 0;
48329
48329
  }
48330
- function getAllSymbolFlags(symbol) {
48331
- let flags = symbol.flags;
48330
+ function getSymbolFlags(symbol, excludeTypeOnlyMeanings, excludeLocalMeanings) {
48331
+ const typeOnlyDeclaration = excludeTypeOnlyMeanings && getTypeOnlyAliasDeclaration(symbol);
48332
+ const typeOnlyDeclarationIsExportStar = typeOnlyDeclaration && isExportDeclaration(typeOnlyDeclaration);
48333
+ const typeOnlyResolution = typeOnlyDeclaration && (typeOnlyDeclarationIsExportStar ? resolveExternalModuleName(
48334
+ typeOnlyDeclaration.moduleSpecifier,
48335
+ typeOnlyDeclaration.moduleSpecifier,
48336
+ /*ignoreErrors*/
48337
+ true
48338
+ ) : resolveAlias(typeOnlyDeclaration.symbol));
48339
+ const typeOnlyExportStarTargets = typeOnlyDeclarationIsExportStar && typeOnlyResolution ? getExportsOfModule(typeOnlyResolution) : void 0;
48340
+ let flags = excludeLocalMeanings ? 0 /* None */ : symbol.flags;
48332
48341
  let seenSymbols;
48333
48342
  while (symbol.flags & 2097152 /* Alias */) {
48334
- const target = resolveAlias(symbol);
48343
+ const target = getExportSymbolOfValueSymbolIfExported(resolveAlias(symbol));
48344
+ if (!typeOnlyDeclarationIsExportStar && target === typeOnlyResolution || (typeOnlyExportStarTargets == null ? void 0 : typeOnlyExportStarTargets.get(target.escapedName)) === target) {
48345
+ break;
48346
+ }
48335
48347
  if (target === unknownSymbol) {
48336
48348
  return 67108863 /* All */;
48337
48349
  }
@@ -48389,7 +48401,7 @@ ${lanes.join("\n")}
48389
48401
  }
48390
48402
  if (links.typeOnlyDeclaration) {
48391
48403
  const resolved = links.typeOnlyDeclaration.kind === 278 /* ExportDeclaration */ ? resolveSymbol(getExportsOfModule(links.typeOnlyDeclaration.symbol.parent).get(links.typeOnlyExportStarName || symbol.escapedName)) : resolveAlias(links.typeOnlyDeclaration.symbol);
48392
- return getAllSymbolFlags(resolved) & include ? links.typeOnlyDeclaration : void 0;
48404
+ return getSymbolFlags(resolved) & include ? links.typeOnlyDeclaration : void 0;
48393
48405
  }
48394
48406
  return void 0;
48395
48407
  }
@@ -48400,7 +48412,11 @@ ${lanes.join("\n")}
48400
48412
  const symbol = getSymbolOfDeclaration(node);
48401
48413
  const target = resolveAlias(symbol);
48402
48414
  if (target) {
48403
- const markAlias = target === unknownSymbol || getAllSymbolFlags(target) & 111551 /* Value */ && !isConstEnumOrConstEnumOnlyModule(target) && !getTypeOnlyAliasDeclaration(symbol, 111551 /* Value */);
48415
+ const markAlias = target === unknownSymbol || getSymbolFlags(
48416
+ symbol,
48417
+ /*excludeTypeOnlyMeanings*/
48418
+ true
48419
+ ) & 111551 /* Value */ && !isConstEnumOrConstEnumOnlyModule(target);
48404
48420
  if (markAlias) {
48405
48421
  markAliasSymbolAsReferenced(symbol);
48406
48422
  }
@@ -48415,7 +48431,7 @@ ${lanes.join("\n")}
48415
48431
  if (!node)
48416
48432
  return Debug.fail();
48417
48433
  if (isInternalModuleImportEqualsDeclaration(node)) {
48418
- if (getAllSymbolFlags(resolveSymbol(symbol)) & 111551 /* Value */) {
48434
+ if (getSymbolFlags(resolveSymbol(symbol)) & 111551 /* Value */) {
48419
48435
  checkExpressionCached(node.moduleReference);
48420
48436
  }
48421
48437
  }
@@ -49266,7 +49282,7 @@ ${lanes.join("\n")}
49266
49282
  return getMergedSymbol(symbol && (symbol.flags & 1048576 /* ExportValue */) !== 0 && symbol.exportSymbol || symbol);
49267
49283
  }
49268
49284
  function symbolIsValue(symbol, includeTypeOnlyMembers) {
49269
- return !!(symbol.flags & 111551 /* Value */ || symbol.flags & 2097152 /* Alias */ && getAllSymbolFlags(symbol) & 111551 /* Value */ && (includeTypeOnlyMembers || !getTypeOnlyAliasDeclaration(symbol)));
49285
+ return !!(symbol.flags & 111551 /* Value */ || symbol.flags & 2097152 /* Alias */ && getSymbolFlags(symbol, !includeTypeOnlyMembers) & 111551 /* Value */);
49270
49286
  }
49271
49287
  function findConstructorDeclaration(node) {
49272
49288
  const members = node.members;
@@ -49533,7 +49549,7 @@ ${lanes.join("\n")}
49533
49549
  }
49534
49550
  const shouldResolveAlias = symbolFromSymbolTable.flags & 2097152 /* Alias */ && !getDeclarationOfKind(symbolFromSymbolTable, 281 /* ExportSpecifier */);
49535
49551
  symbolFromSymbolTable = shouldResolveAlias ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable;
49536
- const flags = shouldResolveAlias ? getAllSymbolFlags(symbolFromSymbolTable) : symbolFromSymbolTable.flags;
49552
+ const flags = shouldResolveAlias ? getSymbolFlags(symbolFromSymbolTable) : symbolFromSymbolTable.flags;
49537
49553
  if (flags & meaning) {
49538
49554
  qualify = true;
49539
49555
  return true;
@@ -52395,7 +52411,7 @@ ${lanes.join("\n")}
52395
52411
  return !exports ? [] : filter(arrayFrom(exports.values()), (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */));
52396
52412
  }
52397
52413
  function isTypeOnlyNamespace(symbol) {
52398
- return every(getNamespaceMembersForSerialization(symbol), (m) => !(getAllSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
52414
+ return every(getNamespaceMembersForSerialization(symbol), (m) => !(getSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
52399
52415
  }
52400
52416
  function serializeModule(symbol, symbolName2, modifierFlags) {
52401
52417
  const members = getNamespaceMembersForSerialization(symbol);
@@ -54667,7 +54683,7 @@ ${lanes.join("\n")}
54667
54683
  true
54668
54684
  );
54669
54685
  const declaredType = firstDefined(exportSymbol == null ? void 0 : exportSymbol.declarations, (d) => isExportAssignment(d) ? tryGetTypeFromEffectiveTypeNode(d) : void 0);
54670
- links.type = (exportSymbol == null ? void 0 : exportSymbol.declarations) && isDuplicatedCommonJSExport(exportSymbol.declarations) && symbol.declarations.length ? getFlowTypeFromCommonJSExport(exportSymbol) : isDuplicatedCommonJSExport(symbol.declarations) ? autoType : declaredType ? declaredType : getAllSymbolFlags(targetSymbol) & 111551 /* Value */ ? getTypeOfSymbol(targetSymbol) : errorType;
54686
+ links.type = (exportSymbol == null ? void 0 : exportSymbol.declarations) && isDuplicatedCommonJSExport(exportSymbol.declarations) && symbol.declarations.length ? getFlowTypeFromCommonJSExport(exportSymbol) : isDuplicatedCommonJSExport(symbol.declarations) ? autoType : declaredType ? declaredType : getSymbolFlags(targetSymbol) & 111551 /* Value */ ? getTypeOfSymbol(targetSymbol) : errorType;
54671
54687
  }
54672
54688
  return links.type;
54673
54689
  }
@@ -62277,6 +62293,7 @@ ${lanes.join("\n")}
62277
62293
  let errorInfo;
62278
62294
  let relatedInfo;
62279
62295
  let maybeKeys;
62296
+ let maybeKeysSet;
62280
62297
  let sourceStack;
62281
62298
  let targetStack;
62282
62299
  let maybeCount = 0;
@@ -63146,9 +63163,13 @@ ${lanes.join("\n")}
63146
63163
  }
63147
63164
  if (!maybeKeys) {
63148
63165
  maybeKeys = [];
63166
+ maybeKeysSet = /* @__PURE__ */ new Set();
63149
63167
  sourceStack = [];
63150
63168
  targetStack = [];
63151
63169
  } else {
63170
+ if (maybeKeysSet.has(id)) {
63171
+ return 3 /* Maybe */;
63172
+ }
63152
63173
  const broadestEquivalentId = id.startsWith("*") ? getRelationKey(
63153
63174
  source2,
63154
63175
  target2,
@@ -63157,10 +63178,8 @@ ${lanes.join("\n")}
63157
63178
  /*ignoreConstraints*/
63158
63179
  true
63159
63180
  ) : void 0;
63160
- for (let i = 0; i < maybeCount; i++) {
63161
- if (id === maybeKeys[i] || broadestEquivalentId && broadestEquivalentId === maybeKeys[i]) {
63162
- return 3 /* Maybe */;
63163
- }
63181
+ if (broadestEquivalentId && maybeKeysSet.has(broadestEquivalentId)) {
63182
+ return 3 /* Maybe */;
63164
63183
  }
63165
63184
  if (sourceDepth === 100 || targetDepth === 100) {
63166
63185
  overflow = true;
@@ -63169,6 +63188,7 @@ ${lanes.join("\n")}
63169
63188
  }
63170
63189
  const maybeStart = maybeCount;
63171
63190
  maybeKeys[maybeCount] = id;
63191
+ maybeKeysSet.add(id);
63172
63192
  maybeCount++;
63173
63193
  const saveExpandingFlags = expandingFlags;
63174
63194
  if (recursionFlags & 1 /* Source */) {
@@ -63221,17 +63241,34 @@ ${lanes.join("\n")}
63221
63241
  if (result2) {
63222
63242
  if (result2 === -1 /* True */ || sourceDepth === 0 && targetDepth === 0) {
63223
63243
  if (result2 === -1 /* True */ || result2 === 3 /* Maybe */) {
63224
- for (let i = maybeStart; i < maybeCount; i++) {
63225
- relation.set(maybeKeys[i], 1 /* Succeeded */ | propagatingVarianceFlags);
63226
- }
63244
+ resetMaybeStack(
63245
+ /*markAllAsSucceeded*/
63246
+ true
63247
+ );
63248
+ } else {
63249
+ resetMaybeStack(
63250
+ /*markAllAsSucceeded*/
63251
+ false
63252
+ );
63227
63253
  }
63228
- maybeCount = maybeStart;
63229
63254
  }
63230
63255
  } else {
63231
63256
  relation.set(id, (reportErrors2 ? 4 /* Reported */ : 0) | 2 /* Failed */ | propagatingVarianceFlags);
63232
- maybeCount = maybeStart;
63257
+ resetMaybeStack(
63258
+ /*markAllAsSucceeded*/
63259
+ false
63260
+ );
63233
63261
  }
63234
63262
  return result2;
63263
+ function resetMaybeStack(markAllAsSucceeded) {
63264
+ for (let i = maybeStart; i < maybeCount; i++) {
63265
+ maybeKeysSet.delete(maybeKeys[i]);
63266
+ if (markAllAsSucceeded) {
63267
+ relation.set(maybeKeys[i], 1 /* Succeeded */ | propagatingVarianceFlags);
63268
+ }
63269
+ }
63270
+ maybeCount = maybeStart;
63271
+ }
63235
63272
  }
63236
63273
  function structuredTypeRelatedTo(source2, target2, reportErrors2, intersectionState) {
63237
63274
  const saveErrorInfo = captureErrorCalculationState();
@@ -68675,9 +68712,13 @@ ${lanes.join("\n")}
68675
68712
  symbol,
68676
68713
  /*excludes*/
68677
68714
  111551 /* Value */
68678
- ) && !isInTypeQuery(location) && !getTypeOnlyAliasDeclaration(symbol, 111551 /* Value */)) {
68715
+ ) && !isInTypeQuery(location)) {
68679
68716
  const target = resolveAlias(symbol);
68680
- if (getAllSymbolFlags(target) & (111551 /* Value */ | 1048576 /* ExportValue */)) {
68717
+ if (getSymbolFlags(
68718
+ symbol,
68719
+ /*excludeTypeOnlyMeanings*/
68720
+ true
68721
+ ) & (111551 /* Value */ | 1048576 /* ExportValue */)) {
68681
68722
  if (getIsolatedModules(compilerOptions) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(location) || !isConstEnumOrConstEnumOnlyModule(getExportSymbolOfValueSymbolIfExported(target))) {
68682
68723
  markAliasSymbolAsReferenced(symbol);
68683
68724
  } else {
@@ -79480,9 +79521,6 @@ ${lanes.join("\n")}
79480
79521
  if ((getCombinedNodeFlagsCached(node) & 7 /* BlockScoped */) !== 0 || isParameterDeclaration(node)) {
79481
79522
  return;
79482
79523
  }
79483
- if (node.kind === 260 /* VariableDeclaration */ && !node.initializer) {
79484
- return;
79485
- }
79486
79524
  const symbol = getSymbolOfDeclaration(node);
79487
79525
  if (symbol.flags & 1 /* FunctionScopedVariable */) {
79488
79526
  if (!isIdentifier(node.name))
@@ -82104,7 +82142,7 @@ ${lanes.join("\n")}
82104
82142
  }
82105
82143
  return;
82106
82144
  }
82107
- const targetFlags = getAllSymbolFlags(target);
82145
+ const targetFlags = getSymbolFlags(target);
82108
82146
  const excludedMeanings = (symbol.flags & (111551 /* Value */ | 1048576 /* ExportValue */) ? 111551 /* Value */ : 0) | (symbol.flags & 788968 /* Type */ ? 788968 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0);
82109
82147
  if (targetFlags & excludedMeanings) {
82110
82148
  const message = node.kind === 281 /* ExportSpecifier */ ? Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;
@@ -82262,7 +82300,7 @@ ${lanes.join("\n")}
82262
82300
  if (node.moduleReference.kind !== 283 /* ExternalModuleReference */) {
82263
82301
  const target = resolveAlias(getSymbolOfDeclaration(node));
82264
82302
  if (target !== unknownSymbol) {
82265
- const targetFlags = getAllSymbolFlags(target);
82303
+ const targetFlags = getSymbolFlags(target);
82266
82304
  if (targetFlags & 111551 /* Value */) {
82267
82305
  const moduleName = getFirstIdentifier(node.moduleReference);
82268
82306
  if (!(resolveEntityName(moduleName, 111551 /* Value */ | 1920 /* Namespace */).flags & 1920 /* Namespace */)) {
@@ -82402,7 +82440,7 @@ ${lanes.join("\n")}
82402
82440
  markExportAsReferenced(node);
82403
82441
  }
82404
82442
  const target = symbol && (symbol.flags & 2097152 /* Alias */ ? resolveAlias(symbol) : symbol);
82405
- if (!target || getAllSymbolFlags(target) & 111551 /* Value */) {
82443
+ if (!target || getSymbolFlags(target) & 111551 /* Value */) {
82406
82444
  checkExpressionCached(node.propertyName || node.name);
82407
82445
  }
82408
82446
  }
@@ -82447,7 +82485,7 @@ ${lanes.join("\n")}
82447
82485
  ));
82448
82486
  if (sym) {
82449
82487
  markAliasReferenced(sym, id);
82450
- if (getAllSymbolFlags(sym) & 111551 /* Value */) {
82488
+ if (getSymbolFlags(sym) & 111551 /* Value */) {
82451
82489
  checkExpressionCached(id);
82452
82490
  if (!isIllegalExportDefaultInCJS && !(node.flags & 33554432 /* Ambient */) && compilerOptions.verbatimModuleSyntax && getTypeOnlyAliasDeclaration(sym, 111551 /* Value */)) {
82453
82491
  error2(
@@ -83694,7 +83732,7 @@ ${lanes.join("\n")}
83694
83732
  return symbolLinks2.exportsSomeValue;
83695
83733
  function isValue(s) {
83696
83734
  s = resolveSymbol(s);
83697
- return s && !!(getAllSymbolFlags(s) & 111551 /* Value */);
83735
+ return s && !!(getSymbolFlags(s) & 111551 /* Value */);
83698
83736
  }
83699
83737
  }
83700
83738
  function isNameOfModuleOrEnumDeclaration(node) {
@@ -83824,7 +83862,11 @@ ${lanes.join("\n")}
83824
83862
  case 276 /* ImportSpecifier */:
83825
83863
  case 281 /* ExportSpecifier */:
83826
83864
  const symbol = getSymbolOfDeclaration(node);
83827
- return !!symbol && isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol, 111551 /* Value */);
83865
+ return !!symbol && isAliasResolvedToValue(
83866
+ symbol,
83867
+ /*excludeTypeOnlyValues*/
83868
+ true
83869
+ );
83828
83870
  case 278 /* ExportDeclaration */:
83829
83871
  const exportClause = node.exportClause;
83830
83872
  return !!exportClause && (isNamespaceExport(exportClause) || some(exportClause.elements, isValueAliasDeclaration));
@@ -83841,7 +83883,7 @@ ${lanes.join("\n")}
83841
83883
  const isValue = isAliasResolvedToValue(getSymbolOfDeclaration(node));
83842
83884
  return isValue && node.moduleReference && !nodeIsMissing(node.moduleReference);
83843
83885
  }
83844
- function isAliasResolvedToValue(symbol) {
83886
+ function isAliasResolvedToValue(symbol, excludeTypeOnlyValues) {
83845
83887
  if (!symbol) {
83846
83888
  return false;
83847
83889
  }
@@ -83849,7 +83891,12 @@ ${lanes.join("\n")}
83849
83891
  if (target === unknownSymbol) {
83850
83892
  return true;
83851
83893
  }
83852
- return !!((getAllSymbolFlags(target) ?? -1) & 111551 /* Value */) && (shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target));
83894
+ return !!(getSymbolFlags(
83895
+ symbol,
83896
+ excludeTypeOnlyValues,
83897
+ /*excludeLocalMeanings*/
83898
+ true
83899
+ ) & 111551 /* Value */) && (shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target));
83853
83900
  }
83854
83901
  function isConstEnumOrConstEnumOnlyModule(s) {
83855
83902
  return isConstEnumSymbol(s) || !!s.constEnumOnlyModule;
@@ -83863,7 +83910,7 @@ ${lanes.join("\n")}
83863
83910
  return true;
83864
83911
  }
83865
83912
  const target = getSymbolLinks(symbol).aliasTarget;
83866
- if (target && getEffectiveModifierFlags(node) & 1 /* Export */ && getAllSymbolFlags(target) & 111551 /* Value */ && (shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target))) {
83913
+ if (target && getEffectiveModifierFlags(node) & 1 /* Export */ && getSymbolFlags(target) & 111551 /* Value */ && (shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target))) {
83867
83914
  return true;
83868
83915
  }
83869
83916
  }
@@ -159665,6 +159712,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
159665
159712
  return cls;
159666
159713
  }
159667
159714
  break;
159715
+ case 81 /* PrivateIdentifier */:
159716
+ if (tryCast(location.parent, isPropertyDeclaration)) {
159717
+ return findAncestor(location, isClassLike);
159718
+ }
159719
+ break;
159668
159720
  case 80 /* Identifier */: {
159669
159721
  const originalKeywordKind = identifierToKeywordKind(location);
159670
159722
  if (originalKeywordKind) {