typescript 4.6.0-dev.20211204 → 4.6.0-dev.20211208

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.
@@ -294,7 +294,7 @@ var ts;
294
294
  // The following is baselined as a literal template type without intervention
295
295
  /** The version of the TypeScript compiler release */
296
296
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
297
- ts.version = ts.versionMajorMinor + ".0-dev.20211204";
297
+ ts.version = ts.versionMajorMinor + ".0-dev.20211208";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -8131,7 +8131,7 @@ var ts;
8131
8131
  Duplicate_label_0: diag(1114, ts.DiagnosticCategory.Error, "Duplicate_label_0_1114", "Duplicate label '{0}'."),
8132
8132
  A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: diag(1115, ts.DiagnosticCategory.Error, "A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115", "A 'continue' statement can only jump to a label of an enclosing iteration statement."),
8133
8133
  A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: diag(1116, ts.DiagnosticCategory.Error, "A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116", "A 'break' statement can only jump to a label of an enclosing statement."),
8134
- An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: diag(1117, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode_1117", "An object literal cannot have multiple properties with the same name in strict mode."),
8134
+ An_object_literal_cannot_have_multiple_properties_with_the_same_name: diag(1117, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_properties_with_the_same_name_1117", "An object literal cannot have multiple properties with the same name."),
8135
8135
  An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: diag(1118, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118", "An object literal cannot have multiple get/set accessors with the same name."),
8136
8136
  An_object_literal_cannot_have_property_and_accessor_with_the_same_name: diag(1119, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119", "An object literal cannot have property and accessor with the same name."),
8137
8137
  An_export_assignment_cannot_have_modifiers: diag(1120, ts.DiagnosticCategory.Error, "An_export_assignment_cannot_have_modifiers_1120", "An export assignment cannot have modifiers."),
@@ -9083,6 +9083,7 @@ var ts;
9083
9083
  DIRECTORY: diag(6038, ts.DiagnosticCategory.Message, "DIRECTORY_6038", "DIRECTORY"),
9084
9084
  STRATEGY: diag(6039, ts.DiagnosticCategory.Message, "STRATEGY_6039", "STRATEGY"),
9085
9085
  FILE_OR_DIRECTORY: diag(6040, ts.DiagnosticCategory.Message, "FILE_OR_DIRECTORY_6040", "FILE OR DIRECTORY"),
9086
+ Errors_Files: diag(6041, ts.DiagnosticCategory.Message, "Errors_Files_6041", "Errors Files"),
9086
9087
  Generates_corresponding_map_file: diag(6043, ts.DiagnosticCategory.Message, "Generates_corresponding_map_file_6043", "Generates corresponding '.map' file."),
9087
9088
  Compiler_option_0_expects_an_argument: diag(6044, ts.DiagnosticCategory.Error, "Compiler_option_0_expects_an_argument_6044", "Compiler option '{0}' expects an argument."),
9088
9089
  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}'."),
@@ -9276,6 +9277,9 @@ var ts;
9276
9277
  Output_Formatting: diag(6256, ts.DiagnosticCategory.Message, "Output_Formatting_6256", "Output Formatting"),
9277
9278
  Completeness: diag(6257, ts.DiagnosticCategory.Message, "Completeness_6257", "Completeness"),
9278
9279
  _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"),
9280
+ Found_1_error_in_1: diag(6259, ts.DiagnosticCategory.Message, "Found_1_error_in_1_6259", "Found 1 error in {1}"),
9281
+ Found_0_errors_in_1_file: diag(6260, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_file_6260", "Found {0} errors in 1 file."),
9282
+ Found_0_errors_in_1_files: diag(6261, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_files_6261", "Found {0} errors in {1} files."),
9279
9283
  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."),
9280
9284
  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}'."),
9281
9285
  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."),
@@ -33814,10 +33818,14 @@ var ts;
33814
33818
  // - "(x,y)" is a comma expression parsed as a signature with two parameters.
33815
33819
  // - "a ? (b): c" will have "(b):" parsed as a signature with a return type annotation.
33816
33820
  // - "a ? (b): function() {}" will too, since function() is a valid JSDoc function type.
33817
- // - "a ? (b): (function() {})" as well, but inside of a parenthesized type.
33821
+ // - "a ? (b): (function() {})" as well, but inside of a parenthesized type with an arbitrary amount of nesting.
33818
33822
  //
33819
33823
  // So we need just a bit of lookahead to ensure that it can only be a signature.
33820
- var hasJSDocFunctionType = type && (ts.isJSDocFunctionType(type) || ts.isParenthesizedTypeNode(type) && ts.isJSDocFunctionType(type.type));
33824
+ var unwrappedType = type;
33825
+ while ((unwrappedType === null || unwrappedType === void 0 ? void 0 : unwrappedType.kind) === 190 /* ParenthesizedType */) {
33826
+ unwrappedType = unwrappedType.type; // Skip parens if need be
33827
+ }
33828
+ var hasJSDocFunctionType = unwrappedType && ts.isJSDocFunctionType(unwrappedType);
33821
33829
  if (!allowAmbiguity && token() !== 38 /* EqualsGreaterThanToken */ && (hasJSDocFunctionType || token() !== 18 /* OpenBraceToken */)) {
33822
33830
  // Returning undefined here will cause our caller to rewind to where we started from.
33823
33831
  return undefined;
@@ -41659,7 +41667,10 @@ var ts;
41659
41667
  }
41660
41668
  }
41661
41669
  var failedLookupLocations = [];
41662
- var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: NodeResolutionFeatures.AllFeatures, conditions: ["node", "require", "types"] };
41670
+ var features = ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12 ? NodeResolutionFeatures.Node12Default :
41671
+ ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext ? NodeResolutionFeatures.NodeNextDefault :
41672
+ NodeResolutionFeatures.None;
41673
+ var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: features, conditions: ["node", "require", "types"] };
41663
41674
  var resolved = primaryLookup();
41664
41675
  var primary = true;
41665
41676
  if (!resolved) {
@@ -42334,13 +42345,15 @@ var ts;
42334
42345
  // not currently backported to node 12 - https://github.com/nodejs/Release/issues/690
42335
42346
  NodeResolutionFeatures[NodeResolutionFeatures["ExportsPatternTrailers"] = 16] = "ExportsPatternTrailers";
42336
42347
  NodeResolutionFeatures[NodeResolutionFeatures["AllFeatures"] = 30] = "AllFeatures";
42348
+ NodeResolutionFeatures[NodeResolutionFeatures["Node12Default"] = 14] = "Node12Default";
42349
+ NodeResolutionFeatures[NodeResolutionFeatures["NodeNextDefault"] = 30] = "NodeNextDefault";
42337
42350
  NodeResolutionFeatures[NodeResolutionFeatures["EsmMode"] = 32] = "EsmMode";
42338
42351
  })(NodeResolutionFeatures || (NodeResolutionFeatures = {}));
