typescript 5.3.0-dev.20230913 → 5.3.0-dev.20230915

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tsc.js CHANGED
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.3";
21
- var version = `${versionMajorMinor}.0-dev.20230913`;
21
+ var version = `${versionMajorMinor}.0-dev.20230915`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -1763,7 +1763,7 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
1763
1763
  // for use with vscode-js-debug's new customDescriptionGenerator in launch.json
1764
1764
  __tsDebuggerDisplay: {
1765
1765
  value() {
1766
- const typeHeader = this.flags & 98304 /* Nullable */ ? "NullableType" : this.flags & 384 /* StringOrNumberLiteral */ ? `LiteralType ${JSON.stringify(this.value)}` : this.flags & 2048 /* BigIntLiteral */ ? `LiteralType ${this.value.negative ? "-" : ""}${this.value.base10Value}n` : this.flags & 8192 /* UniqueESSymbol */ ? "UniqueESSymbolType" : this.flags & 32 /* Enum */ ? "EnumType" : this.flags & 67359327 /* Intrinsic */ ? `IntrinsicType ${this.intrinsicName}` : this.flags & 1048576 /* Union */ ? "UnionType" : this.flags & 2097152 /* Intersection */ ? "IntersectionType" : this.flags & 4194304 /* Index */ ? "IndexType" : this.flags & 8388608 /* IndexedAccess */ ? "IndexedAccessType" : this.flags & 16777216 /* Conditional */ ? "ConditionalType" : this.flags & 33554432 /* Substitution */ ? "SubstitutionType" : this.flags & 262144 /* TypeParameter */ ? "TypeParameter" : this.flags & 524288 /* Object */ ? this.objectFlags & 3 /* ClassOrInterface */ ? "InterfaceType" : this.objectFlags & 4 /* Reference */ ? "TypeReference" : this.objectFlags & 8 /* Tuple */ ? "TupleType" : this.objectFlags & 16 /* Anonymous */ ? "AnonymousType" : this.objectFlags & 32 /* Mapped */ ? "MappedType" : this.objectFlags & 1024 /* ReverseMapped */ ? "ReverseMappedType" : this.objectFlags & 256 /* EvolvingArray */ ? "EvolvingArrayType" : "ObjectType" : "Type";
1766
+ const typeHeader = this.flags & 67359327 /* Intrinsic */ ? `IntrinsicType ${this.intrinsicName}${this.debugIntrinsicName ? ` (${this.debugIntrinsicName})` : ""}` : this.flags & 98304 /* Nullable */ ? "NullableType" : this.flags & 384 /* StringOrNumberLiteral */ ? `LiteralType ${JSON.stringify(this.value)}` : this.flags & 2048 /* BigIntLiteral */ ? `LiteralType ${this.value.negative ? "-" : ""}${this.value.base10Value}n` : this.flags & 8192 /* UniqueESSymbol */ ? "UniqueESSymbolType" : this.flags & 32 /* Enum */ ? "EnumType" : this.flags & 1048576 /* Union */ ? "UnionType" : this.flags & 2097152 /* Intersection */ ? "IntersectionType" : this.flags & 4194304 /* Index */ ? "IndexType" : this.flags & 8388608 /* IndexedAccess */ ? "IndexedAccessType" : this.flags & 16777216 /* Conditional */ ? "ConditionalType" : this.flags & 33554432 /* Substitution */ ? "SubstitutionType" : this.flags & 262144 /* TypeParameter */ ? "TypeParameter" : this.flags & 524288 /* Object */ ? this.objectFlags & 3 /* ClassOrInterface */ ? "InterfaceType" : this.objectFlags & 4 /* Reference */ ? "TypeReference" : this.objectFlags & 8 /* Tuple */ ? "TupleType" : this.objectFlags & 16 /* Anonymous */ ? "AnonymousType" : this.objectFlags & 32 /* Mapped */ ? "MappedType" : this.objectFlags & 1024 /* ReverseMapped */ ? "ReverseMappedType" : this.objectFlags & 256 /* EvolvingArray */ ? "EvolvingArrayType" : "ObjectType" : "Type";
1767
1767
  const remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~1343 /* ObjectTypeKindMask */ : 0;
1768
1768
  return `${typeHeader}${this.symbol ? ` '${symbolName(this.symbol)}'` : ""}${remainingObjectFlags ? ` (${formatObjectFlags(remainingObjectFlags)})` : ""}`;
1769
1769
  }
@@ -7933,6 +7933,7 @@ var unicodeESNextIdentifierStart = [65, 90, 97, 122, 170, 170, 181, 181, 186, 18
7933
7933
  var unicodeESNextIdentifierPart = [48, 57, 65, 90, 95, 95, 97, 122, 170, 170, 181, 181, 183, 183, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 895, 895, 902, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1519, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2045, 2045, 2048, 2093, 2112, 2139, 2144, 2154, 2208, 2228, 2230, 2237, 2259, 2273, 2275, 2403, 2406, 2415, 2417, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2556, 2556, 2558, 2558, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2809, 2815, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3072, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3162, 3168, 3171, 3174, 3183, 3200, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3328, 3331, 3333, 3340, 3342, 3344, 3346, 3396, 3398, 3400, 3402, 3406, 3412, 3415, 3423, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3558, 3567, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4969, 4977, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6e3, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6264, 6272, 6314, 6320, 6389, 6400, 6430, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6618, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6832, 6845, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7376, 7378, 7380, 7418, 7424, 7673, 7675, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42737, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43047, 43072, 43123, 43136, 43205, 43216, 43225, 43232, 43255, 43259, 43259, 43261, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43488, 43518, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43879, 43888, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65071, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66045, 66045, 66176, 66204, 66208, 66256, 66272, 66272, 66304, 66335, 66349, 66378, 66384, 66426, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66720, 66729, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68099, 68101, 68102, 68108, 68115, 68117, 68119, 68121, 68149, 68152, 68154, 68159, 68159, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68326, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68903, 68912, 68921, 69376, 69404, 69415, 69415, 69424, 69456, 69600, 69622, 69632, 69702, 69734, 69743, 69759, 69818, 69840, 69864, 69872, 69881, 69888, 69940, 69942, 69951, 69956, 69958, 69968, 70003, 70006, 70006, 70016, 70084, 70089, 70092, 70096, 70106, 70108, 70108, 70144, 70161, 70163, 70199, 70206, 70206, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70378, 70384, 70393, 70400, 70403, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70459, 70468, 70471, 70472, 70475, 70477, 70480, 70480, 70487, 70487, 70493, 70499, 70502, 70508, 70512, 70516, 70656, 70730, 70736, 70745, 70750, 70751, 70784, 70853, 70855, 70855, 70864, 70873, 71040, 71093, 71096, 71104, 71128, 71133, 71168, 71232, 71236, 71236, 71248, 71257, 71296, 71352, 71360, 71369, 71424, 71450, 71453, 71467, 71472, 71481, 71680, 71738, 71840, 71913, 71935, 71935, 72096, 72103, 72106, 72151, 72154, 72161, 72163, 72164, 72192, 72254, 72263, 72263, 72272, 72345, 72349, 72349, 72384, 72440, 72704, 72712, 72714, 72758, 72760, 72768, 72784, 72793, 72818, 72847, 72850, 72871, 72873, 72886, 72960, 72966, 72968, 72969, 72971, 73014, 73018, 73018, 73020, 73021, 73023, 73031, 73040, 73049, 73056, 73061, 73063, 73064, 73066, 73102, 73104, 73105, 73107, 73112, 73120, 73129, 73440, 73462, 73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 92768, 92777, 92880, 92909, 92912, 92916, 92928, 92982, 92992, 92995, 93008, 93017, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94031, 94087, 94095, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 113821, 113822, 119141, 119145, 119149, 119154, 119163, 119170, 119173, 119179, 119210, 119213, 119362, 119364, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 120782, 120831, 121344, 121398, 121403, 121452, 121461, 121461, 121476, 121476, 121499, 121503, 121505, 121519, 122880, 122886, 122888, 122904, 122907, 122913, 122915, 122916, 122918, 122922, 123136, 123180, 123184, 123197, 123200, 123209, 123214, 123214, 123584, 123641, 124928, 125124, 125136, 125142, 125184, 125259, 125264, 125273, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101, 917760, 917999];
7934
7934
  var commentDirectiveRegExSingleLine = /^\/\/\/?\s*@(ts-expect-error|ts-ignore)/;
7935
7935
  var commentDirectiveRegExMultiLine = /^(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/;
7936
+ var semanticJSDocTagRegEx = /@(?:see|link)/i;
7936
7937
  function lookupInUnicodeMap(code, map2) {
7937
7938
  if (code < map2[0]) {
7938
7939
  return false;
@@ -8418,6 +8419,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
8418
8419
  var tokenFlags;
8419
8420
  var commentDirectives;
8420
8421
  var inJSDocType = 0;
8422
+ var skipNonSemanticJSDoc = false;
8421
8423
  setText(text, start, length2);
8422
8424
  var scanner = {
8423
8425
  getTokenFullStart: () => fullStartPos,
@@ -8467,7 +8469,8 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
8467
8469
  setInJSDocType,
8468
8470
  tryScan,
8469
8471
  lookAhead,
8470
- scanRange
8472
+ scanRange,
8473
+ setSkipNonSemanticJSDoc
8471
8474
  };
8472
8475
  if (Debug.isDebugging) {
8473
8476
  Object.defineProperty(scanner, "__debugShowCurrentPositionInText", {
@@ -8714,7 +8717,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
8714
8717
  start2 = pos;
8715
8718
  continue;
8716
8719
  }
8717
- if (isLineBreak(ch) && !jsxAttributeString) {
8720
+ if ((ch === 10 /* lineFeed */ || ch === 13 /* carriageReturn */) && !jsxAttributeString) {
8718
8721
  result += text.substring(start2, pos);
8719
8722
  tokenFlags |= 4 /* Unterminated */;
8720
8723
  error(Diagnostics.Unterminated_string_literal);
@@ -9239,9 +9242,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
9239
9242
  }
9240
9243
  if (text.charCodeAt(pos + 1) === 42 /* asterisk */) {
9241
9244
  pos += 2;
9242
- if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) !== 47 /* slash */) {
9243
- tokenFlags |= 2 /* PrecedingJSDocComment */;
9244
- }
9245
+ const isJSDoc2 = text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) !== 47 /* slash */;
9245
9246
  let commentClosed = false;
9246
9247
  let lastLineStart = tokenStart;
9247
9248
  while (pos < end) {
@@ -9257,6 +9258,9 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
9257
9258
  tokenFlags |= 1 /* PrecedingLineBreak */;
9258
9259
  }
9259
9260
  }
9261
+ if (isJSDoc2 && (!skipNonSemanticJSDoc || semanticJSDocTagRegEx.test(text.slice(fullStartPos, pos)))) {
9262
+ tokenFlags |= 2 /* PrecedingJSDocComment */;
9263
+ }
9260
9264
  commentDirectives = appendIfCommentDirective(commentDirectives, text.slice(lastLineStart, pos), commentDirectiveRegExMultiLine, lastLineStart);
9261
9265
  if (!commentClosed) {
9262
9266
  error(Diagnostics.Asterisk_Slash_expected);
@@ -9927,6 +9931,9 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
9927
9931
  function setLanguageVariant(variant) {
9928
9932
  languageVariant = variant;
9929
9933
  }
9934
+ function setSkipNonSemanticJSDoc(skip) {
9935
+ skipNonSemanticJSDoc = skip;
9936
+ }
9930
9937
  function resetTokenState(position) {
9931
9938
  Debug.assert(position >= 0);
9932
9939
  pos = position;
@@ -15554,6 +15561,9 @@ function isPrototypeAccess(node) {
15554
15561
  function isRightSideOfQualifiedNameOrPropertyAccess(node) {
15555
15562
  return node.parent.kind === 166 /* QualifiedName */ && node.parent.right === node || node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.name === node || node.parent.kind === 236 /* MetaProperty */ && node.parent.name === node;
15556
15563
  }
15564
+ function isRightSideOfAccessExpression(node) {
15565
+ return !!node.parent && (isPropertyAccessExpression(node.parent) && node.parent.name === node || isElementAccessExpression(node.parent) && node.parent.argumentExpression === node);
15566
+ }
15557
15567
  function isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(node) {
15558
15568
  return isQualifiedName(node.parent) && node.parent.right === node || isPropertyAccessExpression(node.parent) && node.parent.name === node || isJSDocMemberName(node.parent) && node.parent.right === node;
15559
15569
  }
@@ -17439,6 +17449,9 @@ function getPropertyNameFromType(type) {
17439
17449
  }
17440
17450
  return Debug.fail();
17441
17451
  }
17452
+ function isExpandoPropertyDeclaration(declaration) {
17453
+ return !!declaration && (isPropertyAccessExpression(declaration) || isElementAccessExpression(declaration) || isBinaryExpression(declaration));
17454
+ }
17442
17455
 
17443
17456
  // src/compiler/factory/baseNodeFactory.ts
17444
17457
  function createBaseNodeFactory() {
@@ -26275,7 +26288,7 @@ function gatherPossibleChildren(node) {
26275
26288
  function setExternalModuleIndicator(sourceFile) {
26276
26289
  sourceFile.externalModuleIndicator = isFileProbablyExternalModule(sourceFile);
26277
26290
  }
26278
- function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes = false, scriptKind) {
26291
+ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes = false, scriptKind, skipNonSemanticJSDoc) {
26279
26292
  var _a, _b, _c, _d;
26280
26293
  (_a = tracing) == null ? void 0 : _a.push(
26281
26294
  tracing.Phase.Parse,
@@ -26301,7 +26314,8 @@ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setPar
26301
26314
  void 0,
26302
26315
  setParentNodes,
26303
26316
  6 /* JSON */,
26304
- noop
26317
+ noop,
26318
+ skipNonSemanticJSDoc
26305
26319
  );
26306
26320
  } else {
26307
26321
  const setIndicator = format === void 0 ? overrideSetExternalModuleIndicator : (file) => {
@@ -26316,7 +26330,8 @@ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setPar
26316
26330
  void 0,
26317
26331
  setParentNodes,
26318
26332
  scriptKind,
26319
- setIndicator
26333
+ setIndicator,
26334
+ skipNonSemanticJSDoc
26320
26335
  );
26321
26336
  }
26322
26337
  (_c = perfLogger) == null ? void 0 : _c.logStopParseSourceFile();
@@ -26435,7 +26450,7 @@ var Parser;
26435
26450
  var contextFlags;
26436
26451
  var topLevel = true;
26437
26452
  var parseErrorBeforeNextFinishedNode = false;
26438
- function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride) {
26453
+ function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride, skipNonSemanticJSDoc) {
26439
26454
  var _a;
26440
26455
  scriptKind2 = ensureScriptKind(fileName2, scriptKind2);
26441
26456
  if (scriptKind2 === 6 /* JSON */) {
@@ -26457,8 +26472,9 @@ var Parser;
26457
26472
  result2.pragmas = emptyMap;
26458
26473
  return result2;
26459
26474
  }
26460
- initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, scriptKind2);
26461
- const result = parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicatorOverride || setExternalModuleIndicator);
26475
+ skipNonSemanticJSDoc = !!skipNonSemanticJSDoc && scriptKind2 !== 1 /* JS */ && scriptKind2 !== 2 /* JSX */;
26476
+ initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, scriptKind2, skipNonSemanticJSDoc);
26477
+ const result = parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicatorOverride || setExternalModuleIndicator, skipNonSemanticJSDoc);
26462
26478
  clearState();
26463
26479
  return result;
26464
26480
  }
@@ -26470,7 +26486,9 @@ var Parser;
26470
26486
  languageVersion2,
26471
26487
  /*syntaxCursor*/
26472
26488
  void 0,
26473
- 1 /* JS */
26489
+ 1 /* JS */,
26490
+ /*skipNonSemanticJSDoc*/
26491
+ false
26474
26492
  );
26475
26493
  nextToken();
26476
26494
  const entityName = parseEntityName(
@@ -26483,7 +26501,15 @@ var Parser;
26483
26501
  }
26484
26502
  Parser2.parseIsolatedEntityName = parseIsolatedEntityName2;
26485
26503
  function parseJsonText2(fileName2, sourceText2, languageVersion2 = 2 /* ES2015 */, syntaxCursor2, setParentNodes = false) {
26486
- initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, 6 /* JSON */);
26504
+ initializeState(
26505
+ fileName2,
26506
+ sourceText2,
26507
+ languageVersion2,
26508
+ syntaxCursor2,
26509
+ 6 /* JSON */,
26510
+ /*skipNonSemanticJSDoc*/
26511
+ false
26512
+ );
26487
26513
  sourceFlags = contextFlags;
26488
26514
  nextToken();
26489
26515
  const pos = getNodePos();
@@ -26564,7 +26590,7 @@ var Parser;
26564
26590
  return result;
26565
26591
  }
26566
26592
  Parser2.parseJsonText = parseJsonText2;
26567
- function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind) {
26593
+ function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind, _skipNonSemanticJSDoc) {
26568
26594
  NodeConstructor2 = objectAllocator.getNodeConstructor();
26569
26595
  TokenConstructor2 = objectAllocator.getTokenConstructor();
26570
26596
  IdentifierConstructor2 = objectAllocator.getIdentifierConstructor();
@@ -26600,11 +26626,13 @@ var Parser;
26600
26626
  scanner.setOnError(scanError);
26601
26627
  scanner.setScriptTarget(languageVersion);
26602
26628
  scanner.setLanguageVariant(languageVariant);
26629
+ scanner.setSkipNonSemanticJSDoc(_skipNonSemanticJSDoc);
26603
26630
  }
