@typescript-deploys/pr-build 4.6.0-pr-47000-3 → 4.6.0-pr-47050-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.
@@ -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-insiders.20211206";
297
+ ts.version = ts.versionMajorMinor + ".0-insiders.20211208";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -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;
@@ -57518,7 +57526,7 @@ var ts;
57518
57526
  }
57519
57527
  if (t.flags & 268435456 /* StringMapping */) {
57520
57528
  var constraint = getBaseConstraint(t.type);
57521
- return constraint ? getStringMappingType(t.symbol, constraint) : stringType;
57529
+ return constraint && constraint !== t.type ? getStringMappingType(t.symbol, constraint) : stringType;
57522
57530
  }
57523
57531
  if (t.flags & 8388608 /* IndexedAccess */) {
57524
57532
  var baseObjectType = getBaseConstraint(t.objectType);
@@ -60389,9 +60397,12 @@ var ts;
60389
60397
  }
60390
60398
  function getStringMappingType(symbol, type) {
60391
60399
  return type.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapType(type, function (t) { return getStringMappingType(symbol, t); }) :
60392
- isGenericIndexType(type) ? getStringMappingTypeForGenericType(symbol, type) :
60393
- type.flags & 128 /* StringLiteral */ ? getStringLiteralType(applyStringMapping(symbol, type.value)) :
60394
- type;
60400
+ // Mapping<Mapping<T>> === Mapping<T>
60401
+ type.flags & 268435456 /* StringMapping */ && symbol === type.symbol ? type :
60402
+ isGenericIndexType(type) || isPatternLiteralPlaceholderType(type) ? getStringMappingTypeForGenericType(symbol, isPatternLiteralPlaceholderType(type) && !(type.flags & 268435456 /* StringMapping */) ? getTemplateLiteralType(["", ""], [type]) : type) :
60403
+ type.flags & 128 /* StringLiteral */ ? getStringLiteralType(applyStringMapping(symbol, type.value)) :
60404
+ type.flags & 134217728 /* TemplateLiteral */ ? getTemplateLiteralType.apply(void 0, applyTemplateStringMapping(symbol, type.texts, type.types)) :
60405
+ type;
60395
60406
  }
60396
60407
  function applyStringMapping(symbol, str) {
60397
60408
  switch (intrinsicTypeKinds.get(symbol.escapedName)) {
@@ -60402,6 +60413,15 @@ var ts;
60402
60413
  }
60403
60414
  return str;
60404
60415
  }
60416
+ function applyTemplateStringMapping(symbol, texts, types) {
60417
+ switch (intrinsicTypeKinds.get(symbol.escapedName)) {
60418
+ case 0 /* Uppercase */: return [texts.map(function (t) { return t.toUpperCase(); }), types.map(function (t) { return getStringMappingType(symbol, t); })];
60419
+ case 1 /* Lowercase */: return [texts.map(function (t) { return t.toLowerCase(); }), types.map(function (t) { return getStringMappingType(symbol, t); })];
60420
+ case 2 /* Capitalize */: return [texts[0] === "" ? texts : __spreadArray([texts[0].charAt(0).toUpperCase() + texts[0].slice(1)], texts.slice(1), true), texts[0] === "" ? __spreadArray([getStringMappingType(symbol, types[0])], types.slice(1), true) : types];
60421
+ case 3 /* Uncapitalize */: return [texts[0] === "" ? texts : __spreadArray([texts[0].charAt(0).toLowerCase() + texts[0].slice(1)], texts.slice(1), true), texts[0] === "" ? __spreadArray([getStringMappingType(symbol, types[0])], types.slice(1), true) : types];
60422
+ }
60423
+ return [texts, types];
60424
+ }
60405
60425
  function getStringMappingTypeForGenericType(symbol, type) {
60406
60426
  var id = getSymbolId(symbol) + "," + getTypeId(type);
60407
60427
  var result = stringMappingTypes.get(id);
@@ -60643,7 +60663,7 @@ var ts;
60643
60663
  accessNode;
60644
60664
  }
60645
60665
  function isPatternLiteralPlaceholderType(type) {
60646
- return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */));
60666
+ return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) || !!(type.flags & 268435456 /* StringMapping */ && isPatternLiteralPlaceholderType(type.type));
60647
60667
  }