42339
42352
  function node12ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
42340
- return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Imports | NodeResolutionFeatures.SelfName | NodeResolutionFeatures.Exports, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
42353
+ return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Node12Default, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
42341
42354
  }
42342
42355
  function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
42343
- return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.AllFeatures, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
42356
+ return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.NodeNextDefault, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
42344
42357
  }
42345
42358
  function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
42346
42359
  var containingDirectory = ts.getDirectoryPath(containingFile);
@@ -45143,10 +45156,6 @@ var ts;
45143
45156
  seen.set(identifier.escapedText, currentKind);
45144
45157
  continue;
45145
45158
  }
45146
- if (currentKind === 1 /* Property */ && existingKind === 1 /* Property */) {
45147
- var span = ts.getErrorSpanForNode(file, identifier);
45148
- file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode));
45149
- }
45150
45159
  }
45151
45160
  }
45152
45161
  return bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object" /* Object */);
@@ -45380,7 +45389,7 @@ var ts;
45380
45389
  }
45381
45390
  }
45382
45391
  function checkStrictModeNumericLiteral(node) {
45383
- if (inStrictMode && node.numericLiteralFlags & 32 /* Octal */) {
45392
+ if (languageVersion < 1 /* ES5 */ && inStrictMode && node.numericLiteralFlags & 32 /* Octal */) {
45384
45393
  file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode));
45385
45394
  }
45386
45395
  }
@@ -48985,10 +48994,12 @@ var ts;
48985
48994
  }
48986
48995
  /* Starting from 'initial' node walk up the parent chain until 'stopAt' node is reached.
48987
48996
  * If at any point current node is equal to 'parent' node - return true.
48997
+ * If current node is an IIFE, continue walking up.
48988
48998
  * Return false if 'stopAt' node is reached or isFunctionLike(current) === true.
48989
48999
  */
48990
49000
  function isSameScopeDescendentOf(initial, parent, stopAt) {
48991
- return !!parent && !!ts.findAncestor(initial, function (n) { return n === stopAt || ts.isFunctionLike(n) ? "quit" : n === parent; });
49001
+ return !!parent && !!ts.findAncestor(initial, function (n) { return n === parent
49002
+ || (n === stopAt || ts.isFunctionLike(n) && !ts.getImmediatelyInvokedFunctionExpression(n) ? "quit" : false); });
48992
49003
  }
