typescript 4.9.0-dev.20221012 → 4.9.0-dev.20221014

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
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
69
69
  var ts;
70
70
  (function (ts) {
71
71
  ts.versionMajorMinor = "4.9";
72
- ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221012");
72
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221014");
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  var globals = typeof globalThis !== "undefined" ? globalThis :
@@ -7065,6 +7065,8 @@ var ts;
7065
7065
  Remove_type_from_import_of_0_from_1: diag(90056, ts.DiagnosticCategory.Message, "Remove_type_from_import_of_0_from_1_90056", "Remove 'type' from import of '{0}' from \"{1}\""),
7066
7066
  Add_import_from_0: diag(90057, ts.DiagnosticCategory.Message, "Add_import_from_0_90057", "Add import from \"{0}\""),
7067
7067
  Update_import_from_0: diag(90058, ts.DiagnosticCategory.Message, "Update_import_from_0_90058", "Update import from \"{0}\""),
7068
+ Export_0_from_module_1: diag(90059, ts.DiagnosticCategory.Message, "Export_0_from_module_1_90059", "Export '{0}' from module '{1}'"),
7069
+ Export_all_referenced_locals: diag(90060, ts.DiagnosticCategory.Message, "Export_all_referenced_locals_90060", "Export all referenced locals"),
7068
7070
  Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"),
7069
7071
  Convert_0_to_1_in_0: diag(95003, ts.DiagnosticCategory.Message, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"),
7070
7072
  Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"),
@@ -17284,6 +17286,32 @@ var ts;
17284
17286
  return parameter.kind === 343 ? (_a = parameter.typeExpression) === null || _a === void 0 ? void 0 : _a.type : parameter.type;
17285
17287
  }
17286
17288
  ts.getParameterTypeNode = getParameterTypeNode;
17289
+ function isTypeDeclaration(node) {
17290
+ switch (node.kind) {
17291
+ case 165:
17292
+ case 260:
17293
+ case 261:
17294
+ case 262:
17295
+ case 263:
17296
+ case 348:
17297
+ case 341:
17298
+ case 342:
17299
+ return true;
17300
+ case 270:
17301
+ return node.isTypeOnly;
17302
+ case 273:
17303
+ case 278:
17304
+ return node.parent.parent.isTypeOnly;
17305
+ default:
17306
+ return false;
17307
+ }
17308
+ }
17309
+ ts.isTypeDeclaration = isTypeDeclaration;
17310
+ function canHaveExportModifier(node) {
17311
+ return ts.isEnumDeclaration(node) || ts.isVariableStatement(node) || ts.isFunctionDeclaration(node) || ts.isClassDeclaration(node)
17312
+ || ts.isInterfaceDeclaration(node) || isTypeDeclaration(node) || (ts.isModuleDeclaration(node) && !isExternalModuleAugmentation(node) && !isGlobalScopeAugmentation(node));
17313
+ }
17314
+ ts.canHaveExportModifier = canHaveExportModifier;
17287
17315
  })(ts || (ts = {}));
17288
17316
  var ts;