60648
60668
  function isPatternLiteralType(type) {
60649
60669
  return !!(type.flags & 134217728 /* TemplateLiteral */) && ts.every(type.types, isPatternLiteralPlaceholderType);
@@ -64242,6 +64262,13 @@ var ts;
64242
64262
  return -1 /* True */;
64243
64263
  }
64244
64264
  }
64265
+ else if (target.flags & 268435456 /* StringMapping */) {
64266
+ if (!(source.flags & 268435456 /* StringMapping */)) {
64267
+ if (isUnchangedByStringMapping(target.symbol, source)) {
64268
+ return -1 /* True */;
64269
+ }
64270
+ }
64271
+ }
64245
64272
  if (source.flags & 8650752 /* TypeVariable */) {
64246
64273
  // IndexedAccess comparisons are handled above in the `target.flags & TypeFlage.IndexedAccess` branch
64247
64274
  if (!(source.flags & 8388608 /* IndexedAccess */ && target.flags & 8388608 /* IndexedAccess */)) {
@@ -64281,7 +64308,10 @@ var ts;
64281
64308
  }
64282
64309
  }
64283
64310
  else if (source.flags & 268435456 /* StringMapping */) {
64284
- if (target.flags & 268435456 /* StringMapping */ && source.symbol === target.symbol) {
64311
+ if (target.flags & 268435456 /* StringMapping */) {
64312
+ if (source.symbol !== target.symbol) {
64313
+ return 0 /* False */;
64314
+ }
64285
64315
  if (result = isRelatedTo(source.type, target.type, 3 /* Both */, reportErrors)) {
64286
64316
  resetErrorInfo(saveErrorInfo);
64287
64317
  return result;
@@ -65176,7 +65206,7 @@ var ts;
65176
65206
  return typeCouldHaveTopLevelSingletonTypes(constraint);
65177
65207
  }
65178
65208
  }
65179
- return isUnitType(type) || !!(type.flags & 134217728 /* TemplateLiteral */);
65209
+ return isUnitType(type) || !!(type.flags & 134217728 /* TemplateLiteral */) || !!(type.flags & 268435456 /* StringMapping */);
65180
65210
  }
65181
65211
  function getExactOptionalUnassignableProperties(source, target) {
65182
65212
  if (isTupleType(source) && isTupleType(target))
@@ -66589,6 +66619,9 @@ var ts;
66589
66619
  // * it does not contain a numeric seperator (the `BigInt` constructor does not accept a numeric seperator in its input)
66590
66620
  return success && result === 9 /* BigIntLiteral */ && scanner.getTextPos() === (s.length + 1) && !(flags & 512 /* ContainsSeparator */);
66591
66621
  }
66622
+ function isUnchangedByStringMapping(symbol, value) {
66623
+ return value === getStringMappingType(symbol, value);
66624
+ }
66592
66625
  function isValidTypeForTemplateLiteralPlaceholder(source, target) {
66593
66626
  if (source === target || target.flags & (1 /* Any */ | 4 /* String */)) {
66594
66627
  return true;
@@ -66597,7 +66630,8 @@ var ts;
66597
66630
  var value = source.value;
66598
66631
  return !!(target.flags & 8 /* Number */ && value !== "" && isFinite(+value) ||
66599
66632
  target.flags & 64 /* BigInt */ && value !== "" && isValidBigIntString(value) ||
66600
- target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName);
66633
+ target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName ||
66634
+ target.flags & 268435456 /* StringMapping */ && isUnchangedByStringMapping(target.symbol, getStringLiteralType(value)));
66601
66635
  }
66602
66636
  if (source.flags & 134217728 /* TemplateLiteral */) {
66603
66637
  var texts = source.texts;
@@ -119915,7 +119949,7 @@ var ts;
119915
119949
  getCanonicalFileName: ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)
119916
119950
  } : undefined;
119917
119951
  /**
119918
- * Create a function that reports error by writing to the system and handles the formating of the diagnostic
119952
+ * Create a function that reports error by writing to the system and handles the formatting of the diagnostic
119919
119953
  */
119920
119954
  function createDiagnosticReporter(system, pretty) {
119921
119955
  var host = system === ts.sys && sysFormatDiagnosticsHost ? sysFormatDiagnosticsHost : {
@@ -120001,19 +120035,74 @@ var ts;
120001
120035
  return ts.countWhere(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; });
120002
120036
  }