48993
49004
  function getAnyImportSyntax(node) {
48994
49005
  switch (node.kind) {
@@ -65770,7 +65781,7 @@ var ts;
65770
65781
  }
65771
65782
  function getBaseTypeOfLiteralType(type) {
65772
65783
  return type.flags & 1024 /* EnumLiteral */ ? getBaseTypeOfEnumLiteralType(type) :
65773
- type.flags & 128 /* StringLiteral */ ? stringType :
65784
+ type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType :
65774
65785
  type.flags & 256 /* NumberLiteral */ ? numberType :
65775
65786
  type.flags & 2048 /* BigIntLiteral */ ? bigintType :
65776
65787
  type.flags & 512 /* BooleanLiteral */ ? booleanType :
@@ -86138,9 +86149,12 @@ var ts;
86138
86149
  seen.set(effectiveName, currentKind);
86139
86150
  }
86140
86151
  else {
86141
- if ((currentKind & 12 /* PropertyAssignmentOrMethod */) && (existingKind & 12 /* PropertyAssignmentOrMethod */)) {
86152
+ if ((currentKind & 8 /* Method */) && (existingKind & 8 /* Method */)) {
86142
86153
  grammarErrorOnNode(name, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name));
86143
86154
  }
86155
+ else if ((currentKind & 4 /* PropertyAssignment */) && (existingKind & 4 /* PropertyAssignment */)) {
86156
+ grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name, ts.getTextOfNode(name));
86157
+ }
86144
86158
  else if ((currentKind & 3 /* GetOrSetAccessor */) && (existingKind & 3 /* GetOrSetAccessor */)) {
86145
86159
  if (existingKind !== 3 /* GetOrSetAccessor */ && currentKind !== existingKind) {
86146
86160
  seen.set(effectiveName, currentKind | existingKind);
@@ -119909,7 +119923,7 @@ var ts;
119909
119923
  getCanonicalFileName: ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)
119910
119924
  } : undefined;
119911
119925
  /**
119912
- * Create a function that reports error by writing to the system and handles the formating of the diagnostic
119926
+ * Create a function that reports error by writing to the system and handles the formatting of the diagnostic
119913
119927
  */
119914
119928
  function createDiagnosticReporter(system, pretty) {
119915
119929
  var host = system === ts.sys && sysFormatDiagnosticsHost ? sysFormatDiagnosticsHost : {
@@ -119995,19 +120009,74 @@ var ts;
119995
120009
  return ts.countWhere(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; });
119996
120010
  }
119997
120011
  ts.getErrorCountForSummary = getErrorCountForSummary;
120012
+ function getFilesInErrorForSummary(diagnostics) {
120013
+ var filesInError = ts.filter(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; })
120014
+ .map(function (errorDiagnostic) {
120015
+ if (errorDiagnostic.file === undefined)
120016
+ return;
120017
+ return "" + errorDiagnostic.file.fileName;
120018
+ });
120019
+ return filesInError.map(function (fileName) {
120020
+ var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
120021
+ return diagnostic.file !== undefined && diagnostic.file.fileName === fileName;
120022
+ });
120023
+ if (diagnosticForFileName !== undefined) {
120024
+ var line = ts.getLineAndCharacterOfPosition(diagnosticForFileName.file, diagnosticForFileName.start).line;
120025
+ return {
120026
+ fileName: fileName,
120027
+ line: line + 1,
120028
+ };
120029
+ }
120030
+ });
120031
+ }
120032
+ ts.getFilesInErrorForSummary = getFilesInErrorForSummary;
119998
120033
  function getWatchErrorSummaryDiagnosticMessage(errorCount) {
119999
120034
  return errorCount === 1 ?
120000
120035
  ts.Diagnostics.Found_1_error_Watching_for_file_changes :
120001
120036
  ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
120002
120037
  }
120003
120038
  ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
120004
- function getErrorSummaryText(errorCount, newLine) {
120039
+ function getErrorSummaryText(errorCount, filesInError, newLine) {
120005
120040
  if (errorCount === 0)
120006
120041
  return "";
120007
- var d = ts.createCompilerDiagnostic(errorCount === 1 ? ts.Diagnostics.Found_1_error : ts.Diagnostics.Found_0_errors, errorCount);
120008
- return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine;
120042
+ var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
120043
+ var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
120044
+ .filter(function (value, index, self) { return self.indexOf(value) === index; });
120045
+ var d = errorCount === 1 ?
120046
+ ts.createCompilerDiagnostic(filesInError[0] !== undefined ?
120047
+ ts.Diagnostics.Found_1_error_in_1 :
120048
+ ts.Diagnostics.Found_1_error, errorCount, distinctFileNamesWithLines[0]) :
120049
+ ts.createCompilerDiagnostic(distinctFileNamesWithLines.length === 0 ?
120050
+ ts.Diagnostics.Found_0_errors :
120051
+ distinctFileNamesWithLines.length === 1 ?
120052
+ ts.Diagnostics.Found_0_errors_in_1_file :
120053
+ ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length);
120054
+ return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + (errorCount > 1 ? createTabularErrorsDisplay(nonNilFiles) : "");
120009
120055
  }
120010
120056
  ts.getErrorSummaryText = getErrorSummaryText;
120057
+ function createTabularErrorsDisplay(filesInError) {
120058
+ 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); }); });
120059
+ if (distinctFiles.length === 0)
120060
+ return "";
120061
+ var numberLength = function (num) { return Math.log(num) * Math.LOG10E + 1; };
120062
+ var fileToErrorCount = distinctFiles.map(function (file) { return [file, ts.countWhere(filesInError, function (fileInError) { return fileInError.fileName === file.fileName; })]; });
120063
+ var maxErrors = fileToErrorCount.reduce(function (acc, value) { return Math.max(acc, value[1] || 0); }, 0);
120064
+ var headerRow = ts.Diagnostics.Errors_Files.message;
120065
+ var leftColumnHeadingLength = headerRow.split(" ")[0].length;
120066
+ var leftPaddingGoal = Math.max(leftColumnHeadingLength, numberLength(maxErrors));
120067
+ var headerPadding = Math.max(numberLength(maxErrors) - leftColumnHeadingLength, 0);
120068
+ var tabularData = "";
120069
+ tabularData += " ".repeat(headerPadding) + headerRow + "\n";
120070
+ fileToErrorCount.forEach(function (row) {
120071
+ var file = row[0], errorCount = row[1];
120072
+ var errorCountDigitsLength = Math.log(errorCount) * Math.LOG10E + 1 | 0;
120073
+ var leftPadding = errorCountDigitsLength < leftPaddingGoal ?
120074
+ " ".repeat(leftPaddingGoal - errorCountDigitsLength)
120075
+ : "";
120076
+ tabularData += "" + leftPadding + errorCount + " " + file.fileName + ":" + file.line + "\n";
120077
+ });
120078
+ return tabularData;
120079
+ }
120011
120080
  function isBuilderProgram(program) {
120012
120081
  return !!program.getState;
120013
120082
  }
