@typescript-deploys/pr-build 4.6.0-pr-47000-3 → 4.6.0-pr-47126-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tsc.js CHANGED
@@ -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.6";
72
- ts.version = ts.versionMajorMinor + ".0-insiders.20211206";
72
+ ts.version = ts.versionMajorMinor + ".0-insiders.20220107";
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  function tryGetNativeMap() {
@@ -6103,6 +6103,7 @@ var ts;
6103
6103
  DIRECTORY: diag(6038, ts.DiagnosticCategory.Message, "DIRECTORY_6038", "DIRECTORY"),
6104
6104
  STRATEGY: diag(6039, ts.DiagnosticCategory.Message, "STRATEGY_6039", "STRATEGY"),
6105
6105
  FILE_OR_DIRECTORY: diag(6040, ts.DiagnosticCategory.Message, "FILE_OR_DIRECTORY_6040", "FILE OR DIRECTORY"),
6106
+ Errors_Files: diag(6041, ts.DiagnosticCategory.Message, "Errors_Files_6041", "Errors Files"),
6106
6107
  Generates_corresponding_map_file: diag(6043, ts.DiagnosticCategory.Message, "Generates_corresponding_map_file_6043", "Generates corresponding '.map' file."),
6107
6108
  Compiler_option_0_expects_an_argument: diag(6044, ts.DiagnosticCategory.Error, "Compiler_option_0_expects_an_argument_6044", "Compiler option '{0}' expects an argument."),
6108
6109
  Unterminated_quoted_string_in_response_file_0: diag(6045, ts.DiagnosticCategory.Error, "Unterminated_quoted_string_in_response_file_0_6045", "Unterminated quoted string in response file '{0}'."),
@@ -6296,6 +6297,9 @@ var ts;
6296
6297
  Output_Formatting: diag(6256, ts.DiagnosticCategory.Message, "Output_Formatting_6256", "Output Formatting"),
6297
6298
  Completeness: diag(6257, ts.DiagnosticCategory.Message, "Completeness_6257", "Completeness"),
6298
6299
  _0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file: diag(6258, ts.DiagnosticCategory.Error, "_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258", "'{0}' should be set inside the 'compilerOptions' object of the config json file"),
6300
+ Found_1_error_in_1: diag(6259, ts.DiagnosticCategory.Message, "Found_1_error_in_1_6259", "Found 1 error in {1}"),
6301
+ Found_0_errors_in_1_file: diag(6260, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_file_6260", "Found {0} errors in 1 file."),
6302
+ Found_0_errors_in_1_files: diag(6261, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_files_6261", "Found {0} errors in {1} files."),
6299
6303
  Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve: diag(6270, ts.DiagnosticCategory.Message, "Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270", "Directory '{0}' has no containing package.json scope. Imports will not resolve."),
6300
6304
  Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6271, ts.DiagnosticCategory.Message, "Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271", "Import specifier '{0}' does not exist in package.json scope at path '{1}'."),
6301
6305
  Invalid_import_specifier_0_has_no_possible_resolutions: diag(6272, ts.DiagnosticCategory.Message, "Invalid_import_specifier_0_has_no_possible_resolutions_6272", "Invalid import specifier '{0}' has no possible resolutions."),
@@ -15604,7 +15608,7 @@ var ts;
15604
15608
  }
15605
15609
  ts.getAllowJSCompilerOption = getAllowJSCompilerOption;
15606
15610
  function getUseDefineForClassFields(compilerOptions) {
15607
- return compilerOptions.useDefineForClassFields === undefined ? getEmitScriptTarget(compilerOptions) === 99 : compilerOptions.useDefineForClassFields;
15611
+ return compilerOptions.useDefineForClassFields === undefined ? getEmitScriptTarget(compilerOptions) >= 9 : compilerOptions.useDefineForClassFields;
15608
15612
  }
15609
15613
  ts.getUseDefineForClassFields = getUseDefineForClassFields;
15610
15614
  function compilerOptionsAffectSemanticDiagnostics(newOptions, oldOptions) {
@@ -17781,7 +17785,7 @@ var ts;
17781
17785
  result.push(createModifier(144));
17782
17786
  if (flags & 256)
17783
17787
  result.push(createModifier(131));
17784
- return result;
17788
+ return result.length ? result : undefined;
17785
17789
  }
17786
17790
  function createQualifiedName(left, right) {
17787
17791
  var node = createBaseNode(160);
@@ -19674,7 +19678,7 @@ var ts;
19674
19678
  }
19675
19679
  function createAssertClause(elements, multiLine) {
19676
19680
  var node = createBaseNode(292);
19677
- node.elements = elements;
19681
+ node.elements = createNodeArray(elements);
19678
19682
  node.multiLine = multiLine;
19679
19683
  node.transformFlags |= 4;
19680
19684
  return node;
@@ -21032,32 +21036,36 @@ var ts;
21032
21036
  }
21033
21037
  function updateModifiers(node, modifiers) {
21034
21038
  var _a;
21039
+ var modifierArray;
21035
21040
  if (typeof modifiers === "number") {
21036
- modifiers = createModifiersFromModifierFlags(modifiers);
21037
- }
21038
- return ts.isParameter(node) ? updateParameterDeclaration(node, node.decorators, modifiers, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) :
21039
- ts.isPropertySignature(node) ? updatePropertySignature(node, modifiers, node.name, node.questionToken, node.type) :
21040
- ts.isPropertyDeclaration(node) ? updatePropertyDeclaration(node, node.decorators, modifiers, node.name, (_a = node.questionToken) !== null && _a !== void 0 ? _a : node.exclamationToken, node.type, node.initializer) :
21041
- ts.isMethodSignature(node) ? updateMethodSignature(node, modifiers, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) :
21042
- ts.isMethodDeclaration(node) ? updateMethodDeclaration(node, node.decorators, modifiers, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) :
21043
- ts.isConstructorDeclaration(node) ? updateConstructorDeclaration(node, node.decorators, modifiers, node.parameters, node.body) :
21044
- ts.isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, node.decorators, modifiers, node.name, node.parameters, node.type, node.body) :
21045
- ts.isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, node.decorators, modifiers, node.name, node.parameters, node.body) :
21046
- ts.isIndexSignatureDeclaration(node) ? updateIndexSignature(node, node.decorators, modifiers, node.parameters, node.type) :
21047
- ts.isFunctionExpression(node) ? updateFunctionExpression(node, modifiers, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) :
21048
- ts.isArrowFunction(node) ? updateArrowFunction(node, modifiers, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) :
21049
- ts.isClassExpression(node) ? updateClassExpression(node, node.decorators, modifiers, node.name, node.typeParameters, node.heritageClauses, node.members) :
21050
- ts.isVariableStatement(node) ? updateVariableStatement(node, modifiers, node.declarationList) :
21051
- ts.isFunctionDeclaration(node) ? updateFunctionDeclaration(node, node.decorators, modifiers, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) :
21052
- ts.isClassDeclaration(node) ? updateClassDeclaration(node, node.decorators, modifiers, node.name, node.typeParameters, node.heritageClauses, node.members) :
21053
- ts.isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, node.decorators, modifiers, node.name, node.typeParameters, node.heritageClauses, node.members) :
21054
- ts.isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, node.decorators, modifiers, node.name, node.typeParameters, node.type) :
21055
- ts.isEnumDeclaration(node) ? updateEnumDeclaration(node, node.decorators, modifiers, node.name, node.members) :
21056
- ts.isModuleDeclaration(node) ? updateModuleDeclaration(node, node.decorators, modifiers, node.name, node.body) :
21057
- ts.isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, node.decorators, modifiers, node.isTypeOnly, node.name, node.moduleReference) :
21058
- ts.isImportDeclaration(node) ? updateImportDeclaration(node, node.decorators, modifiers, node.importClause, node.moduleSpecifier, node.assertClause) :
21059
- ts.isExportAssignment(node) ? updateExportAssignment(node, node.decorators, modifiers, node.expression) :
21060
- ts.isExportDeclaration(node) ? updateExportDeclaration(node, node.decorators, modifiers, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) :
21041
+ modifierArray = createModifiersFromModifierFlags(modifiers);
21042
+ }
21043
+ else {
21044
+ modifierArray = modifiers;
21045
+ }
21046
+ return ts.isParameter(node) ? updateParameterDeclaration(node, node.decorators, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) :
21047
+ ts.isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) :
21048
+ ts.isPropertyDeclaration(node) ? updatePropertyDeclaration(node, node.decorators, modifierArray, node.name, (_a = node.questionToken) !== null && _a !== void 0 ? _a : node.exclamationToken, node.type, node.initializer) :
21049
+ ts.isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) :
21050
+ ts.isMethodDeclaration(node) ? updateMethodDeclaration(node, node.decorators, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) :
21051
+ ts.isConstructorDeclaration(node) ? updateConstructorDeclaration(node, node.decorators, modifierArray, node.parameters, node.body) :
21052
+ ts.isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, node.decorators, modifierArray, node.name, node.parameters, node.type, node.body) :
21053
+ ts.isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, node.decorators, modifierArray, node.name, node.parameters, node.body) :
21054
+ ts.isIndexSignatureDeclaration(node) ? updateIndexSignature(node, node.decorators, modifierArray, node.parameters, node.type) :
21055
+ ts.isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) :
21056
+ ts.isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) :
21057
+ ts.isClassExpression(node) ? updateClassExpression(node, node.decorators, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) :
21058
+ ts.isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) :
21059
+ ts.isFunctionDeclaration(node) ? updateFunctionDeclaration(node, node.decorators, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) :
21060
+ ts.isClassDeclaration(node) ? updateClassDeclaration(node, node.decorators, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) :
21061
+ ts.isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, node.decorators, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) :
21062
+ ts.isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, node.decorators, modifierArray, node.name, node.typeParameters, node.type) :
21063
+ ts.isEnumDeclaration(node) ? updateEnumDeclaration(node, node.decorators, modifierArray, node.name, node.members) :
21064
+ ts.isModuleDeclaration(node) ? updateModuleDeclaration(node, node.decorators, modifierArray, node.name, node.body) :
21065
+ ts.isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, node.decorators, modifierArray, node.isTypeOnly, node.name, node.moduleReference) :
21066
+ ts.isImportDeclaration(node) ? updateImportDeclaration(node, node.decorators, modifierArray, node.importClause, node.moduleSpecifier, node.assertClause) :
21067
+ ts.isExportAssignment(node) ? updateExportAssignment(node, node.decorators, modifierArray, node.expression) :
21068
+ ts.isExportDeclaration(node) ? updateExportDeclaration(node, node.decorators, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) :
21061
21069
  ts.Debug.assertNever(node);