120003
120037
  ts.getErrorCountForSummary = getErrorCountForSummary;
120038
+ function getFilesInErrorForSummary(diagnostics) {
120039
+ var filesInError = ts.filter(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; })
120040
+ .map(function (errorDiagnostic) {
120041
+ if (errorDiagnostic.file === undefined)
120042
+ return;
120043
+ return "" + errorDiagnostic.file.fileName;
120044
+ });
120045
+ return filesInError.map(function (fileName) {
120046
+ var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
120047
+ return diagnostic.file !== undefined && diagnostic.file.fileName === fileName;
120048
+ });
120049
+ if (diagnosticForFileName !== undefined) {
120050
+ var line = ts.getLineAndCharacterOfPosition(diagnosticForFileName.file, diagnosticForFileName.start).line;
120051
+ return {
120052
+ fileName: fileName,
120053
+ line: line + 1,
120054
+ };
120055
+ }
120056
+ });
120057
+ }
120058
+ ts.getFilesInErrorForSummary = getFilesInErrorForSummary;
120004
120059
  function getWatchErrorSummaryDiagnosticMessage(errorCount) {
120005
120060
  return errorCount === 1 ?
120006
120061
  ts.Diagnostics.Found_1_error_Watching_for_file_changes :
120007
120062
  ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
120008
120063
  }
120009
120064
  ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
120010
- function getErrorSummaryText(errorCount, newLine) {
120065
+ function getErrorSummaryText(errorCount, filesInError, newLine) {
120011
120066
  if (errorCount === 0)
120012
120067
  return "";
120013
- var d = ts.createCompilerDiagnostic(errorCount === 1 ? ts.Diagnostics.Found_1_error : ts.Diagnostics.Found_0_errors, errorCount);
120014
- return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine;
120068
+ var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
120069
+ var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
120070
+ .filter(function (value, index, self) { return self.indexOf(value) === index; });
120071
+ var d = errorCount === 1 ?
120072
+ ts.createCompilerDiagnostic(filesInError[0] !== undefined ?
120073
+ ts.Diagnostics.Found_1_error_in_1 :
120074
+ ts.Diagnostics.Found_1_error, errorCount, distinctFileNamesWithLines[0]) :
120075
+ ts.createCompilerDiagnostic(distinctFileNamesWithLines.length === 0 ?
120076
+ ts.Diagnostics.Found_0_errors :
120077
+ distinctFileNamesWithLines.length === 1 ?
120078
+ ts.Diagnostics.Found_0_errors_in_1_file :
120079
+ ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length);
120080
+ return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + (errorCount > 1 ? createTabularErrorsDisplay(nonNilFiles) : "");
120015
120081
  }
120016
120082
  ts.getErrorSummaryText = getErrorSummaryText;
120083
+ function createTabularErrorsDisplay(filesInError) {
120084
+ 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); }); });
120085
+ if (distinctFiles.length === 0)
120086
+ return "";
120087
+ var numberLength = function (num) { return Math.log(num) * Math.LOG10E + 1; };
120088
+ var fileToErrorCount = distinctFiles.map(function (file) { return [file, ts.countWhere(filesInError, function (fileInError) { return fileInError.fileName === file.fileName; })]; });
120089
+ var maxErrors = fileToErrorCount.reduce(function (acc, value) { return Math.max(acc, value[1] || 0); }, 0);
120090
+ var headerRow = ts.Diagnostics.Errors_Files.message;
120091
+ var leftColumnHeadingLength = headerRow.split(" ")[0].length;
120092
+ var leftPaddingGoal = Math.max(leftColumnHeadingLength, numberLength(maxErrors));
120093
+ var headerPadding = Math.max(numberLength(maxErrors) - leftColumnHeadingLength, 0);
120094
+ var tabularData = "";
120095
+ tabularData += " ".repeat(headerPadding) + headerRow + "\n";
120096
+ fileToErrorCount.forEach(function (row) {
120097
+ var file = row[0], errorCount = row[1];
120098
+ var errorCountDigitsLength = Math.log(errorCount) * Math.LOG10E + 1 | 0;
120099
+ var leftPadding = errorCountDigitsLength < leftPaddingGoal ?
120100
+ " ".repeat(leftPaddingGoal - errorCountDigitsLength)
120101
+ : "";
120102
+ tabularData += "" + leftPadding + errorCount + " " + file.fileName + ":" + file.line + "\n";
120103
+ });
120104
+ return tabularData;
120105
+ }
120017
120106
  function isBuilderProgram(program) {
120018
120107
  return !!program.getState;
120019
120108
  }