@@ -120211,7 +120280,7 @@ var ts;
120211
120280
  listFiles(program, write);
120212
120281
  }
120213
120282
  if (reportSummary) {
120214
- reportSummary(getErrorCountForSummary(diagnostics));
120283
+ reportSummary(getErrorCountForSummary(diagnostics), getFilesInErrorForSummary(diagnostics));
120215
120284
  }
120216
120285
  return {
120217
120286
  emitResult: emitResult,
@@ -120422,7 +120491,7 @@ var ts;
120422
120491
  var system = input.system || ts.sys;
120423
120492
  var host = input.host || (input.host = ts.createIncrementalCompilerHost(input.options, system));
120424
120493
  var builderProgram = ts.createIncrementalProgram(input);
120425
- 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);
120494
+ 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);
120426
120495
  if (input.afterProgramEmitAndDiagnostics)
120427
120496
  input.afterProgramEmitAndDiagnostics(builderProgram);
120428
120497
  return exitStatus;
@@ -122641,11 +122710,14 @@ var ts;
122641
122710
  var canReportSummary = state.watch || !!state.host.reportErrorSummary;
122642
122711
  var diagnostics = state.diagnostics;
122643
122712
  var totalErrors = 0;
122713
+ var filesInError = [];
122644
122714
  if (isCircularBuildOrder(buildOrder)) {
122645
122715
  reportBuildQueue(state, buildOrder.buildOrder);
122646
122716
  reportErrors(state, buildOrder.circularDiagnostics);
122647
122717
  if (canReportSummary)
122648
122718
  totalErrors += ts.getErrorCountForSummary(buildOrder.circularDiagnostics);
122719
+ if (canReportSummary)
122720
+ filesInError = __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(buildOrder.circularDiagnostics), true);
122649
122721
  }
122650
122722
  else {
122651
122723
  // Report errors from the other projects
@@ -122657,12 +122729,14 @@ var ts;
122657
122729
  });
122658
122730
  if (canReportSummary)
122659
122731
  diagnostics.forEach(function (singleProjectErrors) { return totalErrors += ts.getErrorCountForSummary(singleProjectErrors); });
122732
+ if (canReportSummary)
122733
+ diagnostics.forEach(function (singleProjectErrors) { return __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(singleProjectErrors), true); });
122660
122734
  }
122661
122735
  if (state.watch) {
122662
122736
  reportWatchStatus(state, ts.getWatchErrorSummaryDiagnosticMessage(totalErrors), totalErrors);
122663
122737
  }
122664
122738
  else if (state.host.reportErrorSummary) {
122665
- state.host.reportErrorSummary(totalErrors);
122739
+ state.host.reportErrorSummary(totalErrors, filesInError);
122666
122740
  }
122667
122741
  }
122668
122742
  /**
@@ -131727,8 +131801,10 @@ var ts;
131727
131801
  }
131728
131802
  /** Get the corresponding JSDocTag node if the position is in a jsDoc comment */
131729
131803
  function getJsDocTagAtPosition(node, position) {
131730
- var jsdoc = ts.findAncestor(node, ts.isJSDoc);
131731
- return jsdoc && jsdoc.tags && (ts.rangeContainsPosition(jsdoc, position) ? ts.findLast(jsdoc.tags, function (tag) { return tag.pos < position; }) : undefined);
131804
+ return ts.findAncestor(node, function (n) {
131805
+ return ts.isJSDocTag(n) && ts.rangeContainsPosition(n, position) ? true :
131806
+ ts.isJSDoc(n) ? "quit" : false;
131807
+ });
131732
131808
  }
131733
131809
  function getPropertiesForObjectExpression(contextualType, completionsType, obj, checker) {
131734
131810
  var hasCompletionsType = completionsType && completionsType !== contextualType;
@@ -141484,7 +141560,7 @@ var ts;
141484
141560
  displayParts.push(ts.spacePart());
141485
141561
  displayParts.push(ts.operatorPart(63 /* EqualsToken */));
141486
141562
  displayParts.push(ts.spacePart());
141487
- ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 8388608 /* InTypeAlias */));
141563
+ ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, ts.isConstTypeReference(location.parent) ? typeChecker.getTypeAtLocation(location.parent) : typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 8388608 /* InTypeAlias */));
141488
141564
  }