21062
21070
  }
21063
21071
  function asNodeArray(array) {
@@ -27012,7 +27020,7 @@ var ts;
27012
27020
  return true;
27013
27021
  }
27014
27022
  }
27015
- else if (third === 27) {
27023
+ else if (third === 27 || third === 63) {
27016
27024
  return true;
27017
27025
  }
27018
27026
  return false;
@@ -27083,7 +27091,11 @@ var ts;
27083
27091
  if (type && !allowAmbiguity && typeHasArrowFunctionBlockingParseError(type)) {
27084
27092
  return undefined;
27085
27093
  }
27086
- var hasJSDocFunctionType = type && (ts.isJSDocFunctionType(type) || ts.isParenthesizedTypeNode(type) && ts.isJSDocFunctionType(type.type));
27094
+ var unwrappedType = type;
27095
+ while ((unwrappedType === null || unwrappedType === void 0 ? void 0 : unwrappedType.kind) === 190) {
27096
+ unwrappedType = unwrappedType.type;
27097
+ }
27098
+ var hasJSDocFunctionType = unwrappedType && ts.isJSDocFunctionType(unwrappedType);
27087
27099
  if (!allowAmbiguity && token() !== 38 && (hasJSDocFunctionType || token() !== 18)) {
27088
27100
  return undefined;
27089
27101
  }
@@ -44576,7 +44588,24 @@ var ts;
44576
44588
  return mapType(source, function (t) { return getRestType(t, properties, symbol); });
44577
44589
  }
44578
44590
  var omitKeyType = getUnionType(ts.map(properties, getLiteralTypeFromPropertyName));
44591
+ var spreadableProperties = [];
44592
+ var unspreadableToRestKeys = [];
44593
+ for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) {
44594
+ var prop = _a[_i];
44595
+ var literalTypeFromProperty = getLiteralTypeFromProperty(prop, 8576);
44596
+ if (!isTypeAssignableTo(literalTypeFromProperty, omitKeyType)
44597
+ && !(ts.getDeclarationModifierFlagsFromSymbol(prop) & (8 | 16))
44598
+ && isSpreadableProperty(prop)) {
44599
+ spreadableProperties.push(prop);
44600
+ }
44601
+ else {
44602
+ unspreadableToRestKeys.push(literalTypeFromProperty);
44603
+ }
44604
+ }
44579
44605
  if (isGenericObjectType(source) || isGenericIndexType(omitKeyType)) {
44606
+ if (unspreadableToRestKeys.length) {
44607
+ omitKeyType = getUnionType(__spreadArray([omitKeyType], unspreadableToRestKeys, true));
44608
+ }
44580
44609
  if (omitKeyType.flags & 131072) {
44581
44610
  return source;
44582
44611
  }
@@ -44587,13 +44616,9 @@ var ts;
44587
44616
  return getTypeAliasInstantiation(omitTypeAlias, [source, omitKeyType]);
44588
44617
  }
44589
44618
  var members = ts.createSymbolTable();
44590
- for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) {
44591
- var prop = _a[_i];
44592
- if (!isTypeAssignableTo(getLiteralTypeFromProperty(prop, 8576), omitKeyType)
44593
- && !(ts.getDeclarationModifierFlagsFromSymbol(prop) & (8 | 16))
44594
- && isSpreadableProperty(prop)) {
44595
- members.set(prop.escapedName, getSpreadSymbol(prop, false));
44596
- }
44619
+ for (var _b = 0, spreadableProperties_1 = spreadableProperties; _b < spreadableProperties_1.length; _b++) {
44620
+ var prop = spreadableProperties_1[_b];
44621
+ members.set(prop.escapedName, getSpreadSymbol(prop, false));
44597
44622
  }
44598
44623
  var result = createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, getIndexInfosOfType(source));