17289
17317
  (function (ts) {
@@ -45842,7 +45870,7 @@ var ts;
45842
45870
  if (!e.propertyName) {
45843
45871
  var indices = ts.indicesOf(statements);
45844
45872
  var associatedIndices = ts.filter(indices, function (i) { return ts.nodeHasName(statements[i], e.name); });
45845
- if (ts.length(associatedIndices) && ts.every(associatedIndices, function (i) { return canHaveExportModifier(statements[i]); })) {
45873
+ if (ts.length(associatedIndices) && ts.every(associatedIndices, function (i) { return ts.canHaveExportModifier(statements[i]); })) {
45846
45874
  for (var _i = 0, associatedIndices_1 = associatedIndices; _i < associatedIndices_1.length; _i++) {
45847
45875
  var index_1 = associatedIndices_1[_i];
45848
45876
  statements[index_1] = addExportModifier(statements[index_1]);
@@ -45872,15 +45900,6 @@ var ts;
45872
45900
  }
45873
45901
  return statements;
45874
45902
  }
45875
- function canHaveExportModifier(node) {
45876
- return ts.isEnumDeclaration(node) ||
45877
- ts.isVariableStatement(node) ||
45878
- ts.isFunctionDeclaration(node) ||
45879
- ts.isClassDeclaration(node) ||
45880
- (ts.isModuleDeclaration(node) && !ts.isExternalModuleAugmentation(node) && !ts.isGlobalScopeAugmentation(node)) ||
45881
- ts.isInterfaceDeclaration(node) ||
45882
- isTypeDeclaration(node);
45883
- }
45884
45903
  function addExportModifier(node) {
45885
45904
  var flags = (ts.getEffectiveModifierFlags(node) | 1) & ~2;
45886
45905
  return ts.factory.updateModifiers(node, flags);
@@ -46065,7 +46084,7 @@ var ts;
46065
46084
  (ts.isJSDocTypeAlias(context.enclosingDeclaration) ? ts.getSourceFileOfNode(context.enclosingDeclaration) : context.enclosingDeclaration);
46066
46085
  if (additionalModifierFlags & 1 &&
46067
46086
  enclosingDeclaration_1 && (isExportingScope(enclosingDeclaration_1) || ts.isModuleDeclaration(enclosingDeclaration_1)) &&
46068
- canHaveExportModifier(node)) {
46087
+ ts.canHaveExportModifier(node)) {
46069
46088
  newModifierFlags |= 1;
46070
46089
  }
46071
46090
  if (addingDeclare && !(newModifierFlags & 1) &&
@@ -53135,18 +53154,18 @@ var ts;
53135
53154
  var result;
53136
53155
  var extraTypes;
53137
53156
  var tailCount = 0;
53138
- var _loop_20 = function () {
53157
+ while (true) {
53139
53158
  if (tailCount === 1000) {
53140
53159
  error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite);
53141
53160
  result = errorType;
53142
- return "break";
53161
+ break;
53143
53162
  }
53144
53163
  var isUnwrapped = isTypicalNondistributiveConditional(root);
53145
53164
  var checkType = instantiateType(unwrapNondistributiveConditionalTuple(root, getActualTypeVariable(root.checkType)), mapper);
53146
53165
  var checkTypeInstantiable = isGenericType(checkType);
53147
53166
  var extendsType = instantiateType(unwrapNondistributiveConditionalTuple(root, root.extendsType), mapper);
53148
53167
  if (checkType === wildcardType || extendsType === wildcardType) {
53149
- return { value: wildcardType };
53168
+ return wildcardType;
53150
53169
  }
53151
53170
  var combinedMapper = void 0;
53152
53171
  if (root.inferTypeParameters) {
@@ -53162,7 +53181,7 @@ var ts;
53162
53181
  }
53163
53182
  }
53164
53183
  }
53165
- if (!checkTypeInstantiable || !ts.some(root.inferTypeParameters, function (t) { return t === extendsType; })) {
53184
+ if (!checkTypeInstantiable) {
53166
53185
  inferTypes(context.inferences, checkType, instantiateType(extendsType, freshMapper), 512 | 1024);
53167
53186
  }
53168
53187
  var innerMapper = combineTypeMappers(freshMapper, context.mapper);
@@ -53179,23 +53198,23 @@ var ts;
53179
53198
  var newRoot = falseType_1.root;
53180
53199
  if (newRoot.node.parent === root.node && (!newRoot.isDistributive || newRoot.checkType === root.checkType)) {
53181
53200
  root = newRoot;
53182
- return "continue";
53201
+ continue;
53183
53202
  }
53184
53203
  if (canTailRecurse(falseType_1, mapper)) {
53185
- return "continue";
53204
+ continue;
53186
53205
  }
53187
53206
  }
53188
53207
  result = instantiateType(falseType_1, mapper);
53189
- return "break";
53208
+ break;
53190
53209
  }
53191
53210
  if (inferredExtendsType.flags & 3 || isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(inferredExtendsType))) {
53192
53211
  var trueType_1 = getTypeFromTypeNode(root.node.trueType);
53193
53212
  var trueMapper = combinedMapper || mapper;
53194
53213
  if (canTailRecurse(trueType_1, trueMapper)) {
53195
- return "continue";
53214
+ continue;
53196
53215
  }
53197
53216
  result = instantiateType(trueType_1, trueMapper);
53198
- return "break";
53217
+ break;
53199
53218
  }
53200
53219
  }
53201
53220
  result = createType(16777216);
@@ -53206,14 +53225,7 @@ var ts;
53206
53225
  result.combinedMapper = combinedMapper;
53207
53226
  result.aliasSymbol = aliasSymbol || root.aliasSymbol;
53208
53227
  result.aliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(root.aliasTypeArguments, mapper);
53209
- return "break";
53210
- };
53211
- while (true) {
53212
- var state_6 = _loop_20();
53213
- if (typeof state_6 === "object")
53214
- return state_6.value;
53215
- if (state_6 === "break")
53216
- break;
53228
+ break;
53217
53229
  }
53218
53230
  return extraTypes ? getUnionType(ts.append(extraTypes, result)) : result;
53219
53231
  function canTailRecurse(newType, newMapper) {
@@ -55429,7 +55441,7 @@ var ts;
55429
55441
  return 0;
55430
55442
  }
55431
55443
  }
55432
- var isPerformingCommonPropertyChecks = (relation !== comparableRelation || !(source.flags & 1048576) && isLiteralType(source)) &&
55444
+ var isPerformingCommonPropertyChecks = (relation !== comparableRelation || isUnitType(source)) &&
55433
55445
  !(intersectionState & 2) &&