141489
141565
  if (symbolFlags & 384 /* Enum */) {
141490
141566
  prefixNextMeaning();
@@ -5352,7 +5352,11 @@ declare namespace ts {
5352
5352
  traceResolution?: boolean;
5353
5353
  [option: string]: CompilerOptionsValue | undefined;
5354
5354
  }
5355
- type ReportEmitErrorSummary = (errorCount: number) => void;
5355
+ type ReportEmitErrorSummary = (errorCount: number, filesInError: (ReportFileInError | undefined)[]) => void;
5356
+ interface ReportFileInError {
5357
+ fileName: string;
5358
+ line: number;
5359
+ }
5356
5360
  interface SolutionBuilderHostBase<T extends BuilderProgram> extends ProgramHost<T> {
5357
5361
  createDirectory?(path: string): void;
5358
5362
  /**
package/lib/typescript.js CHANGED
@@ -294,7 +294,7 @@ var ts;
294
294
  // The following is baselined as a literal template type without intervention
295
295
  /** The version of the TypeScript compiler release */
296
296
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
297
- ts.version = ts.versionMajorMinor + ".0-dev.20211204";
297
+ ts.version = ts.versionMajorMinor + ".0-dev.20211208";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -8131,7 +8131,7 @@ var ts;
8131
8131
  Duplicate_label_0: diag(1114, ts.DiagnosticCategory.Error, "Duplicate_label_0_1114", "Duplicate label '{0}'."),
8132
8132
  A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: diag(1115, ts.DiagnosticCategory.Error, "A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115", "A 'continue' statement can only jump to a label of an enclosing iteration statement."),
8133
8133
  A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: diag(1116, ts.DiagnosticCategory.Error, "A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116", "A 'break' statement can only jump to a label of an enclosing statement."),
8134
- An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: diag(1117, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode_1117", "An object literal cannot have multiple properties with the same name in strict mode."),
8134
+ An_object_literal_cannot_have_multiple_properties_with_the_same_name: diag(1117, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_properties_with_the_same_name_1117", "An object literal cannot have multiple properties with the same name."),
8135
8135
  An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: diag(1118, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118", "An object literal cannot have multiple get/set accessors with the same name."),
8136
8136
  An_object_literal_cannot_have_property_and_accessor_with_the_same_name: diag(1119, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119", "An object literal cannot have property and accessor with the same name."),
8137
8137
  An_export_assignment_cannot_have_modifiers: diag(1120, ts.DiagnosticCategory.Error, "An_export_assignment_cannot_have_modifiers_1120", "An export assignment cannot have modifiers."),
@@ -9083,6 +9083,7 @@ var ts;
9083
9083
  DIRECTORY: diag(6038, ts.DiagnosticCategory.Message, "DIRECTORY_6038", "DIRECTORY"),
9084
9084
  STRATEGY: diag(6039, ts.DiagnosticCategory.Message, "STRATEGY_6039", "STRATEGY"),
9085
9085
  FILE_OR_DIRECTORY: diag(6040, ts.DiagnosticCategory.Message, "FILE_OR_DIRECTORY_6040", "FILE OR DIRECTORY"),
9086
+ Errors_Files: diag(6041, ts.DiagnosticCategory.Message, "Errors_Files_6041", "Errors Files"),
9086
9087
  Generates_corresponding_map_file: diag(6043, ts.DiagnosticCategory.Message, "Generates_corresponding_map_file_6043", "Generates corresponding '.map' file."),
9087
9088
  Compiler_option_0_expects_an_argument: diag(6044, ts.DiagnosticCategory.Error, "Compiler_option_0_expects_an_argument_6044", "Compiler option '{0}' expects an argument."),
9088
9089
  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}'."),
@@ -9276,6 +9277,9 @@ var ts;
9276
9277
  Output_Formatting: diag(6256, ts.DiagnosticCategory.Message, "Output_Formatting_6256", "Output Formatting"),
9277
9278
  Completeness: diag(6257, ts.DiagnosticCategory.Message, "Completeness_6257", "Completeness"),
9278
9279
  _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"),
9280
+ Found_1_error_in_1: diag(6259, ts.DiagnosticCategory.Message, "Found_1_error_in_1_6259", "Found 1 error in {1}"),
9281
+ Found_0_errors_in_1_file: diag(6260, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_file_6260", "Found {0} errors in 1 file."),
9282
+ Found_0_errors_in_1_files: diag(6261, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_files_6261", "Found {0} errors in {1} files."),
9279
9283
  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."),
9280
9284
  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}'."),
9281
9285
  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."),
@@ -33814,10 +33818,14 @@ var ts;
33814
33818
  // - "(x,y)" is a comma expression parsed as a signature with two parameters.
33815
33819
  // - "a ? (b): c" will have "(b):" parsed as a signature with a return type annotation.
33816
33820
  // - "a ? (b): function() {}" will too, since function() is a valid JSDoc function type.
33817
- // - "a ? (b): (function() {})" as well, but inside of a parenthesized type.
33821
+ // - "a ? (b): (function() {})" as well, but inside of a parenthesized type with an arbitrary amount of nesting.
33818
33822
  //
33819
33823
  // So we need just a bit of lookahead to ensure that it can only be a signature.
33820
- var hasJSDocFunctionType = type && (ts.isJSDocFunctionType(type) || ts.isParenthesizedTypeNode(type) && ts.isJSDocFunctionType(type.type));
33824
+ var unwrappedType = type;
33825
+ while ((unwrappedType === null || unwrappedType === void 0 ? void 0 : unwrappedType.kind) === 190 /* ParenthesizedType */) {
33826
+ unwrappedType = unwrappedType.type; // Skip parens if need be
33827
+ }
33828
+ var hasJSDocFunctionType = unwrappedType && ts.isJSDocFunctionType(unwrappedType);
33821
33829
  if (!allowAmbiguity && token() !== 38 /* EqualsGreaterThanToken */ && (hasJSDocFunctionType || token() !== 18 /* OpenBraceToken */)) {
33822
33830
  // Returning undefined here will cause our caller to rewind to where we started from.
33823
33831
  return undefined;
@@ -41659,7 +41667,10 @@ var ts;
41659
41667
  }
41660
41668
  }
41661
41669
  var failedLookupLocations = [];
41662
- var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: NodeResolutionFeatures.AllFeatures, conditions: ["node", "require", "types"] };
41670
+ var features = ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12 ? NodeResolutionFeatures.Node12Default :
41671
+ ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext ? NodeResolutionFeatures.NodeNextDefault :
41672
+ NodeResolutionFeatures.None;
41673
+ var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: features, conditions: ["node", "require", "types"] };
41663
41674
  var resolved = primaryLookup();
41664
41675
  var primary = true;
41665
41676
  if (!resolved) {
@@ -42334,13 +42345,15 @@ var ts;
42334
42345
  // not currently backported to node 12 - https://github.com/nodejs/Release/issues/690
42335
42346
  NodeResolutionFeatures[NodeResolutionFeatures["ExportsPatternTrailers"] = 16] = "ExportsPatternTrailers";
42336
42347
  NodeResolutionFeatures[NodeResolutionFeatures["AllFeatures"] = 30] = "AllFeatures";
42348
+ NodeResolutionFeatures[NodeResolutionFeatures["Node12Default"] = 14] = "Node12Default";
42349
+ NodeResolutionFeatures[NodeResolutionFeatures["NodeNextDefault"] = 30] = "NodeNextDefault";
42337
42350
  NodeResolutionFeatures[NodeResolutionFeatures["EsmMode"] = 32] = "EsmMode";
42338
42351
  })(NodeResolutionFeatures || (NodeResolutionFeatures = {}));
42339
42352
  function node12ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
42340
- return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Imports | NodeResolutionFeatures.SelfName | NodeResolutionFeatures.Exports, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
42353
+ return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Node12Default, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
42341
42354
  }
42342
42355
  function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
42343
- return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.AllFeatures, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
42356
+ return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.NodeNextDefault, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
42344
42357
  }