44599
44624
  result.objectFlags |= 8388608;
@@ -45748,7 +45773,8 @@ var ts;
45748
45773
  return false;
45749
45774
  }
45750
45775
  function getBaseTypeNodeOfClass(type) {
45751
- return ts.getEffectiveBaseTypeNode(type.symbol.valueDeclaration);
45776
+ var decl = ts.getClassLikeDeclarationOfSymbol(type.symbol);
45777
+ return decl && ts.getEffectiveBaseTypeNode(decl);
45752
45778
  }
45753
45779
  function getConstructorsForTypeArguments(type, typeArgumentNodes, location) {
45754
45780
  var typeArgCount = ts.length(typeArgumentNodes);
@@ -45762,8 +45788,8 @@ var ts;
45762
45788
  }
45763
45789
  function getBaseConstructorTypeOfClass(type) {
45764
45790
  if (!type.resolvedBaseConstructorType) {
45765
- var decl = type.symbol.valueDeclaration;
45766
- var extended = ts.getEffectiveBaseTypeNode(decl);
45791
+ var decl = ts.getClassLikeDeclarationOfSymbol(type.symbol);
45792
+ var extended = decl && ts.getEffectiveBaseTypeNode(decl);
45767
45793
  var baseTypeNode = getBaseTypeNodeOfClass(type);
45768
45794
  if (!baseTypeNode) {
45769
45795
  return type.resolvedBaseConstructorType = undefinedType;
@@ -47497,8 +47523,14 @@ var ts;
47497
47523
  }
47498
47524
  return type;
47499
47525
  }
47526
+ function isMappedTypeGenericIndexedAccess(type) {
47527
+ return type.flags & 8388608 && ts.getObjectFlags(type.objectType) & 32 &&
47528
+ !isGenericMappedType(type.objectType) && isGenericIndexType(type.indexType);
47529
+ }
47500
47530
  function getApparentType(type) {
47501
- var t = type.flags & 465829888 ? getBaseConstraintOfType(type) || unknownType : type;
47531
+ var t = !(type.flags & 465829888) ? type :
47532
+ isMappedTypeGenericIndexedAccess(type) ? substituteIndexedMappedType(type.objectType, type.indexType) :
47533
+ getBaseConstraintOfType(type) || unknownType;
47502
47534
  return ts.getObjectFlags(t) & 32 ? getApparentTypeOfMappedType(t) :
47503
47535
  t.flags & 2097152 ? getApparentTypeOfIntersectionType(t) :
47504
47536
  t.flags & 402653316 ? globalStringType :
@@ -48031,6 +48063,8 @@ var ts;
48031
48063
  case 205:
48032
48064
  case 206:
48033
48065
  return traverse(node.expression);
48066
+ case 294:
48067
+ return traverse(node.initializer);
48034
48068
  default:
48035
48069
  return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && !!ts.forEachChild(node, traverse);
48036
48070
  }
@@ -54755,7 +54789,7 @@ var ts;
54755
54789
  return result;
54756
54790
  }
54757
54791
  function getFalsyFlags(type) {
54758
- return type.flags & 3145728 ? getFalsyFlagsOfTypes(type.types) :
54792
+ return type.flags & 1048576 ? getFalsyFlagsOfTypes(type.types) :
54759
54793
  type.flags & 128 ? type.value === "" ? 128 : 0 :
54760
54794
  type.flags & 256 ? type.value === 0 ? 256 : 0 :
54761
54795
  type.flags & 2048 ? isZeroBigInt(type) ? 2048 : 0 :
@@ -55533,12 +55567,14 @@ var ts;
55533
55567
  target = getActualTypeVariable(target);
55534
55568
  }