55434
55446
  source.flags & (131068 | 524288 | 2097152) && source !== globalObjectType &&
55435
55447
  target.flags & (524288 | 2097152) && isWeakType(target) &&
@@ -55457,12 +55469,6 @@ var ts;
55457
55469
  var result_7 = skipCaching ?
55458
55470
  unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState) :
55459
55471
  recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags);
55460
- if (result_7 && !inPropertyCheck && (target.flags & 2097152 && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||
55461
- isNonGenericObjectType(target) && !isArrayOrTupleType(target) && source.flags & 2097152 && getApparentType(source).flags & 3670016 && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 262144); }))) {
55462
- inPropertyCheck = true;
55463
- result_7 &= recursiveTypeRelatedTo(source, target, reportErrors, 4, recursionFlags);
55464
- inPropertyCheck = false;
55465
- }
55466
55472
  if (result_7) {
55467
55473
  return result_7;
55468
55474
  }
@@ -55571,7 +55577,7 @@ var ts;
55571
55577
  reducedTarget = findMatchingDiscriminantType(source, target, isRelatedTo) || filterPrimitivesIfContainsNonPrimitive(target);
55572
55578
  checkTypes = reducedTarget.flags & 1048576 ? reducedTarget.types : [reducedTarget];
55573
55579
  }