26604
26631
  function clearState() {
26605
26632
  scanner.clearCommentDirectives();
26606
26633
  scanner.setText("");
26607
26634
  scanner.setOnError(void 0);
26635
+ scanner.setSkipNonSemanticJSDoc(false);
26608
26636
  sourceText = void 0;
26609
26637
  languageVersion = void 0;
26610
26638
  syntaxCursor = void 0;
@@ -26618,7 +26646,7 @@ var Parser;
26618
26646
  notParenthesizedArrow = void 0;
26619
26647
  topLevel = true;
26620
26648
  }
26621
- function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2) {
26649
+ function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2, skipNonSemanticJSDoc) {
26622
26650
  const isDeclarationFile = isDeclarationFileName(fileName);
26623
26651
  if (isDeclarationFile) {
26624
26652
  contextFlags |= 33554432 /* Ambient */;
@@ -26637,6 +26665,7 @@ var Parser;
26637
26665
  sourceFile.identifierCount = identifierCount;
26638
26666
  sourceFile.identifiers = identifiers;
26639
26667
  sourceFile.parseDiagnostics = attachFileToDiagnostics(parseDiagnostics, sourceFile);
26668
+ sourceFile.skipNonSemanticJSDoc = skipNonSemanticJSDoc;
26640
26669
  if (jsDocDiagnostics) {
26641
26670
  sourceFile.jsDocDiagnostics = attachFileToDiagnostics(jsDocDiagnostics, sourceFile);
26642
26671
  }
@@ -32070,7 +32099,9 @@ var Parser;
32070
32099
  99 /* Latest */,
32071
32100
  /*syntaxCursor*/
32072
32101
  void 0,
32073
- 1 /* JS */
32102
+ 1 /* JS */,
32103
+ /*skipNonSemanticJSDoc*/
32104
+ false
32074
32105
  );
32075
32106
  scanner.setText(content, start, length2);
32076
32107
  currentToken = scanner.scan();
@@ -32134,7 +32165,9 @@ var Parser;
32134
32165
  99 /* Latest */,
32135
32166
  /*syntaxCursor*/
32136
32167
  void 0,
32137
- 1 /* JS */
32168
+ 1 /* JS */,
32169
+ /*skipNonSemanticJSDoc*/
32170
+ false
32138
32171
  );