55535
55569
  if (target.flags & 8650752) {
55536
- if (ts.getObjectFlags(source) & 524288 || source === nonInferrableAnyType || source === silentNeverType ||
55537
- (priority & 128 && (source === autoType || source === autoArrayType)) || isFromInferenceBlockedSource(source)) {
55570
+ if (source === nonInferrableAnyType || source === silentNeverType || (priority & 128 && (source === autoType || source === autoArrayType)) || isFromInferenceBlockedSource(source)) {
55538
55571
  return;
55539
55572
  }
55540
55573
  var inference = getInferenceInfoForType(target);
55541
55574
  if (inference) {
55575
+ if (ts.getObjectFlags(source) & 524288) {
55576
+ return;
55577
+ }
55542
55578
  if (!inference.isFixed) {
55543
55579
  if (inference.priority === undefined || priority < inference.priority) {
55544
55580
  inference.candidates = undefined;
@@ -55567,18 +55603,16 @@ var ts;
55567
55603
  inferencePriority = Math.min(inferencePriority, priority);
55568
55604
  return;
55569
55605
  }
55570
- else {
55571
- var simplified = getSimplifiedType(target, false);
55572
- if (simplified !== target) {
55573
- invokeOnce(source, simplified, inferFromTypes);
55574
- }
55575
- else if (target.flags & 8388608) {
55576
- var indexType = getSimplifiedType(target.indexType, false);
55577
- if (indexType.flags & 465829888) {
55578
- var simplified_1 = distributeIndexOverObjectType(getSimplifiedType(target.objectType, false), indexType, false);
55579
- if (simplified_1 && simplified_1 !== target) {
55580
- invokeOnce(source, simplified_1, inferFromTypes);
55581
- }
55606
+ var simplified = getSimplifiedType(target, false);
55607
+ if (simplified !== target) {
55608
+ inferFromTypes(source, simplified);
55609
+ }
55610
+ else if (target.flags & 8388608) {
55611
+ var indexType = getSimplifiedType(target.indexType, false);
55612
+ if (indexType.flags & 465829888) {
55613
+ var simplified_1 = distributeIndexOverObjectType(getSimplifiedType(target.objectType, false), indexType, false);
55614
+ if (simplified_1 && simplified_1 !== target) {
55615
+ inferFromTypes(source, simplified_1);
55582
55616
  }
55583
55617
  }
55584
55618
  }
@@ -56239,7 +56273,8 @@ var ts;
56239
56273
  return access.kind === 205 ? access.name.escapedText :
56240
56274
  access.kind === 206 && ts.isStringOrNumericLiteralLike(access.argumentExpression) ? ts.escapeLeadingUnderscores(access.argumentExpression.text) :
56241
56275
  access.kind === 202 && (propertyName = getDestructuringPropertyName(access)) ? ts.escapeLeadingUnderscores(propertyName) :
56242
- undefined;
56276
+ access.kind === 163 ? ("" + access.parent.parameters.indexOf(access)) :
56277
+ undefined;
56243
56278
  }
56244
56279
  function containsMatchingReference(source, target) {
56245
56280
  while (ts.isAccessExpression(source)) {
@@ -57440,11 +57475,11 @@ var ts;
57440
57475
  return result;
57441
57476
  }
57442
57477
  function getCandidateDiscriminantPropertyAccess(expr) {
57443
- if (ts.isBindingPattern(reference)) {
57478
+ if (ts.isBindingPattern(reference) || ts.isFunctionExpressionOrArrowFunction(reference)) {
57444
57479
  if (ts.isIdentifier(expr)) {
57445
57480
  var symbol = getResolvedSymbol(expr);
57446
57481
  var declaration = symbol.valueDeclaration;
57447
- if (declaration && ts.isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && reference === declaration.parent) {
57482
+ if (declaration && (ts.isBindingElement(declaration) || ts.isParameter(declaration)) && reference === declaration.parent && !declaration.initializer && !declaration.dotDotDotToken) {
57448
57483
  return declaration;
57449
57484
  }
57450
57485
  }
@@ -58095,7 +58130,7 @@ var ts;
58095
58130
  var substituteConstraints = !(checkMode && checkMode & 2) &&
58096
58131
  someType(type, isGenericTypeWithUnionConstraint) &&
58097
58132
  (isConstraintPosition(type, reference) || hasNonBindingPatternContextualTypeWithNoGenericTypes(reference));
58098
- return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 ? getBaseConstraintOrType(t) : t; }) : type;
58133
+ return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 && !isMappedTypeGenericIndexedAccess(t) ? getBaseConstraintOrType(t) : t; }) : type;
58099
58134
  }
58100
58135
  function isExportOrExportExpression(location) {
58101
58136
  return !!ts.findAncestor(location, function (n) {
@@ -58129,18 +58164,34 @@ var ts;
58129
58164
  }
58130
58165
  function getNarrowedTypeOfSymbol(symbol, location) {
58131
58166
  var declaration = symbol.valueDeclaration;
58132
- if (declaration && ts.isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) {
58133
- var parent = declaration.parent.parent;
58134
- if (parent.kind === 253 && ts.getCombinedNodeFlags(declaration) & 2 || parent.kind === 163) {
58135
- var links = getNodeLinks(location);
58136
- if (!(links.flags & 268435456)) {
58137
- links.flags |= 268435456;
58138
- var parentType = getTypeForBindingElementParent(parent);
58139
- links.flags &= ~268435456;
58140
- if (parentType && parentType.flags & 1048576 && !(parent.kind === 163 && isSymbolAssigned(symbol))) {
58141
- var pattern = declaration.parent;
58142
- var narrowedType = getFlowTypeOfReference(pattern, parentType, parentType, undefined, location.flowNode);
58143
- return getBindingElementTypeFromParentType(declaration, narrowedType);
58167
+ if (declaration) {
58168
+ if (ts.isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) {
58169
+ var parent = declaration.parent.parent;
58170
+ if (parent.kind === 253 && ts.getCombinedNodeFlags(declaration) & 2 || parent.kind === 163) {
58171
+ var links = getNodeLinks(location);
58172
+ if (!(links.flags & 268435456)) {
58173
+ links.flags |= 268435456;
58174
+ var parentType = getTypeForBindingElementParent(parent);
58175
+ links.flags &= ~268435456;
58176
+ if (parentType && parentType.flags & 1048576 && !(parent.kind === 163 && isSymbolAssigned(symbol))) {
58177
+ var pattern = declaration.parent;
58178
+ var narrowedType = getFlowTypeOfReference(pattern, parentType, parentType, undefined, location.flowNode);
58179
+ return getBindingElementTypeFromParentType(declaration, narrowedType);
58180
+ }
58181
+ }
58182
+ }
58183
+ }
58184
+ if (ts.isParameter(declaration) && !declaration.type && !declaration.initializer && !declaration.dotDotDotToken) {
58185
+ var func = declaration.parent;
58186
+ if (func.parameters.length >= 2 && isContextSensitiveFunctionOrObjectLiteralMethod(func)) {
58187
+ var contextualSignature = getContextualSignature(func);
58188
+ if (contextualSignature && contextualSignature.parameters.length === 1 && signatureHasRestParameter(contextualSignature)) {
58189
+ var restType = getTypeOfSymbol(contextualSignature.parameters[0]);
58190
+ if (restType.flags & 1048576 && everyType(restType, isTupleType) && !isSymbolAssigned(symbol)) {
58191
+ var narrowedType = getFlowTypeOfReference(func, restType, restType, undefined, location.flowNode);
58192
+ var index = func.parameters.indexOf(declaration) - (ts.getThisParameter(func) ? 1 : 0);
58193
+ return getIndexedAccessType(narrowedType, getNumberLiteralType(index));
58194
+ }
58144
58195
  }
58145
58196
  }
58146
58197
  }
@@ -60542,11 +60593,14 @@ var ts;
60542
60593
  if (!ts.getContainingClass(privId)) {
60543
60594
  return grammarErrorOnNode(privId, ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
60544
60595
  }
60545
- if (!ts.isExpressionNode(privId)) {
60546
- return grammarErrorOnNode(privId, ts.Diagnostics.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression);
60547
- }
60548
- if (!getSymbolForPrivateIdentifierExpression(privId)) {
60549
- return grammarErrorOnNode(privId, ts.Diagnostics.Cannot_find_name_0, ts.idText(privId));
60596
+ if (!ts.isForInStatement(privId.parent)) {
60597
+ if (!ts.isExpressionNode(privId)) {
60598
+ return grammarErrorOnNode(privId, ts.Diagnostics.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression);
60599
+ }
60600
+ var isInOperation = ts.isBinaryExpression(privId.parent) && privId.parent.operatorToken.kind === 101;
60601
+ if (!getSymbolForPrivateIdentifierExpression(privId) && !isInOperation) {
60602
+ return grammarErrorOnNode(privId, ts.Diagnostics.Cannot_find_name_0, ts.idText(privId));
60603
+ }
60550
60604
  }
60551
60605
  return false;
60552
60606
  }
@@ -62125,7 +62179,7 @@ var ts;
62125
62179
  typeArguments.pop();
62126
62180
  }
62127
62181
  while (typeArguments.length < typeParameters.length) {
62128
- typeArguments.push(getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));
62182
+ typeArguments.push(getDefaultFromTypeParameter(typeParameters[typeArguments.length]) || getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));
62129
62183
  }
62130
62184
  return typeArguments;
62131
62185
  }
@@ -62671,8 +62725,7 @@ var ts;
62671
62725
  }
62672
62726
  function checkCallExpression(node, checkMode) {
62673
62727
  var _a;
62674
- if (!checkGrammarTypeArguments(node, node.typeArguments))
62675
- checkGrammarArguments(node.arguments);
62728
+ checkGrammarTypeArguments(node, node.typeArguments);
62676
62729
  var signature = getResolvedSignature(node, undefined, checkMode);
62677
62730
  if (signature === resolvingSignature) {
62678
62731
  return nonInferrableType;
@@ -62769,8 +62822,7 @@ var ts;
62769
62822
  return globalESSymbol === resolveName(left, "Symbol", 111551, undefined, undefined, false);
62770
62823
  }
62771
62824
  function checkImportCallExpression(node) {
62772
- if (!checkGrammarArguments(node.arguments))
62773
- checkGrammarImportCallExpression(node);
62825
+ checkGrammarImportCallExpression(node);
62774
62826
  if (node.arguments.length === 0) {
62775
62827
  return createPromiseReturnType(node, anyType);
62776
62828
  }
@@ -68820,7 +68872,7 @@ var ts;
68820
68872
  for (var _a = 0, properties_4 = properties_5; _a < properties_4.length; _a++) {
68821
68873
  var prop = properties_4[_a];
68822
68874
  var existing = seen.get(prop.escapedName);
68823
- if (existing && !isPropertyIdenticalTo(existing, prop)) {
68875
+ if (existing && prop.parent === existing.parent) {
68824
68876
  seen.delete(prop.escapedName);
68825
68877
  }
68826
68878
  }
@@ -69105,7 +69157,7 @@ var ts;
69105
69157
  if (memberSymbol) {
69106
69158
  var declaration = memberSymbol.valueDeclaration;
69107
69159
  if (declaration !== member) {
69108
- if (declaration && isBlockScopedNameDeclaredBeforeUse(declaration, member)) {
69160
+ if (declaration && isBlockScopedNameDeclaredBeforeUse(declaration, member) && ts.isEnumDeclaration(declaration.parent)) {
69109
69161
  return getEnumMemberValue(declaration);
69110
69162
  }
69111
69163
  error(expr, ts.Diagnostics.A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums);
@@ -72053,20 +72105,6 @@ var ts;
72053
72105
  }
72054
72106
  return false;
72055
72107
  }
72056
- function checkGrammarForOmittedArgument(args) {
72057
- if (args) {
72058
- for (var _i = 0, args_4 = args; _i < args_4.length; _i++) {
72059
- var arg = args_4[_i];
72060
- if (arg.kind === 226) {
72061
- return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected);
72062
- }
72063
- }
72064
- }
72065
- return false;
72066
- }
72067
- function checkGrammarArguments(args) {
72068
- return checkGrammarForOmittedArgument(args);
72069
- }
72070
72108
  function checkGrammarHeritageClause(node) {
72071
72109
  var types = node.types;
72072
72110
  if (checkGrammarForDisallowedTrailingComma(types)) {
@@ -72177,7 +72215,7 @@ var ts;
72177
72215
  checkGrammarComputedPropertyName(name);
72178
72216
  }
72179
72217
  if (prop.kind === 295 && !inDestructuring && prop.objectAssignmentInitializer) {
72180
- return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern);
72218
+ grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern);
72181
72219
  }
72182
72220
  if (name.kind === 80) {
72183
72221
  grammarErrorOnNode(name, ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
@@ -76681,7 +76719,7 @@ var ts;
76681
76719
  var compilerOptions = context.getCompilerOptions();
76682
76720
  var languageVersion = ts.getEmitScriptTarget(compilerOptions);
76683
76721
  var useDefineForClassFields = ts.getUseDefineForClassFields(compilerOptions);
76684
- var shouldTransformPrivateElementsOrClassStaticBlocks = languageVersion < 99;
76722
+ var shouldTransformPrivateElementsOrClassStaticBlocks = languageVersion < 9;
76685
76723
  var shouldTransformSuperInStaticInitializers = (languageVersion <= 8 || !useDefineForClassFields) && languageVersion >= 2;
76686
76724
  var shouldTransformThisInStaticInitializers = languageVersion <= 8 || !useDefineForClassFields;
76687
76725
  var previousOnSubstituteNode = context.onSubstituteNode;
@@ -76701,7 +76739,7 @@ var ts;
76701
76739
  function transformSourceFile(node) {
76702
76740
  var options = context.getCompilerOptions();
76703
76741
  if (node.isDeclarationFile
76704
- || useDefineForClassFields && ts.getEmitScriptTarget(options) === 99) {
76742
+ || useDefineForClassFields && ts.getEmitScriptTarget(options) >= 9) {
76705
76743
  return node;
76706
76744
  }
76707
76745
  var visited = ts.visitEachChild(node, visitor, context);
@@ -77371,7 +77409,7 @@ var ts;
77371
77409
  return false;
77372
77410
  }
77373
77411
  if (useDefineForClassFields) {
77374
- return languageVersion < 99;
77412
+ return languageVersion < 9;
77375
77413
  }
77376
77414
  return ts.isInitializedProperty(member) || shouldTransformPrivateElementsOrClassStaticBlocks && ts.isPrivateIdentifierClassElementDeclaration(member);
77377
77415
  }
@@ -84637,7 +84675,7 @@ var ts;
84637
84675
  if (ts.isIdentifier(node.expression)) {
84638
84676
  var expression = substituteExpressionIdentifier(node.expression);
84639
84677
  noSubstitution[ts.getNodeId(expression)] = true;
84640
- if (!ts.isIdentifier(expression)) {
84678
+ if (!ts.isIdentifier(expression) && !(ts.getEmitFlags(node.expression) & 4096)) {
84641
84679
  return ts.addEmitFlags(factory.updateCallExpression(node, expression, undefined, node.arguments), 536870912);
84642
84680
  }
84643
84681
  }
@@ -84647,7 +84685,7 @@ var ts;
84647
84685
  if (ts.isIdentifier(node.tag)) {
84648
84686
  var tag = substituteExpressionIdentifier(node.tag);
84649
84687
  noSubstitution[ts.getNodeId(tag)] = true;
84650
- if (!ts.isIdentifier(tag)) {
84688
+ if (!ts.isIdentifier(tag) && !(ts.getEmitFlags(node.tag) & 4096)) {
84651
84689
  return ts.addEmitFlags(factory.updateTaggedTemplateExpression(node, tag, undefined, node.template), 536870912);
84652
84690
  }
84653
84691
  }
@@ -89511,7 +89549,7 @@ var ts;
89511
89549
  emitPlaceholder(hint, node, snippet);
89512
89550
  break;
89513
89551
  case 0:
89514
- emitTabStop(snippet);
89552
+ emitTabStop(hint, node, snippet);
89515
89553
  break;
89516
89554
  }
89517
89555
  }
@@ -89520,7 +89558,9 @@ var ts;
89520
89558
  pipelineEmitWithHintWorker(hint, node, false);
89521
89559
  nonEscapingWrite("}");
89522
89560
  }
89523
- function emitTabStop(snippet) {
89561
+ function emitTabStop(hint, node, snippet) {
89562
+ ts.Debug.assert(node.kind === 235, "A tab stop cannot be attached to a node of kind " + ts.Debug.formatSyntaxKind(node.kind) + ".");
89563
+ ts.Debug.assert(hint !== 5, "A tab stop cannot be attached to an embedded statement.");
89524
89564
  nonEscapingWrite("$" + snippet.order);
89525
89565
  }
89526
89566
  function emitIdentifier(node) {
@@ -93391,8 +93431,8 @@ var ts;
93391
93431
  var gutterSeparator = " ";
93392
93432
  var resetEscapeSequence = "\u001b[0m";
93393
93433
  var ellipsis = "...";
93434
+ var bullet = "● ";
93394
93435
  var halfIndent = " ";
93395
- var indent = " ";
93396
93436
  function getCategoryFormat(category) {
93397
93437
  switch (category) {
93398
93438
  case ts.DiagnosticCategory.Error: return ForegroundColorEscapeSequences.Red;
@@ -93405,7 +93445,7 @@ var ts;
93405
93445
  return formatStyle + text + resetEscapeSequence;
93406
93446
  }
93407
93447
  ts.formatColorAndReset = formatColorAndReset;
93408
- function formatCodeSpan(file, start, length, indent, squiggleColor, host) {
93448
+ function formatCodeSpan(file, start, length, indent, underlineColor, host) {
93409
93449
  var _a = ts.getLineAndCharacterOfPosition(file, start), firstLine = _a.line, firstLineChar = _a.character;
93410
93450
  var _b = ts.getLineAndCharacterOfPosition(file, start + length), lastLine = _b.line, lastLineChar = _b.character;
93411
93451
  var lastLineInFile = ts.getLineAndCharacterOfPosition(file, file.text.length).line;
@@ -93426,20 +93466,20 @@ var ts;
93426
93466
  var lineContent = file.text.slice(lineStart, lineEnd);
93427
93467
  lineContent = ts.trimStringEnd(lineContent);
93428
93468
  lineContent = lineContent.replace(/\t/g, " ");
93429
- context += indent + formatColorAndReset(ts.padLeft(i + 1 + "", gutterWidth), gutterStyleSequence) + gutterSeparator;
93469
+ context += indent + ts.padLeft("|", gutterWidth) + gutterSeparator;
93430
93470
  context += lineContent + host.getNewLine();
93431
- context += indent + formatColorAndReset(ts.padLeft("", gutterWidth), gutterStyleSequence) + gutterSeparator;
93432
- context += squiggleColor;
93471
+ context += indent + ts.padLeft("", gutterWidth) + gutterSeparator;
93472
+ context += underlineColor;
93433
93473
  if (i === firstLine) {
93434
93474
  var lastCharForLine = i === lastLine ? lastLineChar : undefined;
93435
93475
  context += lineContent.slice(0, firstLineChar).replace(/\S/g, " ");
93436
- context += lineContent.slice(firstLineChar, lastCharForLine).replace(/./g, "~");
93476
+ context += lineContent.slice(firstLineChar, lastCharForLine).replace(/./g, "▔");
93437
93477
  }
93438
93478
  else if (i === lastLine) {
93439
- context += lineContent.slice(0, lastLineChar).replace(/./g, "~");
93479
+ context += lineContent.slice(0, lastLineChar).replace(/./g, "▔");
93440
93480
  }
93441
93481
  else {
93442
- context += lineContent.replace(/./g, "~");
93482
+ context += lineContent.replace(/./g, "▔");
93443
93483
  }
93444
93484
  context += resetEscapeSequence;
93445
93485
  }
@@ -93459,41 +93499,51 @@ var ts;
93459
93499
  }
93460
93500
  ts.formatLocation = formatLocation;
93461
93501
  function formatDiagnosticsWithColorAndContext(diagnostics, host) {
93502
+ var _a, _b;
93503
+ var terminalWidth = (_b = (_a = ts.sys.getWidthOfTerminal) === null || _a === void 0 ? void 0 : _a.call(ts.sys)) !== null && _b !== void 0 ? _b : 0;
93504
+ var indent = terminalWidth < 60 ? "" : halfIndent;
93462
93505
  var output = "";
93463
93506
  for (var _i = 0, diagnostics_4 = diagnostics; _i < diagnostics_4.length; _i++) {
93464
93507
  var diagnostic = diagnostics_4[_i];
93508
+ var diagnosticCode = "TS" + diagnostic.code;
93465
93509
  if (diagnostic.file) {
93466
93510
  var file = diagnostic.file, start = diagnostic.start;
93467
- output += formatLocation(file, start, host);
93468
- output += " - ";
93469
- }
93470
- output += formatColorAndReset(ts.diagnosticCategoryName(diagnostic), getCategoryFormat(diagnostic.category));
93471
- output += formatColorAndReset(" TS" + diagnostic.code + ": ", ForegroundColorEscapeSequences.Grey);
93472
- output += flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine());
93473
- if (diagnostic.file) {
93511
+ var location = formatLocation(file, start, host);
93512
+ var locationLength = location.replace(/\u001b[[0-9]+m/g, "").length;
93513
+ var codeLength = diagnosticCode.length;
93514
+ output += bullet + location;
93515
+ var defaultPad = codeLength + 1;
93516
+ var padWidth = terminalWidth < 60 ? defaultPad : terminalWidth - (bullet.length + locationLength + codeLength);
93517
+ if (padWidth < diagnosticCode.length)
93518
+ padWidth = defaultPad;
93519
+ output += ts.padLeft(diagnosticCode, padWidth);
93520
+ output += formatCodeSpan(diagnostic.file, diagnostic.start, diagnostic.length, indent, getCategoryFormat(diagnostic.category), host);
93474
93521
  output += host.getNewLine();
93475
- output += formatCodeSpan(diagnostic.file, diagnostic.start, diagnostic.length, "", getCategoryFormat(diagnostic.category), host);
93476
93522
  }
93523
+ var diagnosticText = flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine(), 0, true);
93524
+ diagnosticText = ts.map(diagnosticText.split(host.getNewLine()), function (text) { return indent + text; }).join(host.getNewLine());
93525
+ output += diagnosticText;
93526
+ output += host.getNewLine();
93477
93527
  if (diagnostic.relatedInformation) {
93478
- output += host.getNewLine();
93479
- for (var _a = 0, _b = diagnostic.relatedInformation; _a < _b.length; _a++) {
93480
- var _c = _b[_a], file = _c.file, start = _c.start, length_9 = _c.length, messageText = _c.messageText;
93528
+ for (var _c = 0, _d = diagnostic.relatedInformation; _c < _d.length; _c++) {
93529
+ var _e = _d[_c], file = _e.file, start = _e.start, length_9 = _e.length, messageText = _e.messageText;
93530
+ output += host.getNewLine();
93531
+ output += indent + flattenDiagnosticMessageText(messageText, host.getNewLine(), 0, true);
93532
+ output += host.getNewLine();
93481
93533
  if (file) {
93534
+ output += indent + formatLocation(file, start, host);
93482
93535
  output += host.getNewLine();
93483
- output += halfIndent + formatLocation(file, start, host);
93484
93536
  output += formatCodeSpan(file, start, length_9, indent, ForegroundColorEscapeSequences.Cyan, host);
93485
93537
  }
93486
- output += host.getNewLine();
93487
- output += indent + flattenDiagnosticMessageText(messageText, host.getNewLine());
93488
93538
  }
93489
93539
  }
93490
- output += host.getNewLine();
93491
93540
  }
93492
93541
  return output;
93493
93542
  }
93494
93543
  ts.formatDiagnosticsWithColorAndContext = formatDiagnosticsWithColorAndContext;
93495
- function flattenDiagnosticMessageText(diag, newLine, indent) {
93544
+ function flattenDiagnosticMessageText(diag, newLine, indent, pretty) {
93496
93545
  if (indent === void 0) { indent = 0; }
93546
+ if (pretty === void 0) { pretty = false; }
93497
93547
  if (ts.isString(diag)) {
93498
93548
  return diag;
93499
93549
  }
@@ -93503,9 +93553,14 @@ var ts;
93503
93553
  var result = "";
93504
93554
  if (indent) {
93505
93555
  result += newLine;
93506
- for (var i = 0; i < indent; i++) {
93507
- result += " ";
93556
+ var indentsToReplaceWithNewLines = pretty ? 1 : 0;
93557
+ if (indent > indentsToReplaceWithNewLines) {
93558
+ for (var i = indentsToReplaceWithNewLines; i < indent; i++) {
93559
+ result += " ";
93560
+ }
93508
93561
  }
93562
+ else
93563
+ result += newLine;
93509
93564
  }
93510
93565
  result += diag.messageText;
93511
93566
  indent++;
@@ -93742,6 +93797,80 @@ var ts;
93742
93797
  ts.Diagnostics.A_label_is_not_allowed_here.code,
93743
93798
  ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode.code,
93744
93799
  ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode.code,
93800
+ ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement.code,
93801
+ ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement.code,
93802
+ ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name.code,
93803
+ ts.Diagnostics.A_class_member_cannot_have_the_0_keyword.code,
93804
+ ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name.code,
93805
+ ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement.code,
93806
+ ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,
93807
+ ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,
93808
+ ts.Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement.code,
93809
+ ts.Diagnostics.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration.code,
93810
+ ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context.code,
93811
+ ts.Diagnostics.A_destructuring_declaration_must_have_an_initializer.code,
93812
+ ts.Diagnostics.A_get_accessor_cannot_have_parameters.code,
93813
+ ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern.code,
93814
+ ts.Diagnostics.A_rest_element_cannot_have_a_property_name.code,
93815
+ ts.Diagnostics.A_rest_element_cannot_have_an_initializer.code,
93816
+ ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern.code,
93817
+ ts.Diagnostics.A_rest_parameter_cannot_have_an_initializer.code,
93818
+ ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list.code,
93819
+ ts.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma.code,
93820
+ ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body.code,
93821
+ ts.Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block.code,
93822
+ ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter.code,
93823
+ ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter.code,
93824
+ ts.Diagnostics.An_export_declaration_can_only_be_used_in_a_module.code,
93825
+ ts.Diagnostics.An_export_declaration_cannot_have_modifiers.code,
93826
+ ts.Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module.code,
93827
+ ts.Diagnostics.An_import_declaration_cannot_have_modifiers.code,
93828
+ ts.Diagnostics.An_object_member_cannot_be_declared_optional.code,
93829
+ ts.Diagnostics.Argument_of_dynamic_import_cannot_be_spread_element.code,
93830
+ ts.Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable.code,
93831
+ ts.Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause.code,
93832
+ ts.Diagnostics.Catch_clause_variable_cannot_have_an_initializer.code,
93833
+ ts.Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator.code,
93834
+ ts.Diagnostics.Classes_can_only_extend_a_single_class.code,
93835
+ ts.Diagnostics.Classes_may_not_have_a_field_named_constructor.code,
93836
+ ts.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code,
93837
+ ts.Diagnostics.Duplicate_label_0.code,
93838
+ ts.Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments.code,
93839
+ ts.Diagnostics.For_await_loops_cannot_be_used_inside_a_class_static_block.code,
93840
+ ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code,
93841
+ ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code,
93842
+ ts.Diagnostics.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array.code,
93843
+ ts.Diagnostics.JSX_property_access_expressions_cannot_include_JSX_namespace_names.code,
93844
+ ts.Diagnostics.Jump_target_cannot_cross_function_boundary.code,
93845
+ ts.Diagnostics.Line_terminator_not_permitted_before_arrow.code,
93846
+ ts.Diagnostics.Modifiers_cannot_appear_here.code,
93847
+ ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement.code,
93848
+ ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement.code,
93849
+ ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies.code,
93850
+ ts.Diagnostics.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression.code,
93851
+ ts.Diagnostics.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier.code,
93852
+ ts.Diagnostics.Tagged_template_expressions_are_not_permitted_in_an_optional_chain.code,
93853
+ ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async.code,
93854
+ ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer.code,
93855
+ ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer.code,
93856
+ ts.Diagnostics.Trailing_comma_not_allowed.code,
93857
+ ts.Diagnostics.Variable_declaration_list_cannot_be_empty.code,
93858
+ ts.Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses.code,
93859
+ ts.Diagnostics._0_expected.code,
93860
+ ts.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2.code,
93861
+ ts.Diagnostics._0_list_cannot_be_empty.code,
93862
+ ts.Diagnostics._0_modifier_already_seen.code,
93863
+ ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration.code,
93864
+ ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element.code,
93865
+ ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter.code,
93866
+ ts.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind.code,
93867
+ ts.Diagnostics._0_modifier_cannot_be_used_here.code,
93868
+ ts.Diagnostics._0_modifier_must_precede_1_modifier.code,
93869
+ ts.Diagnostics.const_declarations_can_only_be_declared_inside_a_block.code,
93870
+ ts.Diagnostics.const_declarations_must_be_initialized.code,
93871
+ ts.Diagnostics.extends_clause_already_seen.code,
93872
+ ts.Diagnostics.let_declarations_can_only_be_declared_inside_a_block.code,
93873
+ ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations.code,
93745
93874
  ]);
93746
93875
  function shouldProgramCreateNewSourceFiles(program, newOptions) {
93747
93876
  if (!program)
@@ -94597,9 +94726,10 @@ var ts;
94597
94726
  var includeBindAndCheckDiagnostics = !isTsNoCheck && (sourceFile.scriptKind === 3 || sourceFile.scriptKind === 4
94598
94727
  || sourceFile.scriptKind === 5 || isPlainJs || isCheckJs || sourceFile.scriptKind === 7);
94599
94728
  var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray;
94600
- var checkDiagnostics = includeBindAndCheckDiagnostics && !isPlainJs ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray;
94729
+ var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray;
94601
94730
  if (isPlainJs) {
94602
94731
  bindDiagnostics = ts.filter(bindDiagnostics, function (d) { return ts.plainJSErrors.has(d.code); });
94732
+ checkDiagnostics = ts.filter(checkDiagnostics, function (d) { return ts.plainJSErrors.has(d.code); });
94603
94733
  }
94604
94734
  return getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics && !isPlainJs, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined);
94605
94735
  });
@@ -99009,19 +99139,74 @@ var ts;
99009
99139
  return ts.countWhere(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; });
99010
99140
  }
99011
99141
  ts.getErrorCountForSummary = getErrorCountForSummary;
99142
+ function getFilesInErrorForSummary(diagnostics) {
99143
+ var filesInError = ts.filter(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; })
99144
+ .map(function (errorDiagnostic) {
99145
+ if (errorDiagnostic.file === undefined)
99146
+ return;
99147
+ return "" + errorDiagnostic.file.fileName;
99148
+ });
99149
+ return filesInError.map(function (fileName) {
99150
+ var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
99151
+ return diagnostic.file !== undefined && diagnostic.file.fileName === fileName;
99152
+ });
99153
+ if (diagnosticForFileName !== undefined) {
99154
+ var line = ts.getLineAndCharacterOfPosition(diagnosticForFileName.file, diagnosticForFileName.start).line;
99155
+ return {
99156
+ fileName: fileName,
99157
+ line: line + 1,
99158
+ };
99159
+ }
99160
+ });
99161
+ }
99162
+ ts.getFilesInErrorForSummary = getFilesInErrorForSummary;
99012
99163
  function getWatchErrorSummaryDiagnosticMessage(errorCount) {
99013
99164
  return errorCount === 1 ?
99014
99165
  ts.Diagnostics.Found_1_error_Watching_for_file_changes :
99015
99166
  ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
99016
99167
  }
99017
99168
  ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
99018
- function getErrorSummaryText(errorCount, newLine) {
99169
+ function getErrorSummaryText(errorCount, filesInError, newLine) {
99019
99170
  if (errorCount === 0)
99020
99171
  return "";
99021
- var d = ts.createCompilerDiagnostic(errorCount === 1 ? ts.Diagnostics.Found_1_error : ts.Diagnostics.Found_0_errors, errorCount);
99022
- return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine;
99172
+ var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
99173
+ var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
99174
+ .filter(function (value, index, self) { return self.indexOf(value) === index; });
99175
+ var d = errorCount === 1 ?
99176
+ ts.createCompilerDiagnostic(filesInError[0] !== undefined ?
99177
+ ts.Diagnostics.Found_1_error_in_1 :
99178
+ ts.Diagnostics.Found_1_error, errorCount, distinctFileNamesWithLines[0]) :
99179
+ ts.createCompilerDiagnostic(distinctFileNamesWithLines.length === 0 ?
99180
+ ts.Diagnostics.Found_0_errors :
99181
+ distinctFileNamesWithLines.length === 1 ?
99182
+ ts.Diagnostics.Found_0_errors_in_1_file :
99183
+ ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length);
99184
+ return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + (errorCount > 1 ? createTabularErrorsDisplay(nonNilFiles) : "");
99023
99185
  }
99024
99186
  ts.getErrorSummaryText = getErrorSummaryText;
99187
+ function createTabularErrorsDisplay(filesInError) {
99188
+ var distinctFiles = filesInError.filter(function (value, index, self) { return index === self.findIndex(function (file) { return (file === null || file === void 0 ? void 0 : file.fileName) === (value === null || value === void 0 ? void 0 : value.fileName); }); });
99189
+ if (distinctFiles.length === 0)
99190
+ return "";
99191
+ var numberLength = function (num) { return Math.log(num) * Math.LOG10E + 1; };
99192
+ var fileToErrorCount = distinctFiles.map(function (file) { return [file, ts.countWhere(filesInError, function (fileInError) { return fileInError.fileName === file.fileName; })]; });
99193
+ var maxErrors = fileToErrorCount.reduce(function (acc, value) { return Math.max(acc, value[1] || 0); }, 0);
99194
+ var headerRow = ts.Diagnostics.Errors_Files.message;
99195
+ var leftColumnHeadingLength = headerRow.split(" ")[0].length;
99196
+ var leftPaddingGoal = Math.max(leftColumnHeadingLength, numberLength(maxErrors));
99197
+ var headerPadding = Math.max(numberLength(maxErrors) - leftColumnHeadingLength, 0);
99198
+ var tabularData = "";
99199
+ tabularData += " ".repeat(headerPadding) + headerRow + "\n";
99200
+ fileToErrorCount.forEach(function (row) {
99201
+ var file = row[0], errorCount = row[1];
99202
+ var errorCountDigitsLength = Math.log(errorCount) * Math.LOG10E + 1 | 0;
99203
+ var leftPadding = errorCountDigitsLength < leftPaddingGoal ?
99204
+ " ".repeat(leftPaddingGoal - errorCountDigitsLength)
99205
+ : "";
99206
+ tabularData += "" + leftPadding + errorCount + " " + file.fileName + ":" + file.line + "\n";
99207
+ });
99208
+ return tabularData;
99209
+ }
99025
99210
  function isBuilderProgram(program) {
99026
99211
  return !!program.getState;
99027
99212
  }
@@ -99210,7 +99395,7 @@ var ts;
99210
99395
  listFiles(program, write);
99211
99396
  }
99212
99397
  if (reportSummary) {
99213
- reportSummary(getErrorCountForSummary(diagnostics));
99398
+ reportSummary(getErrorCountForSummary(diagnostics), getFilesInErrorForSummary(diagnostics));
99214
99399
  }
99215
99400
  return {
99216
99401
  emitResult: emitResult,
@@ -99400,7 +99585,7 @@ var ts;
99400
99585
  var system = input.system || ts.sys;
99401
99586
  var host = input.host || (input.host = ts.createIncrementalCompilerHost(input.options, system));
99402
99587
  var builderProgram = ts.createIncrementalProgram(input);
99403
- var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount) { return system.write(getErrorSummaryText(errorCount, system.newLine)); } : undefined);
99588
+ var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount, filesInError) { return system.write(getErrorSummaryText(errorCount, filesInError, system.newLine)); } : undefined);
99404
99589
  if (input.afterProgramEmitAndDiagnostics)
99405
99590
  input.afterProgramEmitAndDiagnostics(builderProgram);
99406
99591
  return exitStatus;
@@ -101458,11 +101643,14 @@ var ts;
101458
101643
  var canReportSummary = state.watch || !!state.host.reportErrorSummary;
101459
101644
  var diagnostics = state.diagnostics;
101460
101645
  var totalErrors = 0;
101646
+ var filesInError = [];
101461
101647
  if (isCircularBuildOrder(buildOrder)) {
101462
101648
  reportBuildQueue(state, buildOrder.buildOrder);
101463
101649
  reportErrors(state, buildOrder.circularDiagnostics);
101464
101650
  if (canReportSummary)
101465
101651
  totalErrors += ts.getErrorCountForSummary(buildOrder.circularDiagnostics);
101652
+ if (canReportSummary)
101653
+ filesInError = __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(buildOrder.circularDiagnostics), true);
101466
101654
  }
101467
101655
  else {
101468
101656
  buildOrder.forEach(function (project) {
@@ -101473,12 +101661,14 @@ var ts;
101473
101661
  });
101474
101662
  if (canReportSummary)
101475
101663
  diagnostics.forEach(function (singleProjectErrors) { return totalErrors += ts.getErrorCountForSummary(singleProjectErrors); });
101664
+ if (canReportSummary)
101665
+ diagnostics.forEach(function (singleProjectErrors) { return __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(singleProjectErrors), true); });
101476
101666
  }
101477
101667
  if (state.watch) {
101478
101668
  reportWatchStatus(state, ts.getWatchErrorSummaryDiagnosticMessage(totalErrors), totalErrors);
101479
101669
  }
101480
101670
  else if (state.host.reportErrorSummary) {
101481
- state.host.reportErrorSummary(totalErrors);
101671
+ state.host.reportErrorSummary(totalErrors, filesInError);
101482
101672
  }
101483
101673
  }
101484
101674
  function reportBuildQueue(state, buildQueue) {
@@ -102105,7 +102295,7 @@ var ts;
102105
102295
  }
102106
102296
  function createReportErrorSummary(sys, options) {
102107
102297
  return shouldBePretty(sys, options) ?
102108
- function (errorCount) { return sys.write(ts.getErrorSummaryText(errorCount, sys.newLine)); } :
102298
+ function (errorCount, filesInError) { return sys.write(ts.getErrorSummaryText(errorCount, filesInError, sys.newLine)); } :
102109
102299
  undefined;
102110
102300
  }
102111
102301
  function performCompilation(sys, cb, reportDiagnostic, config) {