@@ -120217,7 +120306,7 @@ var ts;
120217
120306
  listFiles(program, write);
120218
120307
  }
120219
120308
  if (reportSummary) {
120220
- reportSummary(getErrorCountForSummary(diagnostics));
120309
+ reportSummary(getErrorCountForSummary(diagnostics), getFilesInErrorForSummary(diagnostics));
120221
120310
  }
120222
120311
  return {
120223
120312
  emitResult: emitResult,
@@ -120428,7 +120517,7 @@ var ts;
120428
120517
  var system = input.system || ts.sys;
120429
120518
  var host = input.host || (input.host = ts.createIncrementalCompilerHost(input.options, system));
120430
120519
  var builderProgram = ts.createIncrementalProgram(input);
120431
- 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);
120520
+ 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);
120432
120521
  if (input.afterProgramEmitAndDiagnostics)
120433
120522
  input.afterProgramEmitAndDiagnostics(builderProgram);
120434
120523
  return exitStatus;
@@ -122647,11 +122736,14 @@ var ts;
122647
122736
  var canReportSummary = state.watch || !!state.host.reportErrorSummary;
122648
122737
  var diagnostics = state.diagnostics;
122649
122738
  var totalErrors = 0;
122739
+ var filesInError = [];
122650
122740
  if (isCircularBuildOrder(buildOrder)) {
122651
122741
  reportBuildQueue(state, buildOrder.buildOrder);
122652
122742
  reportErrors(state, buildOrder.circularDiagnostics);
122653
122743
  if (canReportSummary)
122654
122744
  totalErrors += ts.getErrorCountForSummary(buildOrder.circularDiagnostics);
122745
+ if (canReportSummary)
122746
+ filesInError = __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(buildOrder.circularDiagnostics), true);
122655
122747
  }
122656
122748
  else {
122657
122749
  // Report errors from the other projects
@@ -122663,12 +122755,14 @@ var ts;
122663
122755
  });
122664
122756
  if (canReportSummary)
122665
122757
  diagnostics.forEach(function (singleProjectErrors) { return totalErrors += ts.getErrorCountForSummary(singleProjectErrors); });
122758
+ if (canReportSummary)
122759
+ diagnostics.forEach(function (singleProjectErrors) { return __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(singleProjectErrors), true); });
122666
122760
  }
122667
122761
  if (state.watch) {
122668
122762
  reportWatchStatus(state, ts.getWatchErrorSummaryDiagnosticMessage(totalErrors), totalErrors);
122669
122763
  }
122670
122764
  else if (state.host.reportErrorSummary) {
122671
- state.host.reportErrorSummary(totalErrors);
122765
+ state.host.reportErrorSummary(totalErrors, filesInError);
122672
122766
  }
122673
122767
  }
122674
122768
  /**
@@ -127913,6 +128007,9 @@ var ts;
127913
128007
  }
127914
128008
  return;
127915
128009
  }
128010
+ if (ts.isConstTypeReference(token.parent)) {
128011
+ return 3 /* keyword */;
128012
+ }
127916
128013
  }
127917
128014
  return 2 /* identifier */;
127918
128015
  }
@@ -131733,8 +131830,10 @@ var ts;
131733
131830
  }
131734
131831
  /** Get the corresponding JSDocTag node if the position is in a jsDoc comment */
131735
131832
  function getJsDocTagAtPosition(node, position) {
131736
- var jsdoc = ts.findAncestor(node, ts.isJSDoc);
131737
- return jsdoc && jsdoc.tags && (ts.rangeContainsPosition(jsdoc, position) ? ts.findLast(jsdoc.tags, function (tag) { return tag.pos < position; }) : undefined);
131833
+ return ts.findAncestor(node, function (n) {
131834
+ return ts.isJSDocTag(n) && ts.rangeContainsPosition(n, position) ? true :
131835
+ ts.isJSDoc(n) ? "quit" : false;
131836
+ });
131738
131837
  }
131739
131838
  function getPropertiesForObjectExpression(contextualType, completionsType, obj, checker) {
131740
131839
  var hasCompletionsType = completionsType && completionsType !== contextualType;
@@ -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-insiders.20211206";
297
+ ts.version = ts.versionMajorMinor + ".0-insiders.20211208";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -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;
@@ -57518,7 +57526,7 @@ var ts;
57518
57526
  }