42345
42358
  function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
42346
42359
  var containingDirectory = ts.getDirectoryPath(containingFile);
@@ -45143,10 +45156,6 @@ var ts;
45143
45156
  seen.set(identifier.escapedText, currentKind);
45144
45157
  continue;
45145
45158
  }
45146
- if (currentKind === 1 /* Property */ && existingKind === 1 /* Property */) {
45147
- var span = ts.getErrorSpanForNode(file, identifier);
45148
- file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode));
45149
- }
45150
45159
  }
45151
45160
  }
45152
45161
  return bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object" /* Object */);
@@ -45380,7 +45389,7 @@ var ts;
45380
45389
  }
45381
45390
  }
45382
45391
  function checkStrictModeNumericLiteral(node) {
45383
- if (inStrictMode && node.numericLiteralFlags & 32 /* Octal */) {
45392
+ if (languageVersion < 1 /* ES5 */ && inStrictMode && node.numericLiteralFlags & 32 /* Octal */) {
45384
45393
  file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode));
45385
45394
  }
45386
45395
  }
@@ -48985,10 +48994,12 @@ var ts;
48985
48994
  }
48986
48995
  /* Starting from 'initial' node walk up the parent chain until 'stopAt' node is reached.
48987
48996
  * If at any point current node is equal to 'parent' node - return true.
48997
+ * If current node is an IIFE, continue walking up.
48988
48998
  * Return false if 'stopAt' node is reached or isFunctionLike(current) === true.
48989
48999
  */
48990
49000
  function isSameScopeDescendentOf(initial, parent, stopAt) {
48991
- return !!parent && !!ts.findAncestor(initial, function (n) { return n === stopAt || ts.isFunctionLike(n) ? "quit" : n === parent; });
49001
+ return !!parent && !!ts.findAncestor(initial, function (n) { return n === parent
49002
+ || (n === stopAt || ts.isFunctionLike(n) && !ts.getImmediatelyInvokedFunctionExpression(n) ? "quit" : false); });
48992
49003
  }