55574
- var _loop_21 = function (prop) {
55580
+ var _loop_20 = function (prop) {
55575
55581
  if (shouldCheckAsExcessProperty(prop, source.symbol) && !isIgnoredJsxProperty(source, prop)) {
55576
55582
  if (!isKnownProperty(reducedTarget, prop.escapedName, isComparingJsxAttributes)) {
55577
55583
  if (reportErrors) {
@@ -55624,9 +55630,9 @@ var ts;
55624
55630
  };
55625
55631
  for (var _i = 0, _b = getPropertiesOfType(source); _i < _b.length; _i++) {
55626
55632
  var prop = _b[_i];
55627
- var state_7 = _loop_21(prop);
55628
- if (typeof state_7 === "object")
55629
- return state_7.value;
55633
+ var state_6 = _loop_20(prop);
55634
+ if (typeof state_6 === "object")
55635
+ return state_6.value;
55630
55636
  }
55631
55637
  return false;
55632
55638
  }
@@ -55806,8 +55812,7 @@ var ts;
55806
55812
  if (overflow) {
55807
55813
  return 0;
55808
55814
  }
55809
- var keyIntersectionState = intersectionState | (inPropertyCheck ? 8 : 0);
55810
- var id = getRelationKey(source, target, keyIntersectionState, relation, false);
55815
+ var id = getRelationKey(source, target, intersectionState, relation, false);
55811
55816
  var entry = relation.get(id);
55812
55817
  if (entry !== undefined) {
55813
55818
  if (reportErrors && entry & 2 && !(entry & 4)) {
@@ -55831,7 +55836,7 @@ var ts;
55831
55836
  targetStack = [];
55832
55837
  }
55833
55838
  else {
55834
- var broadestEquivalentId = id.startsWith("*") ? getRelationKey(source, target, keyIntersectionState, relation, true) : undefined;
55839
+ var broadestEquivalentId = id.startsWith("*") ? getRelationKey(source, target, intersectionState, relation, true) : undefined;
55835
55840
  for (var i = 0; i < maybeCount; i++) {
55836
55841
  if (id === maybeKeys[i] || broadestEquivalentId && broadestEquivalentId === maybeKeys[i]) {
55837
55842
  return 3;
@@ -55913,10 +55918,18 @@ var ts;
55913
55918
  function structuredTypeRelatedTo(source, target, reportErrors, intersectionState) {
55914
55919
  var saveErrorInfo = captureErrorCalculationState();
55915
55920
  var result = structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState, saveErrorInfo);
55916
- if (!result && (source.flags & 2097152 || source.flags & 262144 && target.flags & 1048576)) {
55917
- var constraint = getEffectiveConstraintOfIntersection(source.flags & 2097152 ? source.types : [source], !!(target.flags & 1048576));
55918
- if (constraint && !(constraint.flags & 131072) && everyType(constraint, function (c) { return c !== source; })) {
55919
- result = isRelatedTo(constraint, target, 1, false, undefined, intersectionState);
55921
+ if (relation !== identityRelation) {
55922
+ if (!result && (source.flags & 2097152 || source.flags & 262144 && target.flags & 1048576)) {
55923
+ var constraint = getEffectiveConstraintOfIntersection(source.flags & 2097152 ? source.types : [source], !!(target.flags & 1048576));
55924
+ if (constraint && !(constraint.flags & 131072) && everyType(constraint, function (c) { return c !== source; })) {
55925
+ result = isRelatedTo(constraint, target, 1, false, undefined, intersectionState);
55926
+ }
55927
+ }
55928
+ if (result && !inPropertyCheck && (target.flags & 2097152 && !isGenericObjectType(target) && source.flags & (524288 | 2097152) ||
55929
+ isNonGenericObjectType(target) && !isArrayOrTupleType(target) && source.flags & 2097152 && getApparentType(source).flags & 3670016 && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 262144); }))) {
55930
+ inPropertyCheck = true;
55931
+ result &= propertiesRelatedTo(source, target, reportErrors, undefined, 0);
55932
+ inPropertyCheck = false;
55920
55933
  }
55921
55934
  }
55922
55935
  if (result) {
@@ -55925,9 +55938,6 @@ var ts;
55925
55938
  return result;
55926
55939
  }
55927
55940
  function structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState, saveErrorInfo) {
55928
- if (intersectionState & 4) {
55929
- return propertiesRelatedTo(source, target, reportErrors, undefined, 0);
55930
- }
55931
55941
  var result;
55932
55942
  var originalErrorInfo;
55933
55943
  var varianceCheckFailed = false;
@@ -56403,11 +56413,11 @@ var ts;
56403
56413
  }
56404
56414
  var discriminantCombinations = ts.cartesianProduct(sourceDiscriminantTypes);
56405
56415
  var matchingTypes = [];
56406
- var _loop_22 = function (combination) {
56416
+ var _loop_21 = function (combination) {
56407
56417
  var hasMatch = false;
56408
56418
  outer: for (var _c = 0, _d = target.types; _c < _d.length; _c++) {
56409
56419
  var type = _d[_c];
56410
- var _loop_23 = function (i) {
56420
+ var _loop_22 = function (i) {
56411
56421
  var sourceProperty = sourcePropertiesFiltered[i];
56412
56422
  var targetProperty = getPropertyOfType(type, sourceProperty.escapedName);
56413
56423
  if (!targetProperty)
@@ -56420,8 +56430,8 @@ var ts;
56420
56430
  }
56421
56431
  };
56422
56432
  for (var i = 0; i < sourcePropertiesFiltered.length; i++) {
56423
- var state_9 = _loop_23(i);
56424
- switch (state_9) {
56433
+ var state_8 = _loop_22(i);
56434
+ switch (state_8) {
56425
56435
  case "continue-outer": continue outer;
56426
56436
  }
56427
56437
  }
@@ -56434,9 +56444,9 @@ var ts;
56434
56444
  };
56435
56445
  for (var _a = 0, discriminantCombinations_1 = discriminantCombinations; _a < discriminantCombinations_1.length; _a++) {
56436
56446
  var combination = discriminantCombinations_1[_a];
56437
- var state_8 = _loop_22(combination);
56438
- if (typeof state_8 === "object")
56439
- return state_8.value;
56447
+ var state_7 = _loop_21(combination);
56448
+ if (typeof state_7 === "object")
56449
+ return state_7.value;
56440
56450
  }
56441
56451
  var result = -1;
56442
56452
  for (var _b = 0, matchingTypes_1 = matchingTypes; _b < matchingTypes_1.length; _b++) {
@@ -57078,7 +57088,7 @@ var ts;
57078
57088
  ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes", "getVariancesWorker", { arity: typeParameters.length, id: getTypeId(getDeclaredTypeOfSymbol(symbol)) });
57079
57089
  links.variances = ts.emptyArray;
57080
57090
  var variances = [];
57081
- var _loop_24 = function (tp) {
57091
+ var _loop_23 = function (tp) {
57082
57092
  var modifiers = getVarianceModifiers(tp);
57083
57093
  var variance = modifiers & 65536 ?
57084
57094
  modifiers & 32768 ? 0 : 1 :
@@ -57109,7 +57119,7 @@ var ts;
57109
57119
  };
57110
57120
  for (var _i = 0, typeParameters_2 = typeParameters; _i < typeParameters_2.length; _i++) {
57111
57121
  var tp = typeParameters_2[_i];
57112
- _loop_24(tp);
57122
+ _loop_23(tp);
57113
57123
  }
57114
57124
  links.variances = variances;
57115
57125
  ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop({ variances: variances.map(ts.Debug.formatVariance) });
@@ -58754,7 +58764,7 @@ var ts;
58754
58764
  var matches = inferTypesFromTemplateLiteralType(source, target);
58755
58765
  var types = target.types;
58756
58766
  if (matches || ts.every(target.texts, function (s) { return s.length === 0; })) {
58757
- var _loop_25 = function (i) {
58767
+ var _loop_24 = function (i) {
58758
58768
  var source_1 = matches ? matches[i] : neverType;
58759
58769
  var target_3 = types[i];
58760
58770
  if (source_1.flags & 128 && target_3.flags & 8650752) {
@@ -58798,7 +58808,7 @@ var ts;
58798
58808
  inferFromTypes(source_1, target_3);
58799
58809
  };
58800
58810
  for (var i = 0; i < types.length; i++) {
58801
- _loop_25(i);
58811
+ _loop_24(i);
58802
58812
  }
58803
58813
  }
58804
58814
  }
@@ -59278,7 +59288,7 @@ var ts;
59278
59288
  function mapTypesByKeyProperty(types, name) {
59279
59289
  var map = new ts.Map();
59280
59290
  var count = 0;
59281
- var _loop_26 = function (type) {
59291
+ var _loop_25 = function (type) {
59282
59292
  if (type.flags & (524288 | 2097152 | 58982400)) {
59283
59293
  var discriminant = getTypeOfPropertyOfType(type, name);
59284
59294
  if (discriminant) {
@@ -59304,9 +59314,9 @@ var ts;
59304
59314
  };
59305
59315
  for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
59306
59316
  var type = types_15[_i];
59307
- var state_10 = _loop_26(type);
59308
- if (typeof state_10 === "object")
59309
- return state_10.value;
59317
+ var state_9 = _loop_25(type);
59318
+ if (typeof state_9 === "object")
59319
+ return state_9.value;
59310
59320
  }
59311
59321
  return count >= 10 && count * 2 >= types.length ? map : undefined;
59312
59322
  }
@@ -64808,7 +64818,7 @@ var ts;
64808
64818
  var spreadIndex = getSpreadArgumentIndex(args);
64809
64819
  if (spreadIndex >= 0) {
64810
64820
  var effectiveArgs_1 = args.slice(0, spreadIndex);
64811
- var _loop_27 = function (i) {
64821
+ var _loop_26 = function (i) {
64812
64822
  var arg = args[i];
64813
64823
  var spreadType = arg.kind === 227 && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
64814
64824
  if (spreadType && isTupleType(spreadType)) {
@@ -64824,7 +64834,7 @@ var ts;
64824
64834
  }
64825
64835
  };
64826
64836
  for (var i = spreadIndex; i < args.length; i++) {
64827
- _loop_27(i);
64837
+ _loop_26(i);
64828
64838
  }
64829
64839
  return effectiveArgs_1;
64830
64840
  }
@@ -65074,7 +65084,7 @@ var ts;
65074
65084
  var min_3 = Number.MAX_VALUE;
65075
65085
  var minIndex = 0;
65076
65086
  var i_1 = 0;
65077
- var _loop_28 = function (c) {
65087
+ var _loop_27 = function (c) {
65078
65088
  var chain_2 = function () { return ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Overload_0_of_1_2_gave_the_following_error, i_1 + 1, candidates.length, signatureToString(c)); };
65079
65089
  var diags_2 = getSignatureApplicabilityError(node, args, c, assignableRelation, 0, true, chain_2);
65080
65090
  if (diags_2) {
@@ -65092,7 +65102,7 @@ var ts;
65092
65102
  };
65093
65103
  for (var _a = 0, candidatesForArgumentError_1 = candidatesForArgumentError; _a < candidatesForArgumentError_1.length; _a++) {
65094
65104
  var c = candidatesForArgumentError_1[_a];
65095
- _loop_28(c);
65105
+ _loop_27(c);
65096
65106
  }
65097
65107
  var diags_3 = max > 1 ? allDiagnostics[minIndex] : ts.flatten(allDiagnostics);
65098
65108
  ts.Debug.assert(diags_3.length > 0, "No errors reported for 3 or fewer overload signatures");
@@ -65235,7 +65245,7 @@ var ts;
65235
65245
  }
65236
65246
  var _a = ts.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a.min, maxNonRestParam = _a.max;
65237
65247
  var parameters = [];
65238
- var _loop_29 = function (i) {
65248
+ var _loop_28 = function (i) {
65239
65249
  var symbols = ts.mapDefined(candidates, function (s) { return signatureHasRestParameter(s) ?
65240
65250
  i < s.parameters.length - 1 ? s.parameters[i] : ts.last(s.parameters) :
65241
65251
  i < s.parameters.length ? s.parameters[i] : undefined; });
@@ -65243,7 +65253,7 @@ var ts;
65243
65253
  parameters.push(createCombinedSymbolFromTypes(symbols, ts.mapDefined(candidates, function (candidate) { return tryGetTypeAtPosition(candidate, i); })));
65244
65254
  };
65245
65255
  for (var i = 0; i < maxNonRestParam; i++) {
65246
- _loop_29(i);
65256
+ _loop_28(i);
65247
65257
  }
65248
65258
  var restParameterSymbols = ts.mapDefined(candidates, function (c) { return signatureHasRestParameter(c) ? ts.last(c.parameters) : undefined; });
65249
65259
  var flags = 0;
@@ -66703,7 +66713,17 @@ var ts;
66703
66713
  }
66704
66714
  function isExhaustiveSwitchStatement(node) {
66705
66715
  var links = getNodeLinks(node);
66706
- return links.isExhaustive !== undefined ? links.isExhaustive : (links.isExhaustive = computeExhaustiveSwitchStatement(node));
66716
+ if (links.isExhaustive === undefined) {
66717
+ links.isExhaustive = 0;
66718
+ var exhaustive = computeExhaustiveSwitchStatement(node);
66719
+ if (links.isExhaustive === 0) {
66720
+ links.isExhaustive = exhaustive;
66721
+ }
66722
+ }
66723
+ else if (links.isExhaustive === 0) {
66724
+ links.isExhaustive = false;
66725
+ }
66726
+ return links.isExhaustive;
66707
66727
  }
66708
66728
  function computeExhaustiveSwitchStatement(node) {
66709
66729
  if (node.expression.kind === 218) {
@@ -66711,14 +66731,14 @@ var ts;
66711
66731
  if (!witnesses) {
66712
66732
  return false;
66713
66733
  }
66714
- var operandConstraint = getBaseConstraintOrType(getTypeOfExpression(node.expression.expression));
66734
+ var operandConstraint = getBaseConstraintOrType(checkExpressionCached(node.expression.expression));
66715
66735
  var notEqualFacts_2 = getNotEqualFactsFromTypeofSwitch(0, 0, witnesses);
66716
66736
  if (operandConstraint.flags & 3) {
66717
66737
  return (556800 & notEqualFacts_2) === 556800;
66718
66738
  }
66719
66739
  return !someType(operandConstraint, function (t) { return (getTypeFacts(t) & notEqualFacts_2) === notEqualFacts_2; });
66720
66740
  }
66721
- var type = getTypeOfExpression(node.expression);
66741
+ var type = checkExpressionCached(node.expression);
66722
66742
  if (!isLiteralType(type)) {
66723
66743
  return false;
66724
66744
  }
@@ -68863,7 +68883,7 @@ var ts;
68863
68883
  var indexSymbol = getIndexSymbol(getSymbolOfNode(node));
68864
68884
  if (indexSymbol === null || indexSymbol === void 0 ? void 0 : indexSymbol.declarations) {
68865
68885
  var indexSignatureMap_1 = new ts.Map();
68866
- var _loop_30 = function (declaration) {
68886
+ var _loop_29 = function (declaration) {
68867
68887
  if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
68868
68888
  forEachType(getTypeFromTypeNode(declaration.parameters[0].type), function (type) {
68869
68889
  var entry = indexSignatureMap_1.get(getTypeId(type));
@@ -68878,7 +68898,7 @@ var ts;
68878
68898
  };
68879
68899
  for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
68880
68900
  var declaration = _a[_i];
68881
- _loop_30(declaration);
68901
+ _loop_29(declaration);
68882
68902
  }
68883
68903
  indexSignatureMap_1.forEach(function (entry) {
68884
68904
  if (entry.declarations.length > 1) {
@@ -69124,7 +69144,7 @@ var ts;
69124
69144
  }
69125
69145
  var symbol = getNodeLinks(node).resolvedSymbol;
69126
69146
  if (symbol) {
69127
- if (ts.some(symbol.declarations, function (d) { return isTypeDeclaration(d) && !!(d.flags & 268435456); })) {
69147
+ if (ts.some(symbol.declarations, function (d) { return ts.isTypeDeclaration(d) && !!(d.flags & 268435456); })) {
69128
69148
  addDeprecatedSuggestion(getDeprecatedSuggestionNode(node), symbol.declarations, symbol.escapedName);
69129
69149
  }
69130
69150
  if (type.flags & 32 && symbol.flags & 8) {
@@ -70245,7 +70265,7 @@ var ts;
70245
70265
  }
70246
70266
  function errorUnusedLocal(declaration, name, addDiagnostic) {
70247
70267
  var node = ts.getNameOfDeclaration(declaration) || declaration;
70248
- var message = isTypeDeclaration(declaration) ? ts.Diagnostics._0_is_declared_but_never_used : ts.Diagnostics._0_is_declared_but_its_value_is_never_read;
70268
+ var message = ts.isTypeDeclaration(declaration) ? ts.Diagnostics._0_is_declared_but_never_used : ts.Diagnostics._0_is_declared_but_its_value_is_never_read;
70249
70269
  addDiagnostic(declaration, 0, ts.createDiagnosticForNode(node, message, name));
70250
70270
  }
70251
70271
  function isIdentifierThatStartsWithUnderscore(node) {
@@ -71824,7 +71844,7 @@ var ts;
71824
71844
  var propDeclaration = declaration && declaration.kind === 223 ||
71825
71845
  name && name.kind === 164 ? declaration : undefined;
71826
71846
  var localPropDeclaration = getParentOfSymbol(prop) === type.symbol ? declaration : undefined;
71827
- var _loop_31 = function (info) {
71847
+ var _loop_30 = function (info) {
71828
71848
  var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
71829
71849
  var errorNode = localPropDeclaration || localIndexDeclaration ||
71830
71850
  (interfaceDeclaration && !ts.some(getBaseTypes(type), function (base) { return !!getPropertyOfObjectType(base, prop.escapedName) && !!getIndexTypeOfType(base, info.keyType); }) ? interfaceDeclaration : undefined);
@@ -71838,7 +71858,7 @@ var ts;
71838
71858
  };
71839
71859
  for (var _i = 0, indexInfos_9 = indexInfos; _i < indexInfos_9.length; _i++) {
71840
71860
  var info = indexInfos_9[_i];
71841
- _loop_31(info);
71861
+ _loop_30(info);
71842
71862
  }
71843
71863
  }
71844
71864
  function checkIndexConstraintForIndexSignature(type, checkInfo) {
@@ -71846,7 +71866,7 @@ var ts;
71846
71866
  var indexInfos = getApplicableIndexInfos(type, checkInfo.keyType);
71847
71867
  var interfaceDeclaration = ts.getObjectFlags(type) & 2 ? ts.getDeclarationOfKind(type.symbol, 261) : undefined;
71848
71868
  var localCheckDeclaration = declaration && getParentOfSymbol(getSymbolOfNode(declaration)) === type.symbol ? declaration : undefined;
71849
- var _loop_32 = function (info) {
71869
+ var _loop_31 = function (info) {
71850
71870
  if (info === checkInfo)
71851
71871
  return "continue";
71852
71872
  var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
@@ -71858,7 +71878,7 @@ var ts;
71858
71878
  };
71859
71879
  for (var _i = 0, indexInfos_10 = indexInfos; _i < indexInfos_10.length; _i++) {
71860
71880
  var info = indexInfos_10[_i];
71861
- _loop_32(info);
71881
+ _loop_31(info);
71862
71882
  }
71863
71883
  }
71864
71884
  function checkTypeNameIsReserved(name, message) {
@@ -71908,7 +71928,7 @@ var ts;
71908
71928
  }
71909
71929
  else {
71910
71930
  ts.forEach(jsdocParameters, function (_a, index) {
71911
- var name = _a.name;
71931
+ var name = _a.name, isNameFirst = _a.isNameFirst;
71912
71932
  if (excludedParameters.has(index) || ts.isIdentifier(name) && parameters.has(name.escapedText)) {
71913
71933
  return;
71914
71934
  }
@@ -71918,7 +71938,9 @@ var ts;
71918
71938
  }
71919
71939
  }
71920
71940
  else {
71921
- errorOrSuggestion(isJs, name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(name));
71941
+ if (!isNameFirst) {
71942
+ errorOrSuggestion(isJs, name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(name));
71943
+ }
71922
71944
  }
71923
71945
  });
71924
71946
  }
@@ -72153,7 +72175,7 @@ var ts;
72153
72175
  var baseTypes = baseTypeNode && getBaseTypes(type);
72154
72176
  var baseWithThis = (baseTypes === null || baseTypes === void 0 ? void 0 : baseTypes.length) ? getTypeWithThisArgument(ts.first(baseTypes), type.thisType) : undefined;
72155
72177
  var baseStaticType = getBaseConstructorTypeOfClass(type);
72156
- var _loop_33 = function (member) {
72178
+ var _loop_32 = function (member) {
72157
72179
  if (ts.hasAmbientModifier(member)) {
72158
72180
  return "continue";
72159
72181
  }
@@ -72168,7 +72190,7 @@ var ts;
72168
72190
  };
72169
72191
  for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
72170
72192
  var member = _a[_i];
72171
- _loop_33(member);
72193
+ _loop_32(member);
72172
72194
  }
72173
72195
  }
72174
72196
  function checkExistingMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, member, memberIsParameterProperty, reportErrors) {
@@ -72243,7 +72265,7 @@ var ts;
72243
72265
  }
72244
72266
  function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) {
72245
72267
  var issuedMemberError = false;
72246
- var _loop_34 = function (member) {
72268
+ var _loop_33 = function (member) {
72247
72269
  if (ts.isStatic(member)) {
72248
72270
  return "continue";
72249
72271
  }
@@ -72261,7 +72283,7 @@ var ts;
72261
72283
  };
72262
72284
  for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
72263
72285
  var member = _a[_i];
72264
- _loop_34(member);
72286
+ _loop_33(member);
72265
72287
  }
72266
72288
  if (!issuedMemberError) {
72267
72289
  checkTypeAssignableTo(typeWithThis, baseWithThis, node.name || node, broadDiag);
@@ -72308,7 +72330,7 @@ var ts;
72308
72330
  function checkKindsOfPropertyMemberOverrides(type, baseType) {
72309
72331
  var _a, _b, _c, _d;
72310
72332
  var baseProperties = getPropertiesOfType(baseType);
72311
- var _loop_35 = function (baseProperty) {
72333
+ var _loop_34 = function (baseProperty) {
72312
72334
  var base = getTargetSymbol(baseProperty);
72313
72335
  if (base.flags & 4194304) {
72314
72336
  return "continue";
@@ -72406,8 +72428,8 @@ var ts;
72406
72428
  };
72407
72429
  basePropertyCheck: for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) {
72408
72430
  var baseProperty = baseProperties_1[_i];
72409
- var state_11 = _loop_35(baseProperty);
72410
- switch (state_11) {
72431
+ var state_10 = _loop_34(baseProperty);
72432
+ switch (state_10) {
72411
72433
  case "continue-basePropertyCheck": continue basePropertyCheck;
72412
72434
  }
72413
72435
  }
@@ -73965,29 +73987,9 @@ var ts;
73965
73987
  }
73966
73988
  function isTypeDeclarationName(name) {
73967
73989
  return name.kind === 79 &&
73968
- isTypeDeclaration(name.parent) &&
73990
+ ts.isTypeDeclaration(name.parent) &&
73969
73991
  ts.getNameOfDeclaration(name.parent) === name;
73970
73992
  }
73971
- function isTypeDeclaration(node) {
73972
- switch (node.kind) {
73973
- case 165:
73974
- case 260:
73975
- case 261:
73976
- case 262:
73977
- case 263:
73978
- case 348:
73979
- case 341:
73980
- case 342:
73981
- return true;
73982
- case 270:
73983
- return node.isTypeOnly;
73984
- case 273:
73985
- case 278:
73986
- return node.parent.parent.isTypeOnly;
73987
- default:
73988
- return false;
73989
- }
73990
- }
73991
73993
  function isTypeReferenceIdentifier(node) {
73992
73994
  while (node.parent.kind === 163) {
73993
73995
  node = node.parent;
@@ -74382,7 +74384,7 @@ var ts;
74382
74384
  var baseType = ts.firstOrUndefined(getBaseTypes(classType));
74383
74385
  return baseType ? getTypeWithThisArgument(baseType, classType.thisType) : errorType;
74384
74386
  }
74385
- if (isTypeDeclaration(node)) {
74387
+ if (ts.isTypeDeclaration(node)) {
74386
74388
  var symbol = getSymbolOfNode(node);
74387
74389
  return getDeclaredTypeOfSymbol(symbol);
74388
74390
  }
@@ -103776,7 +103778,7 @@ var ts;
103776
103778
  importedFileFromNodeModules = importedFileFromNodeModules || isInNodeModules;
103777
103779
  });
103778
103780
  var sortedPaths = [];
103779
- var _loop_36 = function (directory) {
103781
+ var _loop_35 = function (directory) {
103780
103782
  var directoryStart = ts.ensureTrailingDirectorySeparator(directory);
103781
103783
  var pathsInDirectory;
103782
103784
  allFileNames.forEach(function (_a, fileName) {
@@ -103800,9 +103802,9 @@ var ts;
103800
103802
  };
103801
103803
  var out_directory_1;
103802
103804
  for (var directory = ts.getDirectoryPath(importingFileName); allFileNames.size !== 0;) {
103803
- var state_12 = _loop_36(directory);
103805
+ var state_11 = _loop_35(directory);
103804
103806
  directory = out_directory_1;
103805
- if (state_12 === "break")
103807
+ if (state_11 === "break")
103806
103808
  break;
103807
103809
  }
103808
103810
  if (allFileNames.size) {
@@ -103861,7 +103863,7 @@ var ts;
103861
103863
  }
103862
103864
  function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, host, compilerOptions) {
103863
103865
  for (var key in paths) {
103864
- var _loop_37 = function (patternText_1) {
103866
+ var _loop_36 = function (patternText_1) {
103865
103867
  var pattern = ts.normalizePath(patternText_1);
103866
103868
  var indexOfStar = pattern.indexOf("*");
103867
103869
  var candidates = allowedEndings.map(function (ending) { return ({
@@ -103892,9 +103894,9 @@ var ts;
103892
103894
  };
103893
103895
  for (var _i = 0, _a = paths[key]; _i < _a.length; _i++) {
103894
103896
  var patternText_1 = _a[_i];
103895
- var state_13 = _loop_37(patternText_1);
103896
- if (typeof state_13 === "object")
103897
- return state_13.value;
103897
+ var state_12 = _loop_36(patternText_1);
103898
+ if (typeof state_12 === "object")
103899
+ return state_12.value;
103898
103900
  }
103899
103901
  }
103900
103902
  function validateEnding(_a) {