57519
57527
  if (t.flags & 268435456 /* StringMapping */) {
57520
57528
  var constraint = getBaseConstraint(t.type);
57521
- return constraint ? getStringMappingType(t.symbol, constraint) : stringType;
57529
+ return constraint && constraint !== t.type ? getStringMappingType(t.symbol, constraint) : stringType;
57522
57530
  }
57523
57531
  if (t.flags & 8388608 /* IndexedAccess */) {
57524
57532
  var baseObjectType = getBaseConstraint(t.objectType);
@@ -60389,9 +60397,12 @@ var ts;
60389
60397
  }
60390
60398
  function getStringMappingType(symbol, type) {
60391
60399
  return type.flags & (1048576 /* Union */ | 131072 /* Never */) ? mapType(type, function (t) { return getStringMappingType(symbol, t); }) :
60392
- isGenericIndexType(type) ? getStringMappingTypeForGenericType(symbol, type) :
60393
- type.flags & 128 /* StringLiteral */ ? getStringLiteralType(applyStringMapping(symbol, type.value)) :
60394
- type;
60400
+ // Mapping<Mapping<T>> === Mapping<T>
60401
+ type.flags & 268435456 /* StringMapping */ && symbol === type.symbol ? type :
60402
+ isGenericIndexType(type) || isPatternLiteralPlaceholderType(type) ? getStringMappingTypeForGenericType(symbol, isPatternLiteralPlaceholderType(type) && !(type.flags & 268435456 /* StringMapping */) ? getTemplateLiteralType(["", ""], [type]) : type) :
60403
+ type.flags & 128 /* StringLiteral */ ? getStringLiteralType(applyStringMapping(symbol, type.value)) :
60404
+ type.flags & 134217728 /* TemplateLiteral */ ? getTemplateLiteralType.apply(void 0, applyTemplateStringMapping(symbol, type.texts, type.types)) :
60405
+ type;
60395
60406
  }
60396
60407
  function applyStringMapping(symbol, str) {
60397
60408
  switch (intrinsicTypeKinds.get(symbol.escapedName)) {
@@ -60402,6 +60413,15 @@ var ts;
60402
60413
  }
60403
60414
  return str;
60404
60415
  }
60416
+ function applyTemplateStringMapping(symbol, texts, types) {
60417
+ switch (intrinsicTypeKinds.get(symbol.escapedName)) {
60418
+ case 0 /* Uppercase */: return [texts.map(function (t) { return t.toUpperCase(); }), types.map(function (t) { return getStringMappingType(symbol, t); })];
60419
+ case 1 /* Lowercase */: return [texts.map(function (t) { return t.toLowerCase(); }), types.map(function (t) { return getStringMappingType(symbol, t); })];
60420
+ case 2 /* Capitalize */: return [texts[0] === "" ? texts : __spreadArray([texts[0].charAt(0).toUpperCase() + texts[0].slice(1)], texts.slice(1), true), texts[0] === "" ? __spreadArray([getStringMappingType(symbol, types[0])], types.slice(1), true) : types];
60421
+ case 3 /* Uncapitalize */: return [texts[0] === "" ? texts : __spreadArray([texts[0].charAt(0).toLowerCase() + texts[0].slice(1)], texts.slice(1), true), texts[0] === "" ? __spreadArray([getStringMappingType(symbol, types[0])], types.slice(1), true) : types];
60422
+ }
60423
+ return [texts, types];
60424
+ }
60405
60425
  function getStringMappingTypeForGenericType(symbol, type) {
60406
60426
  var id = getSymbolId(symbol) + "," + getTypeId(type);
60407
60427
  var result = stringMappingTypes.get(id);
@@ -60643,7 +60663,7 @@ var ts;
60643
60663
  accessNode;
60644
60664
  }
60645
60665
  function isPatternLiteralPlaceholderType(type) {
60646
- return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */));
60666
+ return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) || !!(type.flags & 268435456 /* StringMapping */ && isPatternLiteralPlaceholderType(type.type));
60647
60667
  }