48993
49004
  function getAnyImportSyntax(node) {
48994
49005
  switch (node.kind) {
@@ -65770,7 +65781,7 @@ var ts;
65770
65781
  }
65771
65782
  function getBaseTypeOfLiteralType(type) {
65772
65783
  return type.flags & 1024 /* EnumLiteral */ ? getBaseTypeOfEnumLiteralType(type) :
65773
- type.flags & 128 /* StringLiteral */ ? stringType :
65784
+ type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType :
65774
65785
  type.flags & 256 /* NumberLiteral */ ? numberType :
65775
65786
  type.flags & 2048 /* BigIntLiteral */ ? bigintType :
65776
65787
  type.flags & 512 /* BooleanLiteral */ ? booleanType :
@@ -86138,9 +86149,12 @@ var ts;
86138
86149
  seen.set(effectiveName, currentKind);
86139
86150
  }
86140
86151
  else {
86141
- if ((currentKind & 12 /* PropertyAssignmentOrMethod */) && (existingKind & 12 /* PropertyAssignmentOrMethod */)) {
86152
+ if ((currentKind & 8 /* Method */) && (existingKind & 8 /* Method */)) {
86142
86153
  grammarErrorOnNode(name, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name));
86143
86154
  }
86155
+ else if ((currentKind & 4 /* PropertyAssignment */) && (existingKind & 4 /* PropertyAssignment */)) {
86156
+ grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name, ts.getTextOfNode(name));
86157
+ }
86144
86158
  else if ((currentKind & 3 /* GetOrSetAccessor */) && (existingKind & 3 /* GetOrSetAccessor */)) {
86145
86159
  if (existingKind !== 3 /* GetOrSetAccessor */ && currentKind !== existingKind) {
86146
86160
  seen.set(effectiveName, currentKind | existingKind);
@@ -119909,7 +119923,7 @@ var ts;
119909
119923
  getCanonicalFileName: ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)
119910
119924
  } : undefined;
119911
119925
  /**
119912
- * Create a function that reports error by writing to the system and handles the formating of the diagnostic
119926
+ * Create a function that reports error by writing to the system and handles the formatting of the diagnostic
119913
119927
  */
119914
119928
  function createDiagnosticReporter(system, pretty) {
119915
119929
  var host = system === ts.sys && sysFormatDiagnosticsHost ? sysFormatDiagnosticsHost : {
@@ -119995,19 +120009,74 @@ var ts;
119995
120009
  return ts.countWhere(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; });
119996
120010
  }
119997
120011
  ts.getErrorCountForSummary = getErrorCountForSummary;
120012
+ function getFilesInErrorForSummary(diagnostics) {
120013
+ var filesInError = ts.filter(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; })
120014
+ .map(function (errorDiagnostic) {
120015
+ if (errorDiagnostic.file === undefined)
120016
+ return;
120017
+ return "" + errorDiagnostic.file.fileName;
120018
+ });
120019
+ return filesInError.map(function (fileName) {
120020
+ var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
120021
+ return diagnostic.file !== undefined && diagnostic.file.fileName === fileName;
120022
+ });
120023
+ if (diagnosticForFileName !== undefined) {
120024
+ var line = ts.getLineAndCharacterOfPosition(diagnosticForFileName.file, diagnosticForFileName.start).line;
120025
+ return {
120026
+ fileName: fileName,
120027
+ line: line + 1,
120028
+ };
120029
+ }
120030
+ });
120031
+ }
120032
+ ts.getFilesInErrorForSummary = getFilesInErrorForSummary;
119998
120033
  function getWatchErrorSummaryDiagnosticMessage(errorCount) {
119999
120034
  return errorCount === 1 ?
120000
120035
  ts.Diagnostics.Found_1_error_Watching_for_file_changes :
120001
120036
  ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
120002
120037
  }
120003
120038
  ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
120004
- function getErrorSummaryText(errorCount, newLine) {
120039
+ function getErrorSummaryText(errorCount, filesInError, newLine) {
120005
120040
  if (errorCount === 0)
120006
120041
  return "";
120007
- var d = ts.createCompilerDiagnostic(errorCount === 1 ? ts.Diagnostics.Found_1_error : ts.Diagnostics.Found_0_errors, errorCount);
120008
- return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine;
120042
+ var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
120043
+ var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
120044
+ .filter(function (value, index, self) { return self.indexOf(value) === index; });
120045
+ var d = errorCount === 1 ?
120046
+ ts.createCompilerDiagnostic(filesInError[0] !== undefined ?
120047
+ ts.Diagnostics.Found_1_error_in_1 :
120048
+ ts.Diagnostics.Found_1_error, errorCount, distinctFileNamesWithLines[0]) :
120049
+ ts.createCompilerDiagnostic(distinctFileNamesWithLines.length === 0 ?
120050
+ ts.Diagnostics.Found_0_errors :
120051
+ distinctFileNamesWithLines.length === 1 ?
120052
+ ts.Diagnostics.Found_0_errors_in_1_file :
120053
+ ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length);
120054
+ return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + (errorCount > 1 ? createTabularErrorsDisplay(nonNilFiles) : "");
120009
120055
  }
120010
120056
  ts.getErrorSummaryText = getErrorSummaryText;
120057
+ function createTabularErrorsDisplay(filesInError) {
120058
+ 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); }); });
120059
+ if (distinctFiles.length === 0)
120060
+ return "";
120061
+ var numberLength = function (num) { return Math.log(num) * Math.LOG10E + 1; };
120062
+ var fileToErrorCount = distinctFiles.map(function (file) { return [file, ts.countWhere(filesInError, function (fileInError) { return fileInError.fileName === file.fileName; })]; });
120063
+ var maxErrors = fileToErrorCount.reduce(function (acc, value) { return Math.max(acc, value[1] || 0); }, 0);
120064
+ var headerRow = ts.Diagnostics.Errors_Files.message;
120065
+ var leftColumnHeadingLength = headerRow.split(" ")[0].length;
120066
+ var leftPaddingGoal = Math.max(leftColumnHeadingLength, numberLength(maxErrors));
120067
+ var headerPadding = Math.max(numberLength(maxErrors) - leftColumnHeadingLength, 0);
120068
+ var tabularData = "";
120069
+ tabularData += " ".repeat(headerPadding) + headerRow + "\n";
120070
+ fileToErrorCount.forEach(function (row) {
120071
+ var file = row[0], errorCount = row[1];
120072
+ var errorCountDigitsLength = Math.log(errorCount) * Math.LOG10E + 1 | 0;
120073
+ var leftPadding = errorCountDigitsLength < leftPaddingGoal ?
120074
+ " ".repeat(leftPaddingGoal - errorCountDigitsLength)
120075
+ : "";
120076
+ tabularData += "" + leftPadding + errorCount + " " + file.fileName + ":" + file.line + "\n";
120077
+ });
120078
+ return tabularData;
120079
+ }
120011
120080
  function isBuilderProgram(program) {
120012
120081
  return !!program.getState;
120013
120082
  }