32139
32172
  const jsDoc = doInsideOfContext(16777216 /* JSDoc */, () => parseJSDocCommentWorker(start, length2));
32140
32173
  const sourceFile = { languageVariant: 0 /* Standard */, text: content };
@@ -33090,7 +33123,8 @@ var IncrementalParser;
33090
33123
  /*setParentNodes*/
33091
33124
  true,
33092
33125
  sourceFile.scriptKind,
33093
- sourceFile.setExternalModuleIndicator
33126
+ sourceFile.setExternalModuleIndicator,
33127
+ sourceFile.skipNonSemanticJSDoc
33094
33128
  );
33095
33129
  }
33096
33130
  const incrementalSourceFile = sourceFile;
@@ -33114,7 +33148,8 @@ var IncrementalParser;
33114
33148
  /*setParentNodes*/
33115
33149
  true,
33116
33150
  sourceFile.scriptKind,
33117
- sourceFile.setExternalModuleIndicator
33151
+ sourceFile.setExternalModuleIndicator,
33152
+ sourceFile.skipNonSemanticJSDoc
33118
33153
  );
33119
33154
  result.commentDirectives = getNewCommentDirectives(
33120
33155
  sourceFile.commentDirectives,
@@ -43464,20 +43499,30 @@ function createTypeChecker(host) {
43464
43499
  typeHasCallOrConstructSignatures
43465
43500
  };
43466
43501
  function runWithoutResolvedSignatureCaching(node, fn) {
43467
- const cachedSignatures = [];
43502
+ const cachedResolvedSignatures = [];
43503
+ const cachedTypes2 = [];
43468
43504
  while (node) {
43469
- if (isCallLikeExpression(node)) {
43505
+ if (isCallLikeExpression(node) || isFunctionLike(node)) {
43470
43506
  const nodeLinks2 = getNodeLinks(node);
43471
43507
  const resolvedSignature = nodeLinks2.resolvedSignature;
43472
- cachedSignatures.push([nodeLinks2, resolvedSignature]);
43508
+ cachedResolvedSignatures.push([nodeLinks2, resolvedSignature]);
43473
43509
  nodeLinks2.resolvedSignature = void 0;
43474
43510
  }
43511
+ if (isFunctionLike(node)) {
43512
+ const symbolLinks2 = getSymbolLinks(getSymbolOfDeclaration(node));
43513
+ const type = symbolLinks2.type;
43514
+ cachedTypes2.push([symbolLinks2, type]);
43515
+ symbolLinks2.type = void 0;
43516
+ }
43475
43517
  node = node.parent;
43476
43518
  }
43477
43519
  const result = fn();
43478
- for (const [nodeLinks2, resolvedSignature] of cachedSignatures) {
43520
+ for (const [nodeLinks2, resolvedSignature] of cachedResolvedSignatures) {
43479
43521
  nodeLinks2.resolvedSignature = resolvedSignature;
43480
43522
  }
43523
+ for (const [symbolLinks2, type] of cachedTypes2) {
43524
+ symbolLinks2.type = type;
43525
+ }
43481
43526
  return result;
43482
43527
  }
43483
43528
  function runWithInferenceBlockedFromSourceNode(node, fn) {
@@ -43530,29 +43575,72 @@ function createTypeChecker(host) {
43530
43575
  var resolvingSymbol = createSymbol(0, "__resolving__" /* Resolving */);
43531
43576
  var unresolvedSymbols = /* @__PURE__ */ new Map();
43532
43577
  var errorTypes = /* @__PURE__ */ new Map();
43578
+ var seenIntrinsicNames = /* @__PURE__ */ new Set();
43533
43579
  var anyType = createIntrinsicType(1 /* Any */, "any");
43534
- var autoType = createIntrinsicType(1 /* Any */, "any", 262144 /* NonInferrableType */);
43535
- var wildcardType = createIntrinsicType(1 /* Any */, "any");
43536
- var blockedStringType = createIntrinsicType(1 /* Any */, "any");
43580
+ var autoType = createIntrinsicType(1 /* Any */, "any", 262144 /* NonInferrableType */, "auto");
43581
+ var wildcardType = createIntrinsicType(
43582
+ 1 /* Any */,
43583
+ "any",
43584
+ /*objectFlags*/
43585
+ void 0,
43586
+ "wildcard"
43587
+ );
43588
+ var blockedStringType = createIntrinsicType(
43589
+ 1 /* Any */,
43590
+ "any",
43591
+ /*objectFlags*/
43592
+ void 0,
43593
+ "blocked string"
43594
+ );
43537
43595
  var errorType = createIntrinsicType(1 /* Any */, "error");
43538
43596
  var unresolvedType = createIntrinsicType(1 /* Any */, "unresolved");
43539
- var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 65536 /* ContainsWideningType */);
43597
+ var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 65536 /* ContainsWideningType */, "non-inferrable");
43540
43598
  var intrinsicMarkerType = createIntrinsicType(1 /* Any */, "intrinsic");
43541
43599
  var unknownType = createIntrinsicType(2 /* Unknown */, "unknown");
43542
- var nonNullUnknownType = createIntrinsicType(2 /* Unknown */, "unknown");
43600
+ var nonNullUnknownType = createIntrinsicType(
43601
+ 2 /* Unknown */,
43602
+ "unknown",
43603
+ /*objectFlags*/
43604
+ void 0,
43605
+ "non-null"
43606
+ );
43543
43607
  var undefinedType = createIntrinsicType(32768 /* Undefined */, "undefined");
43544
- var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 65536 /* ContainsWideningType */);
43545
- var missingType = createIntrinsicType(32768 /* Undefined */, "undefined");
43608
+ var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 65536 /* ContainsWideningType */, "widening");
43609
+ var missingType = createIntrinsicType(
43610
+ 32768 /* Undefined */,
43611
+ "undefined",
43612
+ /*objectFlags*/
43613
+ void 0,
43614
+ "missing"
43615
+ );
43546
43616
  var undefinedOrMissingType = exactOptionalPropertyTypes ? missingType : undefinedType;
43547
- var optionalType = createIntrinsicType(32768 /* Undefined */, "undefined");
43617
+ var optionalType = createIntrinsicType(
43618
+ 32768 /* Undefined */,
43619
+ "undefined",
43620
+ /*objectFlags*/
43621
+ void 0,
43622
+ "optional"
43623
+ );
43548
43624
  var nullType = createIntrinsicType(65536 /* Null */, "null");
43549
- var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null", 65536 /* ContainsWideningType */);
43625
+ var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null", 65536 /* ContainsWideningType */, "widening");
43550
43626
  var stringType = createIntrinsicType(4 /* String */, "string");
43551
43627
  var numberType = createIntrinsicType(8 /* Number */, "number");
43552
43628
  var bigintType = createIntrinsicType(64 /* BigInt */, "bigint");
43553
- var falseType = createIntrinsicType(512 /* BooleanLiteral */, "false");
43629
+ var falseType = createIntrinsicType(
43630
+ 512 /* BooleanLiteral */,
43631
+ "false",
43632
+ /*objectFlags*/
43633
+ void 0,
43634
+ "fresh"
43635
+ );
43554
43636
  var regularFalseType = createIntrinsicType(512 /* BooleanLiteral */, "false");
43555
- var trueType = createIntrinsicType(512 /* BooleanLiteral */, "true");
43637
+ var trueType = createIntrinsicType(
43638
+ 512 /* BooleanLiteral */,
43639
+ "true",
43640
+ /*objectFlags*/
43641
+ void 0,
43642
+ "fresh"
43643
+ );
43556
43644
  var regularTrueType = createIntrinsicType(512 /* BooleanLiteral */, "true");
43557
43645
  trueType.regularType = regularTrueType;
43558
43646
  trueType.freshType = trueType;
@@ -43566,9 +43654,21 @@ function createTypeChecker(host) {
43566
43654
  var esSymbolType = createIntrinsicType(4096 /* ESSymbol */, "symbol");
43567
43655
  var voidType = createIntrinsicType(16384 /* Void */, "void");
43568
43656
  var neverType = createIntrinsicType(131072 /* Never */, "never");
43569
- var silentNeverType = createIntrinsicType(131072 /* Never */, "never", 262144 /* NonInferrableType */);
43570
- var implicitNeverType = createIntrinsicType(131072 /* Never */, "never");
43571
- var unreachableNeverType = createIntrinsicType(131072 /* Never */, "never");
43657
+ var silentNeverType = createIntrinsicType(131072 /* Never */, "never", 262144 /* NonInferrableType */, "silent");
43658
+ var implicitNeverType = createIntrinsicType(
43659
+ 131072 /* Never */,
43660
+ "never",
43661
+ /*objectFlags*/
43662
+ void 0,
43663
+ "implicit"
43664
+ );
43665
+ var unreachableNeverType = createIntrinsicType(
43666
+ 131072 /* Never */,
43667
+ "never",
43668
+ /*objectFlags*/
43669
+ void 0,
43670
+ "unreachable"
43671
+ );
43572
43672
  var nonPrimitiveType = createIntrinsicType(67108864 /* NonPrimitive */, "object");
43573
43673
  var stringOrNumberType = getUnionType([stringType, numberType]);
43574
43674
  var stringNumberSymbolType = getUnionType([stringType, numberType, esSymbolType]);
@@ -43578,7 +43678,13 @@ function createTypeChecker(host) {
43578
43678
  var numericStringType = getTemplateLiteralType(["", ""], [numberType]);
43579
43679
  var restrictiveMapper = makeFunctionTypeMapper((t) => t.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(t) : t, () => "(restrictive mapper)");
43580
43680
  var permissiveMapper = makeFunctionTypeMapper((t) => t.flags & 262144 /* TypeParameter */ ? wildcardType : t, () => "(permissive mapper)");
43581
- var uniqueLiteralType = createIntrinsicType(131072 /* Never */, "never");
43681
+ var uniqueLiteralType = createIntrinsicType(
43682
+ 131072 /* Never */,
43683
+ "never",
43684
+ /*objectFlags*/
43685
+ void 0,
43686
+ "unique literal"
43687
+ );
43582
43688
  var uniqueLiteralMapper = makeFunctionTypeMapper((t) => t.flags & 262144 /* TypeParameter */ ? uniqueLiteralType : t, () => "(unique literal mapper)");
43583
43689
  var outofbandVarianceMarkerHandler;
43584
43690
  var reportUnreliableMapper = makeFunctionTypeMapper((t) => {
@@ -46822,12 +46928,21 @@ function createTypeChecker(host) {
46822
46928
  function createOriginType(flags) {
46823
46929
  return new Type7(checker, flags);
46824
46930
  }
46825
- function createIntrinsicType(kind, intrinsicName, objectFlags = 0 /* None */) {
46931
+ function createIntrinsicType(kind, intrinsicName, objectFlags = 0 /* None */, debugIntrinsicName) {
46932
+ checkIntrinsicName(intrinsicName, debugIntrinsicName);
46826
46933
  const type = createType(kind);
46827
46934
  type.intrinsicName = intrinsicName;
46935
+ type.debugIntrinsicName = debugIntrinsicName;
46828
46936
  type.objectFlags = objectFlags | 524288 /* CouldContainTypeVariablesComputed */ | 2097152 /* IsGenericTypeComputed */ | 33554432 /* IsUnknownLikeUnionComputed */ | 16777216 /* IsNeverIntersectionComputed */;
46829
46937
  return type;
46830
46938
  }
46939
+ function checkIntrinsicName(name, debug) {
46940
+ const key = `${name},${debug ?? ""}`;
46941
+ if (seenIntrinsicNames.has(key)) {
46942
+ Debug.fail(`Duplicate intrinsic type name ${name}${debug ? ` (${debug})` : ""}; you may need to pass a name to createIntrinsicType.`);
46943
+ }
46944
+ seenIntrinsicNames.add(key);
46945
+ }
46831
46946
  function createObjectType(objectFlags, symbol) {
46832
46947
  const type = createTypeWithSymbol(524288 /* Object */, symbol);
46833
46948
  type.objectFlags = objectFlags;
@@ -49124,6 +49239,10 @@ function createTypeChecker(host) {
49124
49239
  const type = checkExpression(name.expression);
49125
49240
  return !!(type.flags & 402653316 /* StringLike */);
49126
49241
  }
49242
+ if (isElementAccessExpression(name)) {
49243
+ const type = checkExpression(name.argumentExpression);
49244
+ return !!(type.flags & 402653316 /* StringLike */);
49245
+ }
49127
49246
  return isStringLiteral(name);
49128
49247
  }
49129
49248
  function isSingleQuotedStringNamed(d) {
@@ -50559,6 +50678,7 @@ function createTypeChecker(host) {
50559
50678
  if (isTypeRepresentableAsFunctionNamespaceMerge(typeToSerialize, symbol)) {
50560
50679
  serializeAsFunctionNamespaceMerge(typeToSerialize, symbol, varName, isExportAssignmentCompatibleSymbolName ? 0 /* None */ : 1 /* Export */);
50561
50680
  } else {
50681
+ const flags = ((_a2 = context.enclosingDeclaration) == null ? void 0 : _a2.kind) === 267 /* ModuleDeclaration */ && (!(symbol.flags & 98304 /* Accessor */) || symbol.flags & 65536 /* SetAccessor */) ? 1 /* Let */ : 2 /* Const */;
50562
50682
  const statement = factory.createVariableStatement(
50563
50683
  /*modifiers*/
50564
50684
  void 0,
@@ -50569,7 +50689,7 @@ function createTypeChecker(host) {
50569
50689
  void 0,
50570
50690
  serializeTypeForDeclaration(context, typeToSerialize, symbol, enclosingDeclaration, includePrivateSymbol, bundled)
50571
50691
  )
50572
- ], ((_a2 = context.enclosingDeclaration) == null ? void 0 : _a2.kind) === 267 /* ModuleDeclaration */ ? 1 /* Let */ : 2 /* Const */)
50692
+ ], flags)
50573
50693
  );
50574
50694
  addResult(
50575
50695
  statement,
@@ -51257,10 +51377,6 @@ function createTypeChecker(host) {
51257
51377
  const prop = getPropertyOfType(type, name);
51258
51378
  return prop ? getTypeOfSymbol(prop) : void 0;
51259
51379
  }
51260
- function getTypeOfPropertyOrIndexSignature(type, name) {
51261
- var _a;
51262
- return getTypeOfPropertyOfType(type, name) || ((_a = getApplicableIndexInfoForName(type, name)) == null ? void 0 : _a.type) || unknownType;
51263
- }
51264
51380
  function getTypeOfPropertyOrIndexSignatureOfType(type, name) {
51265
51381
  var _a;
51266
51382
  let propType;
@@ -51399,9 +51515,14 @@ function createTypeChecker(host) {
51399
51515
  function getTypeForBindingElement(declaration) {
51400
51516
  const checkMode = declaration.dotDotDotToken ? 64 /* RestBindingElement */ : 0 /* Normal */;
51401
51517
  const parentType = getTypeForBindingElementParent(declaration.parent.parent, checkMode);
51402
- return parentType && getBindingElementTypeFromParentType(declaration, parentType);
51518
+ return parentType && getBindingElementTypeFromParentType(
51519
+ declaration,
51520
+ parentType,
51521
+ /*noTupleBoundsCheck*/
51522
+ false
51523
+ );
51403
51524
  }
51404
- function getBindingElementTypeFromParentType(declaration, parentType) {
51525
+ function getBindingElementTypeFromParentType(declaration, parentType, noTupleBoundsCheck) {
51405
51526
  if (isTypeAny(parentType)) {
51406
51527
  return parentType;
51407
51528
  }
@@ -51440,7 +51561,7 @@ function createTypeChecker(host) {
51440
51561
  type = everyType(baseConstraint, isTupleType) ? mapType(baseConstraint, (t) => sliceTupleType(t, index)) : createArrayType(elementType);
51441
51562
  } else if (isArrayLikeType(parentType)) {
51442
51563
  const indexType = getNumberLiteralType(index);
51443
- const accessFlags = 32 /* ExpressionPosition */ | (hasDefaultValue(declaration) ? 16 /* NoTupleBoundsCheck */ : 0);
51564
+ const accessFlags = 32 /* ExpressionPosition */ | (noTupleBoundsCheck || hasDefaultValue(declaration) ? 16 /* NoTupleBoundsCheck */ : 0);
51444
51565
  const declaredType = getIndexedAccessTypeOrUndefined(parentType, indexType, accessFlags, declaration.name) || errorType;
51445
51566
  type = getFlowTypeOfDestructuring(declaration, declaredType);
51446
51567
  } else {
@@ -53489,13 +53610,14 @@ function createTypeChecker(host) {
53489
53610
  const paramName = leftName === rightName ? leftName : !leftName ? rightName : !rightName ? leftName : void 0;
53490
53611
  const paramSymbol = createSymbol(
53491
53612
  1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0),
53492
- paramName || `arg${i}`
53613
+ paramName || `arg${i}`,
53614
+ isRestParam ? 32768 /* RestParameter */ : isOptional ? 16384 /* OptionalParameter */ : 0
53493
53615
  );
53494
53616
  paramSymbol.links.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
53495
53617
  params[i] = paramSymbol;
53496
53618
  }
53497
53619
  if (needsExtraRestElement) {
53498
- const restParamSymbol = createSymbol(1 /* FunctionScopedVariable */, "args");
53620
+ const restParamSymbol = createSymbol(1 /* FunctionScopedVariable */, "args", 32768 /* RestParameter */);
53499
53621
  restParamSymbol.links.type = createArrayType(getTypeAtPosition(shorter, longestCount));
53500
53622
  if (shorter === right) {
53501
53623
  restParamSymbol.links.type = instantiateType(restParamSymbol.links.type, mapper);
@@ -53863,7 +53985,9 @@ function createTypeChecker(host) {
53863
53985
  } else if (isValidIndexKeyType(propNameType) || propNameType.flags & (1 /* Any */ | 32 /* Enum */)) {
53864
53986
  const indexKeyType = propNameType.flags & (1 /* Any */ | 4 /* String */) ? stringType : propNameType.flags & (8 /* Number */ | 32 /* Enum */) ? numberType : propNameType;
53865
53987
  const propType = instantiateType(templateType, appendTypeMapping(type.mapper, typeParameter, keyType));
53866
- const indexInfo = createIndexInfo(indexKeyType, propType, !!(templateModifiers & 1 /* IncludeReadonly */));
53988
+ const modifiersIndexInfo = getApplicableIndexInfo(modifiersType, propNameType);
53989
+ const isReadonly = !!(templateModifiers & 1 /* IncludeReadonly */ || !(templateModifiers & 2 /* ExcludeReadonly */) && (modifiersIndexInfo == null ? void 0 : modifiersIndexInfo.isReadonly));
53990
+ const indexInfo = createIndexInfo(indexKeyType, propType, isReadonly);
53867
53991
  indexInfos = appendIndexInfo(
53868
53992
  indexInfos,
53869
53993
  indexInfo,
@@ -55461,7 +55585,13 @@ function createTypeChecker(host) {
55461
55585
  const id = getAliasId(symbol, typeArguments);
55462
55586
  let errorType2 = errorTypes.get(id);
55463
55587
  if (!errorType2) {
55464
- errorType2 = createIntrinsicType(1 /* Any */, "error");
55588
+ errorType2 = createIntrinsicType(
55589
+ 1 /* Any */,
55590
+ "error",
55591
+ /*objectFlags*/
55592
+ void 0,
55593
+ `alias ${id}`
55594
+ );
55465
55595
  errorType2.aliasSymbol = symbol;
55466
55596
  errorType2.aliasTypeArguments = typeArguments;
55467
55597
  errorTypes.set(id, errorType2);
@@ -57304,7 +57434,7 @@ function createTypeChecker(host) {
57304
57434
  return autoType;
57305
57435
  }
57306
57436
  }
57307
- const propType = getTypeOfSymbol(prop);
57437
+ const propType = accessFlags & 4 /* Writing */ ? getWriteTypeOfSymbol(prop) : getTypeOfSymbol(prop);
57308
57438
  return accessExpression && getAssignmentTargetKind(accessExpression) !== 1 /* Definite */ ? getFlowTypeOfReference(accessExpression, propType) : accessNode && isIndexedAccessTypeNode(accessNode) && containsMissingType(propType) ? getUnionType([propType, undefinedType]) : propType;
57309
57439
  }
57310
57440
  if (everyType(objectType, isTupleType) && isNumericLiteralName(propName)) {
@@ -64445,7 +64575,7 @@ function createTypeChecker(host) {
64445
64575
  function hasMatchingArgument(expression, reference) {
64446
64576
  if (expression.arguments) {
64447
64577
  for (const argument of expression.arguments) {
64448
- if (isOrContainsMatchingReference(reference, argument)) {
64578
+ if (isOrContainsMatchingReference(reference, argument) || optionalChainContainsReference(argument, reference)) {
64449
64579
  return true;
64450
64580
  }
64451
64581
  }
@@ -65602,7 +65732,7 @@ function createTypeChecker(host) {
65602
65732
  propType = removeNullable && optionalChain ? getOptionalType(propType) : propType;
65603
65733
  const narrowedPropType = narrowType2(propType);
65604
65734
  return filterType(type, (t) => {
65605
- const discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
65735
+ const discriminantType = getTypeOfPropertyOrIndexSignatureOfType(t, propName) || unknownType;
65606
65736
  return !(discriminantType.flags & 131072 /* Never */) && !(narrowedPropType.flags & 131072 /* Never */) && areTypesComparable(narrowedPropType, discriminantType);
65607
65737
  });
65608
65738
  }
@@ -66085,7 +66215,7 @@ function createTypeChecker(host) {
66085
66215
  false
66086
66216
  );
66087
66217
  }
66088
- if (strictNullChecks && assumeTrue && optionalChainContainsReference(predicateArgument, reference) && !hasTypeFacts(predicate.type, 65536 /* EQUndefined */)) {
66218
+ if (strictNullChecks && optionalChainContainsReference(predicateArgument, reference) && (assumeTrue && !hasTypeFacts(predicate.type, 65536 /* EQUndefined */) || !assumeTrue && everyType(predicate.type, isNullableType))) {
66089
66219
  type = getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
66090
66220
  }
66091
66221
  const access = getDiscriminantPropertyAccess(predicateArgument, type);
@@ -66175,7 +66305,7 @@ function createTypeChecker(host) {
66175
66305
  if (isDeclarationName(location) && isSetAccessor(location.parent) && getAnnotatedAccessorTypeNode(location.parent)) {
66176
66306
  return getWriteTypeOfAccessors(location.parent.symbol);
66177
66307
  }
66178
- return getNonMissingTypeOfSymbol(symbol);
66308
+ return isRightSideOfAccessExpression(location) && isWriteAccess(location.parent) ? getWriteTypeOfSymbol(symbol) : getNonMissingTypeOfSymbol(symbol);
66179
66309
  }
66180
66310
  function getControlFlowContainer(node) {
66181
66311
  return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 268 /* ModuleBlock */ || node2.kind === 312 /* SourceFile */ || node2.kind === 172 /* PropertyDeclaration */);
@@ -66319,7 +66449,12 @@ function createTypeChecker(host) {
66319
66449
  if (narrowedType.flags & 131072 /* Never */) {
66320
66450
  return neverType;
66321
66451
  }
66322
- return getBindingElementTypeFromParentType(declaration, narrowedType);
66452
+ return getBindingElementTypeFromParentType(
66453
+ declaration,
66454
+ narrowedType,
66455
+ /*noTupleBoundsCheck*/
66456
+ true
66457
+ );
66323
66458
  }
66324
66459
  }
66325
66460
  }
@@ -66843,6 +66978,9 @@ function createTypeChecker(host) {
66843
66978
  error(node, Diagnostics.super_can_only_be_referenced_in_a_derived_class);
66844
66979
  return errorType;
66845
66980
  }
66981
+ if (classDeclarationExtendsNull(classLikeDeclaration)) {
66982
+ return isCallExpression2 ? errorType : nullWideningType;
66983
+ }
66846
66984
  const classType = getDeclaredTypeOfSymbol(getSymbolOfDeclaration(classLikeDeclaration));
66847
66985
  const baseClassType = classType && getBaseTypes(classType)[0];
66848
66986
  if (!baseClassType) {
@@ -72373,7 +72511,12 @@ function createTypeChecker(host) {
72373
72511
  function assignBindingElementTypes(pattern, parentType) {
72374
72512
  for (const element of pattern.elements) {
72375
72513
  if (!isOmittedExpression(element)) {
72376
- const type = getBindingElementTypeFromParentType(element, parentType);
72514
+ const type = getBindingElementTypeFromParentType(
72515
+ element,
72516
+ parentType,
72517
+ /*noTupleBoundsCheck*/
72518
+ false
72519
+ );
72377
72520
  if (element.name.kind === 80 /* Identifier */) {
72378
72521
  getSymbolLinks(getSymbolOfDeclaration(element)).type = type;
72379
72522
  } else {
@@ -81447,7 +81590,7 @@ function createTypeChecker(host) {
81447
81590
  if (!symbol || !(symbol.flags & 16 /* Function */)) {
81448
81591
  return false;
81449
81592
  }
81450
- return !!forEachEntry(getExportsOfSymbol(symbol), (p) => p.flags & 111551 /* Value */ && p.valueDeclaration && isPropertyAccessExpression(p.valueDeclaration));
81593
+ return !!forEachEntry(getExportsOfSymbol(symbol), (p) => p.flags & 111551 /* Value */ && isExpandoPropertyDeclaration(p.valueDeclaration));
81451
81594
  }
81452
81595
  function getPropertiesOfContainerFunction(node) {
81453
81596
  const declaration = getParseTreeNode(node, isFunctionDeclaration);
@@ -81954,11 +82097,11 @@ function createTypeChecker(host) {
81954
82097
  if (fileToDirective.has(file.path))
81955
82098
  return;
81956
82099
  fileToDirective.set(file.path, [key, mode]);
81957
- for (const { fileName, resolutionMode } of file.referencedFiles) {
82100
+ for (const { fileName } of file.referencedFiles) {
81958
82101
  const resolvedFile = resolveTripleslashReference(fileName, file.fileName);
81959
82102
  const referencedFile = host.getSourceFile(resolvedFile);
81960
82103
  if (referencedFile) {
81961
- addReferencedFilesToTypeDirective(referencedFile, key, resolutionMode || file.impliedNodeFormat);
82104
+ addReferencedFilesToTypeDirective(referencedFile, key, mode || file.impliedNodeFormat);
81962
82105
  }
81963
82106
  }
81964
82107
  }
@@ -107777,7 +107920,7 @@ function transformDeclarations(context) {
107777
107920
  fakespace.symbol = props[0].parent;
107778
107921
  const exportMappings = [];
107779
107922
  let declarations = mapDefined(props, (p) => {
107780
- if (!p.valueDeclaration || !(isPropertyAccessExpression(p.valueDeclaration) || isElementAccessExpression(p.valueDeclaration) || isBinaryExpression(p.valueDeclaration))) {
107923
+ if (!isExpandoPropertyDeclaration(p.valueDeclaration)) {
107781
107924
  return void 0;
107782
107925
  }
107783
107926
  const nameStr = unescapeLeadingUnderscores(p.escapedName);
@@ -112843,6 +112986,16 @@ function createPrinter(printerOptions = {}, handlers = {}) {
112843
112986
  increaseIndent();
112844
112987
  shouldDecreaseIndentAfterEmit = true;
112845
112988
  }
112989
+ if (shouldEmitInterveningComments && format & 60 /* DelimitersMask */ && !positionIsSynthesized(child.pos)) {
112990
+ const commentRange = getCommentRange(child);
112991
+ emitTrailingCommentsOfPosition(
112992
+ commentRange.pos,
112993
+ /*prefixSpace*/
112994
+ !!(format & 512 /* SpaceBetweenSiblings */),
112995
+ /*forceNoNewline*/
112996
+ true
112997
+ );
112998
+ }
112846
112999
  writeLine(separatingLineTerminatorCount);
112847
113000
  shouldEmitInterveningComments = false;
112848
113001
  } else if (previousSibling && format & 512 /* SpaceBetweenSiblings */) {
@@ -114691,7 +114844,7 @@ function computeCommonSourceDirectoryOfFilenames(fileNames, currentDirectory, ge
114691
114844
  function createCompilerHost(options, setParentNodes) {
114692
114845
  return createCompilerHostWorker(options, setParentNodes);
114693
114846
  }
114694
- function createGetSourceFile(readFile, getCompilerOptions, setParentNodes) {
114847
+ function createGetSourceFile(readFile, getCompilerOptions, setParentNodes, skipNonSemanticJSDocParsing2) {
114695
114848
  return (fileName, languageVersionOrOptions, onError) => {
114696
114849
  let text;
114697
114850
  try {
@@ -114705,7 +114858,15 @@ function createGetSourceFile(readFile, getCompilerOptions, setParentNodes) {
114705
114858
  }
114706
114859
  text = "";
114707
114860
  }
114708
- return text !== void 0 ? createSourceFile(fileName, text, languageVersionOrOptions, setParentNodes) : void 0;
114861
+ return text !== void 0 ? createSourceFile(
114862
+ fileName,
114863
+ text,
114864
+ languageVersionOrOptions,
114865
+ setParentNodes,
114866
+ /*scriptKind*/
114867
+ void 0,
114868
+ skipNonSemanticJSDocParsing2
114869
+ ) : void 0;
114709
114870
  };
114710
114871
  }
114711
114872
  function createWriteFileMeasuringIO(actualWriteFile, createDirectory, directoryExists) {
@@ -114729,7 +114890,7 @@ function createWriteFileMeasuringIO(actualWriteFile, createDirectory, directoryE
114729
114890
  }
114730
114891
  };
114731
114892
  }
114732
- function createCompilerHostWorker(options, setParentNodes, system = sys) {
114893
+ function createCompilerHostWorker(options, setParentNodes, skipNonSemanticJSDocParsing2, system = sys) {
114733
114894
  const existingDirectories = /* @__PURE__ */ new Map();
114734
114895
  const getCanonicalFileName = createGetCanonicalFileName(system.useCaseSensitiveFileNames);
114735
114896
  function directoryExists(directoryPath) {
@@ -114748,7 +114909,7 @@ function createCompilerHostWorker(options, setParentNodes, system = sys) {
114748
114909
  const newLine = getNewLineCharacter(options);
114749
114910
  const realpath = system.realpath && ((path) => system.realpath(path));
114750
114911
  const compilerHost = {
114751
- getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes),
114912
+ getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes, skipNonSemanticJSDocParsing2),
114752
114913
  getDefaultLibLocation,
114753
114914
  getDefaultLibFileName: (options2) => combinePaths(getDefaultLibLocation(), getDefaultLibFileName(options2)),
114754
114915
  writeFile: createWriteFileMeasuringIO(
@@ -120372,19 +120533,22 @@ function removeIgnoredPath(path) {
120372
120533
  function perceivedOsRootLengthForWatching(pathComponents2, length2) {
120373
120534
  if (length2 <= 1)
120374
120535
  return 1;
120375
- let userCheckIndex = 1;
120536
+ let indexAfterOsRoot = 1;
120376
120537
  let isDosStyle = pathComponents2[0].search(/[a-zA-Z]:/) === 0;
120377
120538
  if (pathComponents2[0] !== directorySeparator && !isDosStyle && // Non dos style paths
120378
120539
  pathComponents2[1].search(/[a-zA-Z]\$$/) === 0) {
120379
120540
  if (length2 === 2)
120380
120541
  return 2;
120381
- userCheckIndex = 2;
120542
+ indexAfterOsRoot = 2;
120382
120543
  isDosStyle = true;
120383
120544
  }
120384
- if (isDosStyle && !pathComponents2[userCheckIndex].match(/^users$/i)) {
120385
- return userCheckIndex;
120545
+ if (isDosStyle && !pathComponents2[indexAfterOsRoot].match(/^users$/i)) {
120546
+ return indexAfterOsRoot;
120547
+ }
120548
+ if (pathComponents2[indexAfterOsRoot].match(/^workspaces$/i)) {
120549
+ return indexAfterOsRoot + 1;
120386
120550
  }
120387
- return userCheckIndex + 2;
120551
+ return indexAfterOsRoot + 2;
120388
120552
  }
120389
120553
  function canWatchDirectoryOrFile(pathComponents2, length2) {
120390
120554
  if (length2 === void 0)
@@ -121819,7 +121983,8 @@ function createCompilerHostFromProgramHost(host, getCompilerOptions, directorySt
121819
121983
  (fileName, encoding) => !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding),
121820
121984
  getCompilerOptions,
121821
121985
  /*setParentNodes*/
121822
- void 0
121986
+ void 0,
121987
+ host.skipNonSemanticJSDocParsing
121823
121988
  ),
121824
121989
  getDefaultLibLocation: maybeBind(host, host.getDefaultLibLocation),
121825
121990
  getDefaultLibFileName: (options) => host.getDefaultLibFileName(options),
@@ -122005,11 +122170,12 @@ function readBuilderProgram(compilerOptions, host) {
122005
122170
  return void 0;
122006
122171
  return createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, host);
122007
122172
  }
122008
- function createIncrementalCompilerHost(options, system = sys) {
122173
+ function createIncrementalCompilerHost(options, system = sys, skipNonSemanticJSDocParsing2) {
122009
122174
  const host = createCompilerHostWorker(
122010
122175
  options,
122011
122176
  /*setParentNodes*/
122012
122177
  void 0,
122178
+ skipNonSemanticJSDocParsing2,
122013
122179
  system
122014
122180
  );
122015
122181
  host.createHash = maybeBind(system, system.createHash);
@@ -125339,6 +125505,7 @@ function reportWatchModeWithoutSysSupport(sys2, reportDiagnostic) {
125339
125505
  }
125340
125506
  return false;
125341
125507
  }
125508
+ var skipNonSemanticJSDocParsing = true;
125342
125509
  function performBuild(sys2, cb, buildOptions, watchOptions, projects, errors) {
125343
125510
  const reportDiagnostic = updateReportDiagnostic(
125344
125511
  sys2,
@@ -125377,6 +125544,7 @@ function performBuild(sys2, cb, buildOptions, watchOptions, projects, errors) {
125377
125544
  createBuilderStatusReporter(sys2, shouldBePretty(sys2, buildOptions)),
125378
125545
  createWatchStatusReporter2(sys2, buildOptions)
125379
125546
  );
125547
+ buildHost2.skipNonSemanticJSDocParsing = skipNonSemanticJSDocParsing;
125380
125548
  const solutionPerformance2 = enableSolutionPerformance(sys2, buildOptions);
125381
125549
  updateSolutionBuilderHost(sys2, cb, buildHost2, solutionPerformance2);
125382
125550
  const onWatchStatusChange = buildHost2.onWatchStatusChange;
@@ -125401,6 +125569,7 @@ function performBuild(sys2, cb, buildOptions, watchOptions, projects, errors) {
125401
125569
  createBuilderStatusReporter(sys2, shouldBePretty(sys2, buildOptions)),
125402
125570
  createReportErrorSummary(sys2, buildOptions)
125403
125571
  );
125572
+ buildHost.skipNonSemanticJSDocParsing = skipNonSemanticJSDocParsing;
125404
125573
  const solutionPerformance = enableSolutionPerformance(sys2, buildOptions);
125405
125574
  updateSolutionBuilderHost(sys2, cb, buildHost, solutionPerformance);
125406
125575
  const builder = createSolutionBuilder(buildHost, projects, buildOptions);
@@ -125418,6 +125587,7 @@ function performCompilation(sys2, cb, reportDiagnostic, config) {
125418
125587
  options,
125419
125588
  /*setParentNodes*/
125420
125589
  void 0,
125590
+ skipNonSemanticJSDocParsing,
125421
125591
  sys2
125422
125592
  );
125423
125593
  const currentDirectory = host.getCurrentDirectory();
@@ -125460,7 +125630,7 @@ function performIncrementalCompilation2(sys2, cb, reportDiagnostic, config) {
125460
125630
  /*isBuildMode*/
125461
125631
  false
125462
125632
  );
125463
- const host = createIncrementalCompilerHost(options, sys2);
125633
+ const host = createIncrementalCompilerHost(options, sys2, skipNonSemanticJSDocParsing);
125464
125634
  const exitStatus = performIncrementalCompilation({
125465
125635
  host,
125466
125636
  system: sys2,
@@ -125515,6 +125685,7 @@ function updateCreateProgram(sys2, host, isBuildMode) {
125515
125685
  };
125516
125686
  }
125517
125687
  function updateWatchCompilationHost(sys2, cb, watchCompilerHost) {
125688
+ watchCompilerHost.skipNonSemanticJSDocParsing = skipNonSemanticJSDocParsing;
125518
125689
  updateCreateProgram(
125519
125690
  sys2,
125520
125691
  watchCompilerHost,