60648
60668
  function isPatternLiteralType(type) {
60649
60669
  return !!(type.flags & 134217728 /* TemplateLiteral */) && ts.every(type.types, isPatternLiteralPlaceholderType);
@@ -64242,6 +64262,13 @@ var ts;
64242
64262
  return -1 /* True */;
64243
64263
  }
64244
64264
  }
64265
+ else if (target.flags & 268435456 /* StringMapping */) {
64266
+ if (!(source.flags & 268435456 /* StringMapping */)) {
64267
+ if (isUnchangedByStringMapping(target.symbol, source)) {
64268
+ return -1 /* True */;
64269
+ }
64270
+ }
64271
+ }
64245
64272
  if (source.flags & 8650752 /* TypeVariable */) {
64246
64273
  // IndexedAccess comparisons are handled above in the `target.flags & TypeFlage.IndexedAccess` branch
64247
64274
  if (!(source.flags & 8388608 /* IndexedAccess */ && target.flags & 8388608 /* IndexedAccess */)) {
@@ -64281,7 +64308,10 @@ var ts;
64281
64308
  }
64282
64309
  }
64283
64310
  else if (source.flags & 268435456 /* StringMapping */) {
64284
- if (target.flags & 268435456 /* StringMapping */ && source.symbol === target.symbol) {
64311
+ if (target.flags & 268435456 /* StringMapping */) {
64312
+ if (source.symbol !== target.symbol) {
64313
+ return 0 /* False */;
64314
+ }
64285
64315
  if (result = isRelatedTo(source.type, target.type, 3 /* Both */, reportErrors)) {
64286
64316
  resetErrorInfo(saveErrorInfo);
64287
64317
  return result;
@@ -65176,7 +65206,7 @@ var ts;
65176
65206
  return typeCouldHaveTopLevelSingletonTypes(constraint);
65177
65207
  }
65178
65208
  }
65179
- return isUnitType(type) || !!(type.flags & 134217728 /* TemplateLiteral */);
65209
+ return isUnitType(type) || !!(type.flags & 134217728 /* TemplateLiteral */) || !!(type.flags & 268435456 /* StringMapping */);
65180
65210
  }
65181
65211
  function getExactOptionalUnassignableProperties(source, target) {
65182
65212
  if (isTupleType(source) && isTupleType(target))
@@ -66589,6 +66619,9 @@ var ts;
66589
66619
  // * it does not contain a numeric seperator (the `BigInt` constructor does not accept a numeric seperator in its input)
66590
66620
  return success && result === 9 /* BigIntLiteral */ && scanner.getTextPos() === (s.length + 1) && !(flags & 512 /* ContainsSeparator */);
66591
66621
  }
66622
+ function isUnchangedByStringMapping(symbol, value) {
66623
+ return value === getStringMappingType(symbol, value);
66624
+ }
66592
66625
  function isValidTypeForTemplateLiteralPlaceholder(source, target) {
66593
66626
  if (source === target || target.flags & (1 /* Any */ | 4 /* String */)) {
66594
66627
  return true;
@@ -66597,7 +66630,8 @@ var ts;
66597
66630
  var value = source.value;
66598
66631
  return !!(target.flags & 8 /* Number */ && value !== "" && isFinite(+value) ||
66599
66632
  target.flags & 64 /* BigInt */ && value !== "" && isValidBigIntString(value) ||
66600
- target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName);
66633
+ target.flags & (512 /* BooleanLiteral */ | 98304 /* Nullable */) && value === target.intrinsicName ||
66634
+ target.flags & 268435456 /* StringMapping */ && isUnchangedByStringMapping(target.symbol, getStringLiteralType(value)));
66601
66635
  }
66602
66636
  if (source.flags & 134217728 /* TemplateLiteral */) {
66603
66637
  var texts = source.texts;
@@ -119915,7 +119949,7 @@ var ts;
119915
119949
  getCanonicalFileName: ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)
119916
119950
  } : undefined;
119917
119951
  /**
119918
- * Create a function that reports error by writing to the system and handles the formating of the diagnostic
119952
+ * Create a function that reports error by writing to the system and handles the formatting of the diagnostic
119919
119953
  */
119920
119954
  function createDiagnosticReporter(system, pretty) {
119921
119955
  var host = system === ts.sys && sysFormatDiagnosticsHost ? sysFormatDiagnosticsHost : {
@@ -120001,19 +120035,74 @@ var ts;
120001
120035
  return ts.countWhere(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; });
120002
120036
  }