@@ -120211,7 +120280,7 @@ var ts;
120211
120280
  listFiles(program, write);
120212
120281
  }
120213
120282
  if (reportSummary) {
120214
- reportSummary(getErrorCountForSummary(diagnostics));
120283
+ reportSummary(getErrorCountForSummary(diagnostics), getFilesInErrorForSummary(diagnostics));
120215
120284
  }
120216
120285
  return {
120217
120286
  emitResult: emitResult,
@@ -120422,7 +120491,7 @@ var ts;
120422
120491
  var system = input.system || ts.sys;
120423
120492
  var host = input.host || (input.host = ts.createIncrementalCompilerHost(input.options, system));
120424
120493
  var builderProgram = ts.createIncrementalProgram(input);
120425
- 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);
120494
+ 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);
120426
120495
  if (input.afterProgramEmitAndDiagnostics)
120427
120496
  input.afterProgramEmitAndDiagnostics(builderProgram);
120428
120497
  return exitStatus;
@@ -122641,11 +122710,14 @@ var ts;
122641
122710
  var canReportSummary = state.watch || !!state.host.reportErrorSummary;
122642
122711
  var diagnostics = state.diagnostics;
122643
122712
  var totalErrors = 0;
122713
+ var filesInError = [];
122644
122714
  if (isCircularBuildOrder(buildOrder)) {
122645
122715
  reportBuildQueue(state, buildOrder.buildOrder);
122646
122716
  reportErrors(state, buildOrder.circularDiagnostics);
122647
122717
  if (canReportSummary)
122648
122718
  totalErrors += ts.getErrorCountForSummary(buildOrder.circularDiagnostics);
122719
+ if (canReportSummary)
122720
+ filesInError = __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(buildOrder.circularDiagnostics), true);
122649
122721
  }
122650
122722
  else {
122651
122723
  // Report errors from the other projects
@@ -122657,12 +122729,14 @@ var ts;
122657
122729
  });
122658
122730
  if (canReportSummary)
122659
122731
  diagnostics.forEach(function (singleProjectErrors) { return totalErrors += ts.getErrorCountForSummary(singleProjectErrors); });
122732
+ if (canReportSummary)
122733
+ diagnostics.forEach(function (singleProjectErrors) { return __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(singleProjectErrors), true); });
122660
122734
  }
122661
122735
  if (state.watch) {
122662
122736
  reportWatchStatus(state, ts.getWatchErrorSummaryDiagnosticMessage(totalErrors), totalErrors);
122663
122737
  }
122664
122738
  else if (state.host.reportErrorSummary) {
122665
- state.host.reportErrorSummary(totalErrors);
122739
+ state.host.reportErrorSummary(totalErrors, filesInError);
122666
122740
  }
122667
122741
  }
122668
122742
  /**
@@ -131727,8 +131801,10 @@ var ts;
131727
131801
  }
131728
131802
  /** Get the corresponding JSDocTag node if the position is in a jsDoc comment */
131729
131803
  function getJsDocTagAtPosition(node, position) {
131730
- var jsdoc = ts.findAncestor(node, ts.isJSDoc);
131731
- return jsdoc && jsdoc.tags && (ts.rangeContainsPosition(jsdoc, position) ? ts.findLast(jsdoc.tags, function (tag) { return tag.pos < position; }) : undefined);
131804
+ return ts.findAncestor(node, function (n) {
131805
+ return ts.isJSDocTag(n) && ts.rangeContainsPosition(n, position) ? true :
131806
+ ts.isJSDoc(n) ? "quit" : false;
131807
+ });
131732
131808
  }
131733
131809
  function getPropertiesForObjectExpression(contextualType, completionsType, obj, checker) {
131734
131810
  var hasCompletionsType = completionsType && completionsType !== contextualType;
@@ -141484,7 +141560,7 @@ var ts;
141484
141560
  displayParts.push(ts.spacePart());
141485
141561
  displayParts.push(ts.operatorPart(63 /* EqualsToken */));
141486
141562
  displayParts.push(ts.spacePart());
141487
- ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 8388608 /* InTypeAlias */));
141563
+ ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, ts.isConstTypeReference(location.parent) ? typeChecker.getTypeAtLocation(location.parent) : typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 8388608 /* InTypeAlias */));
141488
141564
  }
141489
141565
  if (symbolFlags & 384 /* Enum */) {
141490
141566
  prefixNextMeaning();
@@ -5352,7 +5352,11 @@ declare namespace ts {
5352
5352
  traceResolution?: boolean;
5353
5353
  [option: string]: CompilerOptionsValue | undefined;
5354
5354
  }
5355
- type ReportEmitErrorSummary = (errorCount: number) => void;
5355
+ type ReportEmitErrorSummary = (errorCount: number, filesInError: (ReportFileInError | undefined)[]) => void;
5356
+ interface ReportFileInError {
5357
+ fileName: string;
5358
+ line: number;
5359
+ }
5356
5360
  interface SolutionBuilderHostBase<T extends BuilderProgram> extends ProgramHost<T> {
5357
5361
  createDirectory?(path: string): void;
5358
5362
  /**