@typescript-deploys/pr-build 5.9.0-pr-61913-11 → 5.9.0-pr-62126-3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/_tsc.js CHANGED
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.9";
21
- var version = `${versionMajorMinor}.0-insiders.20250623`;
21
+ var version = `${versionMajorMinor}.0-insiders.20250725`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -6014,15 +6014,16 @@ var Diagnostics = {
6014
6014
  An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration: diag(1283, 1 /* Error */, "An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolve_1283", "An 'export =' declaration must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration."),
6015
6015
  An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type: diag(1284, 1 /* Error */, "An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_1284", "An 'export default' must reference a value when 'verbatimModuleSyntax' is enabled, but '{0}' only refers to a type."),
6016
6016
  An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration: diag(1285, 1 /* Error */, "An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_1285", "An 'export default' must reference a real value when 'verbatimModuleSyntax' is enabled, but '{0}' resolves to a type-only declaration."),
6017
- ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: diag(1286, 1 /* Error */, "ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled_1286", "ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled."),
6017
+ ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax: diag(1286, 1 /* Error */, "ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_1286", "ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'."),
6018
6018
  A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled: diag(1287, 1 /* Error */, "A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimM_1287", "A top-level 'export' modifier cannot be used on value declarations in a CommonJS module when 'verbatimModuleSyntax' is enabled."),
6019
6019
  An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled: diag(1288, 1 /* Error */, "An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabl_1288", "An import alias cannot resolve to a type or type-only declaration when 'verbatimModuleSyntax' is enabled."),
6020
6020
  _0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported: diag(1289, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1289", "'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."),
6021
6021
  _0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default: diag(1290, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1290", "'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),
6022
6022
  _0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported: diag(1291, 1 /* Error */, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1291", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."),
6023
6023
  _0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default: diag(1292, 1 /* Error */, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1292", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),
6024
- ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve: diag(1293, 1 /* Error */, "ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293", "ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'."),
6024
+ ECMAScript_module_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve: diag(1293, 1 /* Error */, "ECMAScript_module_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293", "ECMAScript module syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'."),
6025
6025
  This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled: diag(1294, 1 /* Error */, "This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled_1294", "This syntax is not allowed when 'erasableSyntaxOnly' is enabled."),
6026
+ ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_Adjust_the_type_field_in_the_nearest_package_json_to_make_this_file_an_ECMAScript_module_or_adjust_your_verbatimModuleSyntax_module_and_moduleResolution_settings_in_TypeScript: diag(1295, 1 /* Error */, "ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_Adjus_1295", "ECMAScript imports and exports cannot be written in a CommonJS file under 'verbatimModuleSyntax'. Adjust the 'type' field in the nearest 'package.json' to make this file an ECMAScript module, or adjust your 'verbatimModuleSyntax', 'module', and 'moduleResolution' settings in TypeScript."),
6026
6027
  with_statements_are_not_allowed_in_an_async_function_block: diag(1300, 1 /* Error */, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."),
6027
6028
  await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, 1 /* Error */, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."),
6028
6029
  The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level: diag(1309, 1 /* Error */, "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309", "The current file is a CommonJS module and cannot use 'await' at the top level."),
@@ -6344,6 +6345,7 @@ var Diagnostics = {
6344
6345
  This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_version_of_0: diag(2343, 1 /* Error */, "This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343", "This syntax requires an imported helper named '{1}' which does not exist in '{0}'. Consider upgrading your version of '{0}'."),
6345
6346
  Type_0_does_not_satisfy_the_constraint_1: diag(2344, 1 /* Error */, "Type_0_does_not_satisfy_the_constraint_1_2344", "Type '{0}' does not satisfy the constraint '{1}'."),
6346
6347
  Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: diag(2345, 1 /* Error */, "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_2345", "Argument of type '{0}' is not assignable to parameter of type '{1}'."),
6348
+ Call_target_does_not_contain_any_signatures: diag(2346, 1 /* Error */, "Call_target_does_not_contain_any_signatures_2346", "Call target does not contain any signatures."),
6347
6349
  Untyped_function_calls_may_not_accept_type_arguments: diag(2347, 1 /* Error */, "Untyped_function_calls_may_not_accept_type_arguments_2347", "Untyped function calls may not accept type arguments."),
6348
6350
  Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: diag(2348, 1 /* Error */, "Value_of_type_0_is_not_callable_Did_you_mean_to_include_new_2348", "Value of type '{0}' is not callable. Did you mean to include 'new'?"),
6349
6351
  This_expression_is_not_callable: diag(2349, 1 /* Error */, "This_expression_is_not_callable_2349", "This expression is not callable."),
@@ -6685,7 +6687,7 @@ var Diagnostics = {
6685
6687
  Cannot_invoke_an_object_which_is_possibly_undefined: diag(2722, 1 /* Error */, "Cannot_invoke_an_object_which_is_possibly_undefined_2722", "Cannot invoke an object which is possibly 'undefined'."),
6686
6688
  Cannot_invoke_an_object_which_is_possibly_null_or_undefined: diag(2723, 1 /* Error */, "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723", "Cannot invoke an object which is possibly 'null' or 'undefined'."),
6687
6689
  _0_has_no_exported_member_named_1_Did_you_mean_2: diag(2724, 1 /* Error */, "_0_has_no_exported_member_named_1_Did_you_mean_2_2724", "'{0}' has no exported member named '{1}'. Did you mean '{2}'?"),
6688
- Class_name_cannot_be_Object_when_targeting_ES5_with_module_0: diag(2725, 1 /* Error */, "Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725", "Class name cannot be 'Object' when targeting ES5 with module {0}."),
6690
+ Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0: diag(2725, 1 /* Error */, "Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0_2725", "Class name cannot be 'Object' when targeting ES5 and above with module {0}."),
6689
6691
  Cannot_find_lib_definition_for_0: diag(2726, 1 /* Error */, "Cannot_find_lib_definition_for_0_2726", "Cannot find lib definition for '{0}'."),
6690
6692
  Cannot_find_lib_definition_for_0_Did_you_mean_1: diag(2727, 1 /* Error */, "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727", "Cannot find lib definition for '{0}'. Did you mean '{1}'?"),
6691
6693
  _0_is_declared_here: diag(2728, 3 /* Message */, "_0_is_declared_here_2728", "'{0}' is declared here."),
@@ -7405,7 +7407,7 @@ var Diagnostics = {
7405
7407
  File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option: diag(6504, 1 /* Error */, "File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option_6504", "File '{0}' is a JavaScript file. Did you mean to enable the 'allowJs' option?"),
7406
7408
  Print_names_of_files_and_the_reason_they_are_part_of_the_compilation: diag(6505, 3 /* Message */, "Print_names_of_files_and_the_reason_they_are_part_of_the_compilation_6505", "Print names of files and the reason they are part of the compilation."),
7407
7409
  Consider_adding_a_declare_modifier_to_this_class: diag(6506, 3 /* Message */, "Consider_adding_a_declare_modifier_to_this_class_6506", "Consider adding a 'declare' modifier to this class."),
7408
- Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files: diag(6600, 3 /* Message */, "Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600", "Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files."),
7410
+ Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJs_option_to_get_errors_from_these_files: diag(6600, 3 /* Message */, "Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJs_option_to_get_errors_from_these__6600", "Allow JavaScript files to be a part of your program. Use the 'checkJs' option to get errors from these files."),
7409
7411
  Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export: diag(6601, 3 /* Message */, "Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export_6601", "Allow 'import x from y' when a module doesn't have a default export."),
7410
7412
  Allow_accessing_UMD_globals_from_modules: diag(6602, 3 /* Message */, "Allow_accessing_UMD_globals_from_modules_6602", "Allow accessing UMD globals from modules."),
7411
7413
  Disable_error_reporting_for_unreachable_code: diag(6603, 3 /* Message */, "Disable_error_reporting_for_unreachable_code_6603", "Disable error reporting for unreachable code."),
@@ -16080,7 +16082,7 @@ function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
16080
16082
  function getBinaryOperatorPrecedence(kind) {
16081
16083
  switch (kind) {
16082
16084
  case 61 /* QuestionQuestionToken */:
16083
- return 4 /* Coalesce */;
16085
+ return 5 /* Coalesce */;
16084
16086
  case 57 /* BarBarToken */:
16085
16087
  return 5 /* LogicalOR */;
16086
16088
  case 56 /* AmpersandAmpersandToken */:
@@ -17198,8 +17200,14 @@ function base64encode(host, input) {
17198
17200
  function readJsonOrUndefined(path, hostOrText) {
17199
17201
  const jsonText = isString(hostOrText) ? hostOrText : hostOrText.readFile(path);
17200
17202
  if (!jsonText) return void 0;
17201
- const result = parseConfigFileTextToJson(path, jsonText);
17202
- return !result.error ? result.config : void 0;
17203
+ let result = tryParseJson(jsonText);
17204
+ if (result === void 0) {
17205
+ const looseResult = parseConfigFileTextToJson(path, jsonText);
17206
+ if (!looseResult.error) {
17207
+ result = looseResult.config;
17208
+ }
17209
+ }
17210
+ return result;
17203
17211
  }
17204
17212
  function readJson(path, host) {
17205
17213
  return readJsonOrUndefined(path, host) || {};
@@ -18327,7 +18335,7 @@ function isNodeModulesOrScopedPackageDirectory(s, getCanonicalFileName) {
18327
18335
  var reservedCharacterPattern = /[^\w\s/]/g;
18328
18336
  var wildcardCharCodes = [42 /* asterisk */, 63 /* question */];
18329
18337
  var commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"];
18330
- var implicitExcludePathRegexPattern = `(?!(${commonPackageFolders.join("|")})(/|$))`;
18338
+ var implicitExcludePathRegexPattern = `(?!(?:${commonPackageFolders.join("|")})(?:/|$))`;
18331
18339
  var filesMatcher = {
18332
18340
  /**
18333
18341
  * Matches any single directory segment unless it is the last segment and a .min.js file
@@ -18335,12 +18343,12 @@ var filesMatcher = {
18335
18343
  * [^./] # matches everything up to the first . character (excluding directory separators)
18336
18344
  * (\\.(?!min\\.js$))? # matches . characters but not if they are part of the .min.js file extension
18337
18345
  */
18338
- singleAsteriskRegexFragment: "([^./]|(\\.(?!min\\.js$))?)*",
18346
+ singleAsteriskRegexFragment: "(?:[^./]|(?:\\.(?!min\\.js$))?)*",
18339
18347
  /**
18340
18348
  * Regex for the ** wildcard. Matches any number of subdirectories. When used for including
18341
18349
  * files or directories, does not match subdirectories that start with a . character
18342
18350
  */
18343
- doubleAsteriskRegexFragment: `(/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`,
18351
+ doubleAsteriskRegexFragment: `(?:/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`,
18344
18352
  replaceWildcardCharacter: (match) => replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment)
18345
18353
  };
18346
18354
  var directoriesMatcher = {
@@ -18349,12 +18357,12 @@ var directoriesMatcher = {
18349
18357
  * Regex for the ** wildcard. Matches any number of subdirectories. When used for including
18350
18358
  * files or directories, does not match subdirectories that start with a . character
18351
18359
  */
18352
- doubleAsteriskRegexFragment: `(/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`,
18360
+ doubleAsteriskRegexFragment: `(?:/${implicitExcludePathRegexPattern}[^/.][^/]*)*?`,
18353
18361
  replaceWildcardCharacter: (match) => replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment)
18354
18362
  };
18355
18363
  var excludeMatcher = {
18356
18364
  singleAsteriskRegexFragment: "[^/]*",
18357
- doubleAsteriskRegexFragment: "(/.+?)?",
18365
+ doubleAsteriskRegexFragment: "(?:/.+?)?",
18358
18366
  replaceWildcardCharacter: (match) => replaceWildcardCharacter(match, excludeMatcher.singleAsteriskRegexFragment)
18359
18367
  };
18360
18368
  var wildcardMatchers = {
@@ -18367,9 +18375,9 @@ function getRegularExpressionForWildcard(specs, basePath, usage) {
18367
18375
  if (!patterns || !patterns.length) {
18368
18376
  return void 0;
18369
18377
  }
18370
- const pattern = patterns.map((pattern2) => `(${pattern2})`).join("|");
18371
- const terminator = usage === "exclude" ? "($|/)" : "$";
18372
- return `^(${pattern})${terminator}`;
18378
+ const pattern = patterns.map((pattern2) => `(?:${pattern2})`).join("|");
18379
+ const terminator = usage === "exclude" ? "(?:$|/)" : "$";
18380
+ return `^(?:${pattern})${terminator}`;
18373
18381
  }
18374
18382
  function getRegularExpressionsForWildcards(specs, basePath, usage) {
18375
18383
  if (specs === void 0 || specs.length === 0) {
@@ -18382,7 +18390,7 @@ function isImplicitGlob(lastPathComponent) {
18382
18390
  }
18383
18391
  function getPatternFromSpec(spec, basePath, usage) {
18384
18392
  const pattern = spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage]);
18385
- return pattern && `^(${pattern})${usage === "exclude" ? "($|/)" : "$"}`;
18393
+ return pattern && `^(?:${pattern})${usage === "exclude" ? "(?:$|/)" : "$"}`;
18386
18394
  }
18387
18395
  function getSubPatternFromSpec(spec, basePath, usage, { singleAsteriskRegexFragment, doubleAsteriskRegexFragment, replaceWildcardCharacter: replaceWildcardCharacter2 } = wildcardMatchers[usage]) {
18388
18396
  let subpattern = "";
@@ -18402,7 +18410,7 @@ function getSubPatternFromSpec(spec, basePath, usage, { singleAsteriskRegexFragm
18402
18410
  subpattern += doubleAsteriskRegexFragment;
18403
18411
  } else {
18404
18412
  if (usage === "directories") {
18405
- subpattern += "(";
18413
+ subpattern += "(?:";
18406
18414
  optionalCount++;
18407
18415
  }
18408
18416
  if (hasWrittenComponent) {
@@ -18411,7 +18419,7 @@ function getSubPatternFromSpec(spec, basePath, usage, { singleAsteriskRegexFragm
18411
18419
  if (usage !== "exclude") {
18412
18420
  let componentPattern = "";
18413
18421
  if (component.charCodeAt(0) === 42 /* asterisk */) {
18414
- componentPattern += "([^./]" + singleAsteriskRegexFragment + ")?";
18422
+ componentPattern += "(?:[^./]" + singleAsteriskRegexFragment + ")?";
18415
18423
  component = component.substr(1);
18416
18424
  } else if (component.charCodeAt(0) === 63 /* question */) {
18417
18425
  componentPattern += "[^./]";
@@ -31211,6 +31219,7 @@ var Parser;
31211
31219
  /*skipKeyword*/
31212
31220
  true
31213
31221
  );
31222
+ parseOptional(28 /* CommaToken */);
31214
31223
  if (!parseExpected(20 /* CloseBraceToken */)) {
31215
31224
  const lastError = lastOrUndefined(parseDiagnostics);
31216
31225
  if (lastError && lastError.code === Diagnostics._0_expected.code) {
@@ -31968,10 +31977,13 @@ var Parser;
31968
31977
  if (token() !== 27 /* SemicolonToken */ && token() !== 100 /* FunctionKeyword */ && token() !== 86 /* ClassKeyword */ && isStartOfStatement() && !isStartOfExpressionStatement()) {
31969
31978
  return parseFunctionBlock(16 /* IgnoreMissingOpenBrace */ | (isAsync ? 2 /* Await */ : 0 /* None */));
31970
31979
  }
31980
+ const savedYieldContext = inYieldContext();
31981
+ setYieldContext(false);
31971
31982
  const savedTopLevel = topLevel;
31972
31983
  topLevel = false;
31973
31984
  const node = isAsync ? doInAwaitContext(() => parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction)) : doOutsideOfAwaitContext(() => parseAssignmentExpressionOrHigher(allowReturnTypeInArrowFunction));
31974
31985
  topLevel = savedTopLevel;
31986
+ setYieldContext(savedYieldContext);
31975
31987
  return node;
31976
31988
  }
31977
31989
  function parseConditionalExpressionRest(leftOperand, pos, allowReturnTypeInArrowFunction) {
@@ -36837,7 +36849,7 @@ var commandOptionsWithoutBuild = [
36837
36849
  affectsBuildInfo: true,
36838
36850
  showInSimplifiedHelpView: true,
36839
36851
  category: Diagnostics.JavaScript_Support,
36840
- description: Diagnostics.Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files,
36852
+ description: Diagnostics.Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJs_option_to_get_errors_from_these_files,
36841
36853
  defaultValueDescription: false
36842
36854
  },
36843
36855
  {
@@ -47216,6 +47228,7 @@ function createTypeChecker(host) {
47216
47228
  }
47217
47229
  };
47218
47230
  var anyIterationTypes = createIterationTypes(anyType, anyType, anyType);
47231
+ var silentNeverIterationTypes = createIterationTypes(silentNeverType, silentNeverType, silentNeverType);
47219
47232
  var asyncIterationTypesResolver = {
47220
47233
  iterableCacheKey: "iterationTypesOfAsyncIterable",
47221
47234
  iteratorCacheKey: "iterationTypesOfAsyncIterator",
@@ -47503,6 +47516,15 @@ function createTypeChecker(host) {
47503
47516
  diagnostics.add(diagnostic);
47504
47517
  return diagnostic;
47505
47518
  }
47519
+ function getVerbatimModuleSyntaxErrorMessage(node) {
47520
+ const sourceFile = getSourceFileOfNode(node);
47521
+ const fileName = sourceFile.fileName;
47522
+ if (fileExtensionIsOneOf(fileName, [".cts" /* Cts */, ".cjs" /* Cjs */])) {
47523
+ return Diagnostics.ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax;
47524
+ } else {
47525
+ return Diagnostics.ECMAScript_imports_and_exports_cannot_be_written_in_a_CommonJS_file_under_verbatimModuleSyntax_Adjust_the_type_field_in_the_nearest_package_json_to_make_this_file_an_ECMAScript_module_or_adjust_your_verbatimModuleSyntax_module_and_moduleResolution_settings_in_TypeScript;
47526
+ }
47527
+ }
47506
47528
  function addErrorOrSuggestion(isError, diagnostic) {
47507
47529
  if (isError) {
47508
47530
  diagnostics.add(diagnostic);
@@ -50429,7 +50451,14 @@ function createTypeChecker(host) {
50429
50451
  if (symbol.flags & 2097152 /* Alias */ && isInJSFile(declaration) && ((_a = declaration.parent) == null ? void 0 : _a.parent) && isVariableDeclaration(declaration.parent.parent) && ((_b = declaration.parent.parent.parent) == null ? void 0 : _b.parent) && isVariableStatement(declaration.parent.parent.parent.parent) && !hasSyntacticModifier(declaration.parent.parent.parent.parent, 32 /* Export */) && declaration.parent.parent.parent.parent.parent && isDeclarationVisible(declaration.parent.parent.parent.parent.parent)) {
50430
50452
  return addVisibleAlias(declaration, declaration.parent.parent.parent.parent);
50431
50453
  } else if (symbol.flags & 2 /* BlockScopedVariable */) {
50432
- const variableStatement = findAncestor(declaration, isVariableStatement);
50454
+ const rootDeclaration = walkUpBindingElementsAndPatterns(declaration);
50455
+ if (rootDeclaration.kind === 170 /* Parameter */) {
50456
+ return false;
50457
+ }
50458
+ const variableStatement = rootDeclaration.parent.parent;
50459
+ if (variableStatement.kind !== 244 /* VariableStatement */) {
50460
+ return false;
50461
+ }
50433
50462
  if (hasSyntacticModifier(variableStatement, 32 /* Export */)) {
50434
50463
  return true;
50435
50464
  }
@@ -50574,7 +50603,7 @@ function createTypeChecker(host) {
50574
50603
  }
50575
50604
  }
50576
50605
  function typeToString(type, enclosingDeclaration, flags = 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */, writer = createTextWriter(""), maximumLength, verbosityLevel, out) {
50577
- const noTruncation = compilerOptions.noErrorTruncation || flags & 1 /* NoTruncation */;
50606
+ const noTruncation = !maximumLength && compilerOptions.noErrorTruncation || flags & 1 /* NoTruncation */;
50578
50607
  const typeNode = nodeBuilder.typeToTypeNode(
50579
50608
  type,
50580
50609
  enclosingDeclaration,
@@ -52123,27 +52152,77 @@ function createTypeChecker(host) {
52123
52152
  context.approximateLength += symbolName(propertySymbol).length + 1;
52124
52153
  if (propertySymbol.flags & 98304 /* Accessor */) {
52125
52154
  const writeType = getWriteTypeOfSymbol(propertySymbol);
52126
- if (propertyType !== writeType && !isErrorType(propertyType) && !isErrorType(writeType)) {
52155
+ if (!isErrorType(propertyType) && !isErrorType(writeType)) {
52127
52156
  const symbolMapper = getSymbolLinks(propertySymbol).mapper;
52128
- const getterDeclaration = getDeclarationOfKind(propertySymbol, 178 /* GetAccessor */);
52129
- const getterSignature = getSignatureFromDeclaration(getterDeclaration);
52130
- typeElements.push(
52131
- setCommentRange2(
52132
- context,
52133
- signatureToSignatureDeclarationHelper(symbolMapper ? instantiateSignature(getterSignature, symbolMapper) : getterSignature, 178 /* GetAccessor */, context, { name: propertyName }),
52134
- getterDeclaration
52135
- )
52136
- );
52137
- const setterDeclaration = getDeclarationOfKind(propertySymbol, 179 /* SetAccessor */);
52138
- const setterSignature = getSignatureFromDeclaration(setterDeclaration);
52139
- typeElements.push(
52140
- setCommentRange2(
52141
- context,
52142
- signatureToSignatureDeclarationHelper(symbolMapper ? instantiateSignature(setterSignature, symbolMapper) : setterSignature, 179 /* SetAccessor */, context, { name: propertyName }),
52143
- setterDeclaration
52144
- )
52145
- );
52146
- return;
52157
+ const propDeclaration = getDeclarationOfKind(propertySymbol, 173 /* PropertyDeclaration */);
52158
+ if (propertyType !== writeType || propertySymbol.parent.flags & 32 /* Class */ && !propDeclaration) {
52159
+ const getterDeclaration = getDeclarationOfKind(propertySymbol, 178 /* GetAccessor */);
52160
+ if (getterDeclaration) {
52161
+ const getterSignature = getSignatureFromDeclaration(getterDeclaration);
52162
+ typeElements.push(
52163
+ setCommentRange2(
52164
+ context,
52165
+ signatureToSignatureDeclarationHelper(symbolMapper ? instantiateSignature(getterSignature, symbolMapper) : getterSignature, 178 /* GetAccessor */, context, { name: propertyName }),
52166
+ getterDeclaration
52167
+ )
52168
+ );
52169
+ }
52170
+ const setterDeclaration = getDeclarationOfKind(propertySymbol, 179 /* SetAccessor */);
52171
+ if (setterDeclaration) {
52172
+ const setterSignature = getSignatureFromDeclaration(setterDeclaration);
52173
+ typeElements.push(
52174
+ setCommentRange2(
52175
+ context,
52176
+ signatureToSignatureDeclarationHelper(symbolMapper ? instantiateSignature(setterSignature, symbolMapper) : setterSignature, 179 /* SetAccessor */, context, { name: propertyName }),
52177
+ setterDeclaration
52178
+ )
52179
+ );
52180
+ }
52181
+ return;
52182
+ }
52183
+ if (propertySymbol.parent.flags & 32 /* Class */ && propDeclaration && find(propDeclaration.modifiers, isAccessorModifier)) {
52184
+ const fakeGetterSignature = createSignature(
52185
+ /*declaration*/
52186
+ void 0,
52187
+ /*typeParameters*/
52188
+ void 0,
52189
+ /*thisParameter*/
52190
+ void 0,
52191
+ emptyArray,
52192
+ propertyType,
52193
+ /*resolvedTypePredicate*/
52194
+ void 0,
52195
+ 0,
52196
+ 0 /* None */
52197
+ );
52198
+ typeElements.push(
52199
+ setCommentRange2(
52200
+ context,
52201
+ signatureToSignatureDeclarationHelper(fakeGetterSignature, 178 /* GetAccessor */, context, { name: propertyName }),
52202
+ propDeclaration
52203
+ )
52204
+ );
52205
+ const setterParam = createSymbol(1 /* FunctionScopedVariable */, "arg");
52206
+ setterParam.links.type = writeType;
52207
+ const fakeSetterSignature = createSignature(
52208
+ /*declaration*/
52209
+ void 0,
52210
+ /*typeParameters*/
52211
+ void 0,
52212
+ /*thisParameter*/
52213
+ void 0,
52214
+ [setterParam],
52215
+ voidType,
52216
+ /*resolvedTypePredicate*/
52217
+ void 0,
52218
+ 0,
52219
+ 0 /* None */
52220
+ );
52221
+ typeElements.push(
52222
+ signatureToSignatureDeclarationHelper(fakeSetterSignature, 179 /* SetAccessor */, context, { name: propertyName })
52223
+ );
52224
+ return;
52225
+ }
52147
52226
  }
52148
52227
  }
52149
52228
  const optionalToken = propertySymbol.flags & 16777216 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0;
@@ -56734,11 +56813,14 @@ function createTypeChecker(host) {
56734
56813
  }
56735
56814
  function getWriteTypeOfSymbol(symbol) {
56736
56815
  const checkFlags = getCheckFlags(symbol);
56737
- if (symbol.flags & 4 /* Property */) {
56738
- return checkFlags & 2 /* SyntheticProperty */ ? checkFlags & 65536 /* DeferredType */ ? getWriteTypeOfSymbolWithDeferredType(symbol) || getTypeOfSymbolWithDeferredType(symbol) : (
56816
+ if (checkFlags & 2 /* SyntheticProperty */) {
56817
+ return checkFlags & 65536 /* DeferredType */ ? getWriteTypeOfSymbolWithDeferredType(symbol) || getTypeOfSymbolWithDeferredType(symbol) : (
56739
56818
  // NOTE: cast to TransientSymbol should be safe because only TransientSymbols can have CheckFlags.SyntheticProperty
56740
56819
  symbol.links.writeType || symbol.links.type
56741
- ) : removeMissingType(getTypeOfSymbol(symbol), !!(symbol.flags & 16777216 /* Optional */));
56820
+ );
56821
+ }
56822
+ if (symbol.flags & 4 /* Property */) {
56823
+ return removeMissingType(getTypeOfSymbol(symbol), !!(symbol.flags & 16777216 /* Optional */));
56742
56824
  }
56743
56825
  if (symbol.flags & 98304 /* Accessor */) {
56744
56826
  return checkFlags & 1 /* Instantiated */ ? getWriteTypeOfInstantiatedSymbol(symbol) : getWriteTypeOfAccessors(symbol);
@@ -58894,6 +58976,7 @@ function createTypeChecker(host) {
58894
58976
  }
58895
58977
  function createUnionOrIntersectionProperty(containingType, name, skipObjectFunctionPropertyAugment) {
58896
58978
  var _a, _b, _c;
58979
+ let propFlags = 0 /* None */;
58897
58980
  let singleProp;
58898
58981
  let propSet;
58899
58982
  let indexTypes;
@@ -58918,6 +59001,7 @@ function createTypeChecker(host) {
58918
59001
  }
58919
59002
  if (!singleProp) {
58920
59003
  singleProp = prop;
59004
+ propFlags = prop.flags & 98304 /* Accessor */ || 4 /* Property */;
58921
59005
  } else if (prop !== singleProp) {
58922
59006
  const isInstantiation = (getTargetSymbol(prop) || prop) === (getTargetSymbol(singleProp) || singleProp);
58923
59007
  if (isInstantiation && compareProperties(singleProp, prop, (a, b) => a === b ? -1 /* True */ : 0 /* False */) === -1 /* True */) {
@@ -58932,6 +59016,9 @@ function createTypeChecker(host) {
58932
59016
  propSet.set(id, prop);
58933
59017
  }
58934
59018
  }
59019
+ if (propFlags & 98304 /* Accessor */ && (prop.flags & 98304 /* Accessor */) !== (propFlags & 98304 /* Accessor */)) {
59020
+ propFlags = propFlags & ~98304 /* Accessor */ | 4 /* Property */;
59021
+ }
58935
59022
  }
58936
59023
  if (isUnion && isReadonlySymbol(prop)) {
58937
59024
  checkFlags |= 8 /* Readonly */;
@@ -58945,6 +59032,7 @@ function createTypeChecker(host) {
58945
59032
  } else if (isUnion) {
58946
59033
  const indexInfo = !isLateBoundName(name) && getApplicableIndexInfoForName(type, name);
58947
59034
  if (indexInfo) {
59035
+ propFlags = propFlags & ~98304 /* Accessor */ | 4 /* Property */;
58948
59036
  checkFlags |= 32 /* WritePartial */ | (indexInfo.isReadonly ? 8 /* Readonly */ : 0);
58949
59037
  indexTypes = append(indexTypes, isTupleType(type) ? getRestTypeOfTupleType(type) || undefinedType : indexInfo.type);
58950
59038
  } else if (isObjectLiteralType(type) && !(getObjectFlags(type) & 2097152 /* ContainsSpread */)) {
@@ -59008,7 +59096,7 @@ function createTypeChecker(host) {
59008
59096
  propTypes.push(type);
59009
59097
  }
59010
59098
  addRange(propTypes, indexTypes);
59011
- const result = createSymbol(4 /* Property */ | (optionalFlag ?? 0), name, syntheticFlag | checkFlags);
59099
+ const result = createSymbol(propFlags | (optionalFlag ?? 0), name, syntheticFlag | checkFlags);
59012
59100
  result.links.containingType = containingType;
59013
59101
  if (!hasNonUniformValueDeclaration && firstValueDeclaration) {
59014
59102
  result.valueDeclaration = firstValueDeclaration;
@@ -67432,9 +67520,13 @@ function createTypeChecker(host) {
67432
67520
  return types[0];
67433
67521
  }
67434
67522
  const primaryTypes = strictNullChecks ? sameMap(types, (t) => filterType(t, (u) => !(u.flags & 98304 /* Nullable */))) : types;
67435
- const superTypeOrUnion = literalTypesWithSameBaseType(primaryTypes) ? getUnionType(primaryTypes) : reduceLeft(primaryTypes, (s, t) => isTypeSubtypeOf(s, t) ? t : s);
67523
+ const superTypeOrUnion = literalTypesWithSameBaseType(primaryTypes) ? getUnionType(primaryTypes) : getSingleCommonSupertype(primaryTypes);
67436
67524
  return primaryTypes === types ? superTypeOrUnion : getNullableType(superTypeOrUnion, getCombinedTypeFlags(types) & 98304 /* Nullable */);
67437
67525
  }
67526
+ function getSingleCommonSupertype(types) {
67527
+ const candidate = reduceLeft(types, (s, t) => isTypeStrictSubtypeOf(s, t) ? t : s);
67528
+ return every(types, (t) => t === candidate || isTypeStrictSubtypeOf(t, candidate)) ? candidate : reduceLeft(types, (s, t) => isTypeSubtypeOf(s, t) ? t : s);
67529
+ }
67438
67530
  function getCommonSubtype(types) {
67439
67531
  return reduceLeft(types, (s, t) => isTypeSubtypeOf(t, s) ? t : s);
67440
67532
  }
@@ -68413,7 +68505,7 @@ function createTypeChecker(host) {
68413
68505
  function inferTypes(inferences, originalSource, originalTarget, priority = 0 /* None */, contravariant = false) {
68414
68506
  let bivariant = false;
68415
68507
  let propagationType;
68416
- let inferencePriority = 4096 /* MaxValue */;
68508
+ let inferencePriority = 2048 /* MaxValue */;
68417
68509
  let visited;
68418
68510
  let sourceStack;
68419
68511
  let targetStack;
@@ -68485,7 +68577,7 @@ function createTypeChecker(host) {
68485
68577
  }
68486
68578
  if (!inference.isFixed) {
68487
68579
  const candidate = propagationType || source;
68488
- if (candidate === blockedStringType || candidate.flags & 3 /* AnyOrUnknown */ && priority & 2048 /* ReturnMapper */) {
68580
+ if (candidate === blockedStringType) {
68489
68581
  return;
68490
68582
  }
68491
68583
  if (inference.priority === void 0 || priority < inference.priority) {
@@ -68615,7 +68707,7 @@ function createTypeChecker(host) {
68615
68707
  }
68616
68708
  (visited || (visited = /* @__PURE__ */ new Map())).set(key, -1 /* Circularity */);
68617
68709
  const saveInferencePriority = inferencePriority;
68618
- inferencePriority = 4096 /* MaxValue */;
68710
+ inferencePriority = 2048 /* MaxValue */;
68619
68711
  const saveExpandingFlags = expandingFlags;
68620
68712
  (sourceStack ?? (sourceStack = [])).push(source);
68621
68713
  (targetStack ?? (targetStack = [])).push(target);
@@ -68706,7 +68798,7 @@ function createTypeChecker(host) {
68706
68798
  } else {
68707
68799
  for (let i = 0; i < sources.length; i++) {
68708
68800
  const saveInferencePriority = inferencePriority;
68709
- inferencePriority = 4096 /* MaxValue */;
68801
+ inferencePriority = 2048 /* MaxValue */;
68710
68802
  inferFromTypes(sources[i], t);
68711
68803
  if (inferencePriority === priority) matched[i] = true;
68712
68804
  inferenceCircularity = inferenceCircularity || inferencePriority === -1 /* Circularity */;
@@ -69034,14 +69126,14 @@ function createTypeChecker(host) {
69034
69126
  return candidates;
69035
69127
  }
69036
69128
  function getContravariantInference(inference) {
69037
- return inference.priority & 2464 /* PriorityImpliesCombination */ ? getIntersectionType(inference.contraCandidates) : getCommonSubtype(inference.contraCandidates);
69129
+ return inference.priority & 416 /* PriorityImpliesCombination */ ? getIntersectionType(inference.contraCandidates) : getCommonSubtype(inference.contraCandidates);
69038
69130
  }
69039
69131
  function getCovariantInference(inference, signature) {
69040
69132
  const candidates = unionObjectAndArrayLiteralCandidates(inference.candidates);
69041
69133
  const primitiveConstraint = hasPrimitiveConstraint(inference.typeParameter) || isConstTypeVariable(inference.typeParameter);
69042
69134
  const widenLiteralTypes = !primitiveConstraint && inference.topLevel && (inference.isFixed || !isTypeParameterAtTopLevelInReturnType(signature, inference.typeParameter));
69043
69135
  const baseCandidates = primitiveConstraint ? sameMap(candidates, getRegularTypeOfLiteralType) : widenLiteralTypes ? sameMap(candidates, getWidenedLiteralType) : candidates;
69044
- const unwidenedType = inference.priority & 2464 /* PriorityImpliesCombination */ ? getUnionType(baseCandidates, 2 /* Subtype */) : getCommonSupertype(baseCandidates);
69136
+ const unwidenedType = inference.priority & 416 /* PriorityImpliesCombination */ ? getUnionType(baseCandidates, 2 /* Subtype */) : getCommonSupertype(baseCandidates);
69045
69137
  return getWidenedType(unwidenedType);
69046
69138
  }
69047
69139
  function getInferredType(context, index) {
@@ -73317,6 +73409,9 @@ function createTypeChecker(host) {
73317
73409
  }
73318
73410
  function popContextualType() {
73319
73411
  contextualTypeCount--;
73412
+ contextualTypeNodes[contextualTypeCount] = void 0;
73413
+ contextualTypes[contextualTypeCount] = void 0;
73414
+ contextualIsCache[contextualTypeCount] = void 0;
73320
73415
  }
73321
73416
  function findContextualNode(node, includeCaches) {
73322
73417
  for (let i = contextualTypeCount - 1; i >= 0; i--) {
@@ -73333,6 +73428,8 @@ function createTypeChecker(host) {
73333
73428
  }
73334
73429
  function popInferenceContext() {
73335
73430
  inferenceContextCount--;
73431
+ inferenceContextNodes[inferenceContextCount] = void 0;
73432
+ inferenceContexts[inferenceContextCount] = void 0;
73336
73433
  }
73337
73434
  function getInferenceContext(node) {
73338
73435
  for (let i = inferenceContextCount - 1; i >= 0; i--) {
@@ -73343,11 +73440,13 @@ function createTypeChecker(host) {
73343
73440
  }
73344
73441
  function pushActiveMapper(mapper) {
73345
73442
  activeTypeMappers[activeTypeMappersCount] = mapper;
73346
- activeTypeMappersCaches[activeTypeMappersCount] = /* @__PURE__ */ new Map();
73443
+ activeTypeMappersCaches[activeTypeMappersCount] ?? (activeTypeMappersCaches[activeTypeMappersCount] = /* @__PURE__ */ new Map());
73347
73444
  activeTypeMappersCount++;
73348
73445
  }
73349
73446
  function popActiveMapper() {
73350
73447
  activeTypeMappersCount--;
73448
+ activeTypeMappers[activeTypeMappersCount] = void 0;
73449
+ activeTypeMappersCaches[activeTypeMappersCount].clear();
73351
73450
  }
73352
73451
  function findActiveMapper(mapper) {
73353
73452
  for (let i = activeTypeMappersCount - 1; i >= 0; i--) {
@@ -75706,7 +75805,7 @@ function createTypeChecker(host) {
75706
75805
  }
75707
75806
  const returnContext = createInferenceContext(signature.typeParameters, signature, context.flags);
75708
75807
  const returnSourceType = instantiateType(contextualType, outerContext && createOuterReturnMapper(outerContext));
75709
- inferTypes(returnContext.inferences, returnSourceType, inferenceTargetType, 2048 /* ReturnMapper */);
75808
+ inferTypes(returnContext.inferences, returnSourceType, inferenceTargetType);
75710
75809
  context.returnMapper = some(returnContext.inferences, hasInferenceCandidates) ? getMapperFromContext(cloneInferredPartOfContext(returnContext)) : void 0;
75711
75810
  }
75712
75811
  }
@@ -76349,7 +76448,12 @@ function createTypeChecker(host) {
76349
76448
  candidates = candidatesOutArray || [];
76350
76449
  reorderCandidates(signatures, candidates, callChainFlags);
76351
76450
  if (!isJsxOpenFragment) {
76352
- Debug.assert(candidates.length, "Revert #54442 and add a testcase with whatever triggered this");
76451
+ if (!candidates.length) {
76452
+ if (reportErrors2) {
76453
+ diagnostics.add(getDiagnosticForCallNode(node, Diagnostics.Call_target_does_not_contain_any_signatures));
76454
+ }
76455
+ return resolveErrorCall(node);
76456
+ }
76353
76457
  }
76354
76458
  const args = getEffectiveCallArguments(node);
76355
76459
  const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters;
@@ -78632,6 +78736,9 @@ function createTypeChecker(host) {
78632
78736
  return { yieldTypes, nextTypes };
78633
78737
  }
78634
78738
  function getYieldedTypeOfYieldExpression(node, expressionType, sentType, isAsync) {
78739
+ if (expressionType === silentNeverType) {
78740
+ return silentNeverType;
78741
+ }
78635
78742
  const errorNode = node.expression || node;
78636
78743
  const yieldedType = node.asteriskToken ? checkIteratedTypeOrElementType(isAsync ? 19 /* AsyncYieldStar */ : 17 /* YieldStar */, expressionType, sentType, errorNode) : expressionType;
78637
78744
  return !isAsync ? yieldedType : getAwaitedType(
@@ -79665,17 +79772,27 @@ function createTypeChecker(host) {
79665
79772
  }
79666
79773
  }
79667
79774
  function checkNullishCoalesceOperands(node) {
79668
- const { left, operatorToken, right } = node;
79669
- if (operatorToken.kind === 61 /* QuestionQuestionToken */) {
79670
- if (isBinaryExpression(left) && (left.operatorToken.kind === 57 /* BarBarToken */ || left.operatorToken.kind === 56 /* AmpersandAmpersandToken */)) {
79671
- grammarErrorOnNode(left, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(left.operatorToken.kind), tokenToString(operatorToken.kind));
79775
+ if (node.operatorToken.kind !== 61 /* QuestionQuestionToken */) {
79776
+ return;
79777
+ }
79778
+ if (isBinaryExpression(node.parent)) {
79779
+ const { left, operatorToken } = node.parent;
79780
+ if (isBinaryExpression(left) && operatorToken.kind === 57 /* BarBarToken */) {
79781
+ grammarErrorOnNode(left, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(61 /* QuestionQuestionToken */), tokenToString(operatorToken.kind));
79782
+ }
79783
+ } else if (isBinaryExpression(node.left)) {
79784
+ const { operatorToken } = node.left;
79785
+ if (operatorToken.kind === 57 /* BarBarToken */ || operatorToken.kind === 56 /* AmpersandAmpersandToken */) {
79786
+ grammarErrorOnNode(node.left, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(operatorToken.kind), tokenToString(61 /* QuestionQuestionToken */));
79672
79787
  }
79673
- if (isBinaryExpression(right) && (right.operatorToken.kind === 57 /* BarBarToken */ || right.operatorToken.kind === 56 /* AmpersandAmpersandToken */)) {
79674
- grammarErrorOnNode(right, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(right.operatorToken.kind), tokenToString(operatorToken.kind));
79788
+ } else if (isBinaryExpression(node.right)) {
79789
+ const { operatorToken } = node.right;
79790
+ if (operatorToken.kind === 56 /* AmpersandAmpersandToken */) {
79791
+ grammarErrorOnNode(node.right, Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses, tokenToString(61 /* QuestionQuestionToken */), tokenToString(operatorToken.kind));
79675
79792
  }
79676
- checkNullishCoalesceOperandLeft(node);
79677
- checkNullishCoalesceOperandRight(node);
79678
79793
  }
79794
+ checkNullishCoalesceOperandLeft(node);
79795
+ checkNullishCoalesceOperandRight(node);
79679
79796
  }
79680
79797
  function checkNullishCoalesceOperandLeft(node) {
79681
79798
  const leftTarget = skipOuterExpressions(node.left, 63 /* All */);
@@ -83714,6 +83831,9 @@ function createTypeChecker(host) {
83714
83831
  }
83715
83832
  function getIterationTypesOfIterable(type, use, errorNode) {
83716
83833
  var _a, _b;
83834
+ if (type === silentNeverType) {
83835
+ return silentNeverIterationTypes;
83836
+ }
83717
83837
  if (isTypeAny(type)) {
83718
83838
  return anyIterationTypes;
83719
83839
  }
@@ -84439,7 +84559,7 @@ function createTypeChecker(host) {
84439
84559
  }
84440
84560
  function checkClassNameCollisionWithObject(name) {
84441
84561
  if (languageVersion >= 1 /* ES5 */ && name.escapedText === "Object" && host.getEmitModuleFormatOfFile(getSourceFileOfNode(name)) < 5 /* ES2015 */) {
84442
- error(name, Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_with_module_0, ModuleKind[moduleKind]);
84562
+ error(name, Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_and_above_with_module_0, ModuleKind[moduleKind]);
84443
84563
  }
84444
84564
  }
84445
84565
  function checkUnmatchedJSDocParameters(node) {
@@ -85773,9 +85893,9 @@ function createTypeChecker(host) {
85773
85893
  }
85774
85894
  }
85775
85895
  if (compilerOptions.verbatimModuleSyntax && node.kind !== 272 /* ImportEqualsDeclaration */ && !isInJSFile(node) && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) === 1 /* CommonJS */) {
85776
- error(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled);
85896
+ error(node, getVerbatimModuleSyntaxErrorMessage(node));
85777
85897
  } else if (moduleKind === 200 /* Preserve */ && node.kind !== 272 /* ImportEqualsDeclaration */ && node.kind !== 261 /* VariableDeclaration */ && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) === 1 /* CommonJS */) {
85778
- error(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve);
85898
+ error(node, Diagnostics.ECMAScript_module_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve);
85779
85899
  }
85780
85900
  if (compilerOptions.verbatimModuleSyntax && !isTypeOnlyImportOrExportDeclaration(node) && !(node.flags & 33554432 /* Ambient */) && targetFlags & 128 /* ConstEnum */) {
85781
85901
  const constEnumDeclaration = target.valueDeclaration;
@@ -86134,7 +86254,7 @@ function createTypeChecker(host) {
86134
86254
  checkExpressionCached(node.expression);
86135
86255
  }
86136
86256
  if (isIllegalExportDefaultInCJS) {
86137
- error(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled);
86257
+ error(node, getVerbatimModuleSyntaxErrorMessage(node));
86138
86258
  }
86139
86259
  checkExternalModuleExports(container);
86140
86260
  if (node.flags & 33554432 /* Ambient */ && !isEntityNameExpression(node.expression)) {
@@ -89848,7 +89968,7 @@ function createTypeChecker(host) {
89848
89968
  if (languageVersion < 2 /* ES2015 */ && isPrivateIdentifier(node.name)) {
89849
89969
  return grammarErrorOnNode(node.name, Diagnostics.Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher);
89850
89970
  }
89851
- if (languageVersion < 2 /* ES2015 */ && isAutoAccessorPropertyDeclaration(node)) {
89971
+ if (languageVersion < 2 /* ES2015 */ && isAutoAccessorPropertyDeclaration(node) && !(node.flags & 33554432 /* Ambient */)) {
89852
89972
  return grammarErrorOnNode(node.name, Diagnostics.Properties_with_the_accessor_modifier_are_only_available_when_targeting_ECMAScript_2015_and_higher);
89853
89973
  }
89854
89974
  if (isAutoAccessorPropertyDeclaration(node) && checkGrammarForInvalidQuestionMark(node.questionToken, Diagnostics.An_accessor_property_cannot_be_declared_optional)) {
@@ -89933,7 +90053,7 @@ function createTypeChecker(host) {
89933
90053
  function checkGrammarBigIntLiteral(node) {
89934
90054
  const literalType = isLiteralTypeNode(node.parent) || isPrefixUnaryExpression(node.parent) && isLiteralTypeNode(node.parent.parent);
89935
90055
  if (!literalType) {
89936
- if (languageVersion < 7 /* ES2020 */) {
90056
+ if (!(node.flags & 33554432 /* Ambient */) && languageVersion < 7 /* ES2020 */) {
89937
90057
  if (grammarErrorOnNode(node, Diagnostics.BigInt_literals_are_not_available_when_targeting_lower_than_ES2020)) {
89938
90058
  return true;
89939
90059
  }
@@ -90002,7 +90122,7 @@ function createTypeChecker(host) {
90002
90122
  }
90003
90123
  function checkGrammarImportCallExpression(node) {
90004
90124
  if (compilerOptions.verbatimModuleSyntax && moduleKind === 1 /* CommonJS */) {
90005
- return grammarErrorOnNode(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled);
90125
+ return grammarErrorOnNode(node, getVerbatimModuleSyntaxErrorMessage(node));
90006
90126
  }
90007
90127
  if (node.expression.kind === 237 /* MetaProperty */) {
90008
90128
  if (moduleKind !== 99 /* ESNext */ && moduleKind !== 200 /* Preserve */) {
@@ -128512,7 +128632,7 @@ function getMatchedIncludeSpec(program, fileName) {
128512
128632
  const index = findIndex((_b = configFile == null ? void 0 : configFile.configFileSpecs) == null ? void 0 : _b.validatedIncludeSpecs, (includeSpec) => {
128513
128633
  if (isJsonFile && !endsWith(includeSpec, ".json" /* Json */)) return false;
128514
128634
  const pattern = getPatternFromSpec(includeSpec, basePath, "files");
128515
- return !!pattern && getRegexFromPattern(`(${pattern})$`, useCaseSensitiveFileNames2).test(fileName);
128635
+ return !!pattern && getRegexFromPattern(`(?:${pattern})$`, useCaseSensitiveFileNames2).test(fileName);
128516
128636
  });
128517
128637
  return index !== -1 ? configFile.configFileSpecs.validatedIncludeSpecsBeforeSubstitution[index] : void 0;
128518
128638
  }
@@ -133447,7 +133567,8 @@ function createSyntacticTypeNodeBuilder(options, resolver) {
133447
133567
  function ensureParameter(p, context) {
133448
133568
  return factory.updateParameterDeclaration(
133449
133569
  p,
133450
- [],
133570
+ /*modifiers*/
133571
+ void 0,
133451
133572
  reuseNode(context, p.dotDotDotToken),
133452
133573
  resolver.serializeNameOfParameter(context, p),
133453
133574
  resolver.isOptionalParameter(p) ? factory.createToken(58 /* QuestionToken */) : void 0,