120003
120037
  ts.getErrorCountForSummary = getErrorCountForSummary;
120038
+ function getFilesInErrorForSummary(diagnostics) {
120039
+ var filesInError = ts.filter(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; })
120040
+ .map(function (errorDiagnostic) {
120041
+ if (errorDiagnostic.file === undefined)
120042
+ return;
120043
+ return "" + errorDiagnostic.file.fileName;
120044
+ });
120045
+ return filesInError.map(function (fileName) {
120046
+ var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
120047
+ return diagnostic.file !== undefined && diagnostic.file.fileName === fileName;
120048
+ });
120049
+ if (diagnosticForFileName !== undefined) {
120050
+ var line = ts.getLineAndCharacterOfPosition(diagnosticForFileName.file, diagnosticForFileName.start).line;
120051
+ return {
120052
+ fileName: fileName,
120053
+ line: line + 1,
120054
+ };
120055
+ }
120056
+ });
120057
+ }
120058
+ ts.getFilesInErrorForSummary = getFilesInErrorForSummary;
120004
120059
  function getWatchErrorSummaryDiagnosticMessage(errorCount) {
120005
120060
  return errorCount === 1 ?
120006
120061
  ts.Diagnostics.Found_1_error_Watching_for_file_changes :
120007
120062
  ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
120008
120063
  }
120009
120064
  ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
120010
- function getErrorSummaryText(errorCount, newLine) {
120065
+ function getErrorSummaryText(errorCount, filesInError, newLine) {
120011
120066
  if (errorCount === 0)
120012
120067
  return "";
120013
- var d = ts.createCompilerDiagnostic(errorCount === 1 ? ts.Diagnostics.Found_1_error : ts.Diagnostics.Found_0_errors, errorCount);
120014
- return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine;
120068
+ var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
120069
+ var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
120070
+ .filter(function (value, index, self) { return self.indexOf(value) === index; });
120071
+ var d = errorCount === 1 ?
120072
+ ts.createCompilerDiagnostic(filesInError[0] !== undefined ?
120073
+ ts.Diagnostics.Found_1_error_in_1 :
120074
+ ts.Diagnostics.Found_1_error, errorCount, distinctFileNamesWithLines[0]) :
120075
+ ts.createCompilerDiagnostic(distinctFileNamesWithLines.length === 0 ?
120076
+ ts.Diagnostics.Found_0_errors :
120077
+ distinctFileNamesWithLines.length === 1 ?
120078
+ ts.Diagnostics.Found_0_errors_in_1_file :
120079
+ ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length);
120080
+ return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + (errorCount > 1 ? createTabularErrorsDisplay(nonNilFiles) : "");
120015
120081
  }
120016
120082
  ts.getErrorSummaryText = getErrorSummaryText;
120083
+ function createTabularErrorsDisplay(filesInError) {
120084
+ 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); }); });
120085
+ if (distinctFiles.length === 0)
120086
+ return "";
120087
+ var numberLength = function (num) { return Math.log(num) * Math.LOG10E + 1; };
120088
+ var fileToErrorCount = distinctFiles.map(function (file) { return [file, ts.countWhere(filesInError, function (fileInError) { return fileInError.fileName === file.fileName; })]; });
120089
+ var maxErrors = fileToErrorCount.reduce(function (acc, value) { return Math.max(acc, value[1] || 0); }, 0);
120090
+ var headerRow = ts.Diagnostics.Errors_Files.message;
120091
+ var leftColumnHeadingLength = headerRow.split(" ")[0].length;
120092
+ var leftPaddingGoal = Math.max(leftColumnHeadingLength, numberLength(maxErrors));
120093
+ var headerPadding = Math.max(numberLength(maxErrors) - leftColumnHeadingLength, 0);
120094
+ var tabularData = "";
120095
+ tabularData += " ".repeat(headerPadding) + headerRow + "\n";
120096
+ fileToErrorCount.forEach(function (row) {
120097
+ var file = row[0], errorCount = row[1];
120098
+ var errorCountDigitsLength = Math.log(errorCount) * Math.LOG10E + 1 | 0;
120099
+ var leftPadding = errorCountDigitsLength < leftPaddingGoal ?
120100
+ " ".repeat(leftPaddingGoal - errorCountDigitsLength)
120101
+ : "";
120102
+ tabularData += "" + leftPadding + errorCount + " " + file.fileName + ":" + file.line + "\n";
120103
+ });
120104
+ return tabularData;
120105
+ }
120017
120106
  function isBuilderProgram(program) {
120018
120107
  return !!program.getState;
120019
120108
  }
@@ -120217,7 +120306,7 @@ var ts;
120217
120306
  listFiles(program, write);
120218
120307
  }
120219
120308
  if (reportSummary) {
120220
- reportSummary(getErrorCountForSummary(diagnostics));
120309
+ reportSummary(getErrorCountForSummary(diagnostics), getFilesInErrorForSummary(diagnostics));
120221
120310
  }
120222
120311
  return {
120223
120312
  emitResult: emitResult,
@@ -120428,7 +120517,7 @@ var ts;
120428
120517
  var system = input.system || ts.sys;
120429
120518
  var host = input.host || (input.host = ts.createIncrementalCompilerHost(input.options, system));
120430
120519
  var builderProgram = ts.createIncrementalProgram(input);
120431
- 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);
120520
+ 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);
120432
120521
  if (input.afterProgramEmitAndDiagnostics)
120433
120522
  input.afterProgramEmitAndDiagnostics(builderProgram);
120434
120523
  return exitStatus;
@@ -122647,11 +122736,14 @@ var ts;
122647
122736
  var canReportSummary = state.watch || !!state.host.reportErrorSummary;
122648
122737
  var diagnostics = state.diagnostics;
122649
122738
  var totalErrors = 0;
122739
+ var filesInError = [];
122650
122740
  if (isCircularBuildOrder(buildOrder)) {
122651
122741
  reportBuildQueue(state, buildOrder.buildOrder);
122652
122742
  reportErrors(state, buildOrder.circularDiagnostics);
122653
122743
  if (canReportSummary)
122654
122744
  totalErrors += ts.getErrorCountForSummary(buildOrder.circularDiagnostics);
122745
+ if (canReportSummary)
122746
+ filesInError = __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(buildOrder.circularDiagnostics), true);
122655
122747
  }
122656
122748
  else {
122657
122749
  // Report errors from the other projects
@@ -122663,12 +122755,14 @@ var ts;
122663
122755
  });
122664
122756
  if (canReportSummary)
122665
122757
  diagnostics.forEach(function (singleProjectErrors) { return totalErrors += ts.getErrorCountForSummary(singleProjectErrors); });
122758
+ if (canReportSummary)
122759
+ diagnostics.forEach(function (singleProjectErrors) { return __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(singleProjectErrors), true); });
122666
122760
  }
122667
122761
  if (state.watch) {
122668
122762
  reportWatchStatus(state, ts.getWatchErrorSummaryDiagnosticMessage(totalErrors), totalErrors);
122669
122763
  }
122670
122764
  else if (state.host.reportErrorSummary) {
122671
- state.host.reportErrorSummary(totalErrors);
122765
+ state.host.reportErrorSummary(totalErrors, filesInError);
122672
122766
  }
122673
122767
  }
122674
122768
  /**
@@ -127913,6 +128007,9 @@ var ts;
127913
128007
  }
127914
128008
  return;
127915
128009
  }
128010
+ if (ts.isConstTypeReference(token.parent)) {
128011
+ return 3 /* keyword */;
128012
+ }
127916
128013
  }
127917
128014
  return 2 /* identifier */;
127918
128015
  }
@@ -131733,8 +131830,10 @@ var ts;
131733
131830
  }
131734
131831
  /** Get the corresponding JSDocTag node if the position is in a jsDoc comment */
131735
131832
  function getJsDocTagAtPosition(node, position) {
131736
- var jsdoc = ts.findAncestor(node, ts.isJSDoc);
131737
- return jsdoc && jsdoc.tags && (ts.rangeContainsPosition(jsdoc, position) ? ts.findLast(jsdoc.tags, function (tag) { return tag.pos < position; }) : undefined);
131833
+ return ts.findAncestor(node, function (n) {
131834
+ return ts.isJSDocTag(n) && ts.rangeContainsPosition(n, position) ? true :
131835
+ ts.isJSDoc(n) ? "quit" : false;
131836
+ });
131738
131837
  }
131739
131838
  function getPropertiesForObjectExpression(contextualType, completionsType, obj, checker) {
131740
131839
  var hasCompletionsType = completionsType && completionsType !== contextualType;