typescript 6.0.0-dev.20251030 → 6.0.0-dev.20251031

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 = "6.0";
21
- var version = `${versionMajorMinor}.0-dev.20251030`;
21
+ var version = `${versionMajorMinor}.0-dev.20251031`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -71017,7 +71017,7 @@ function createTypeChecker(host) {
71017
71017
  if (!hasDefaultClause) {
71018
71018
  return caseType;
71019
71019
  }
71020
- const defaultType = filterType(type, (t) => !(isUnitLikeType(t) && contains(switchTypes, t.flags & 32768 /* Undefined */ ? undefinedType : getRegularTypeOfLiteralType(extractUnitType(t)))));
71020
+ const defaultType = filterType(type, (t) => !(isUnitLikeType(t) && contains(switchTypes, t.flags & 32768 /* Undefined */ ? undefinedType : getRegularTypeOfLiteralType(extractUnitType(t)), (t1, t2) => isUnitType(t1) && areTypesComparable(t1, t2))));
71021
71021
  return caseType.flags & 131072 /* Never */ ? defaultType : getUnionType([caseType, defaultType]);
71022
71022
  }
71023
71023
  function narrowTypeByTypeName(type, typeName) {
@@ -78647,6 +78647,9 @@ function createTypeChecker(host) {
78647
78647
  let fallbackReturnType = voidType;
78648
78648
  if (func.body.kind !== 242 /* Block */) {
78649
78649
  returnType = checkExpressionCached(func.body, checkMode && checkMode & ~8 /* SkipGenericFunctions */);
78650
+ if (isConstContext(func.body)) {
78651
+ returnType = getRegularTypeOfLiteralType(returnType);
78652
+ }
78650
78653
  if (isAsync) {
78651
78654
  returnType = unwrapAwaitedType(checkAwaitedType(
78652
78655
  returnType,
@@ -78678,7 +78681,7 @@ function createTypeChecker(host) {
78678
78681
  /*contextFlags*/
78679
78682
  void 0
78680
78683
  );
78681
- const returnType2 = contextualReturnType && (unwrapReturnType(contextualReturnType, functionFlags) || voidType).flags & 32768 /* Undefined */ ? undefinedType : voidType;
78684
+ const returnType2 = contextualReturnType && someType(unwrapReturnType(contextualReturnType, functionFlags) || voidType, (t) => !!(t.flags & 32768 /* Undefined */)) ? undefinedType : voidType;
78682
78685
  return functionFlags & 2 /* Async */ ? createPromiseReturnType(func, returnType2) : (
78683
78686
  // Async function
78684
78687
  returnType2
@@ -78758,7 +78761,10 @@ function createTypeChecker(host) {
78758
78761
  const nextTypes = [];
78759
78762
  const isAsync = (getFunctionFlags(func) & 2 /* Async */) !== 0;
78760
78763
  forEachYieldExpression(func.body, (yieldExpression) => {
78761
- const yieldExpressionType = yieldExpression.expression ? checkExpression(yieldExpression.expression, checkMode) : undefinedWideningType;
78764
+ let yieldExpressionType = yieldExpression.expression ? checkExpression(yieldExpression.expression, checkMode) : undefinedWideningType;
78765
+ if (yieldExpression.expression && isConstContext(yieldExpression.expression)) {
78766
+ yieldExpressionType = getRegularTypeOfLiteralType(yieldExpressionType);
78767
+ }
78762
78768
  pushIfUnique(yieldTypes, getYieldedTypeOfYieldExpression(yieldExpression, yieldExpressionType, anyType, isAsync));
78763
78769
  let nextType;
78764
78770
  if (yieldExpression.asteriskToken) {
@@ -78875,7 +78881,7 @@ function createTypeChecker(host) {
78875
78881
  if (type.flags & 131072 /* Never */) {
78876
78882
  hasReturnOfTypeNever = true;
78877
78883
  }
78878
- pushIfUnique(aggregatedTypes, type);
78884
+ pushIfUnique(aggregatedTypes, isConstContext(expr) ? getRegularTypeOfLiteralType(type) : type);
78879
78885
  } else {
78880
78886
  hasReturnWithNoExpression = true;
78881
78887
  }
@@ -26,7 +26,7 @@
26
26
  "A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165": "Ein berechneter Eigenschaftenname in einem Umgebungskontext muss auf einen Ausdruck verweisen, dessen Typ ein Literal oder ein \"unique symbol\"-Typ ist.",
27
27
  "A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169": "Ein berechneter Eigenschaftenname in einer Schnittstelle muss auf einen Ausdruck verweisen, dessen Typ ein Literal oder ein \"unique symbol\"-Typ ist.",
28
28
  "A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464": "Ein berechneter Eigenschaftenname muss vom Typ \"string\", \"number\", \"symbol\" oder \"any\" sein.",
29
- "A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array__1355": "Eine const-Assertion kann nur auf Verweise auf Enumerationsmember oder Zeichenfolgen-, Zahlen-, boolesche, Array- oder Objektliterale angewendet werden.",
29
+ "A_const_assertion_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_o_1355": "Eine const“-Assertion kann nur auf Referenzen auf Enumerationsmitglieder oder auf String-, Zahlen-, Boolean-, Array- oder Objektliterale angewendet werden.",
30
30
  "A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476": "Auf einen const-Enumerationsmember kann nur mithilfe eines Zeichenfolgenliterals zugegriffen werden.",
31
31
  "A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_refere_1254": "Bei einem const-Initialisierer in einem Umgebungskontext muss es sich um ein Zeichenfolgen- oder um ein numerisches Literal oder um einen Verweis auf ein Enumerationsliteral handeln.",
32
32
  "A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005": "Ein Konstruktor darf keinen super-Aufruf enthalten, wenn seine Klasse \"null\" erweitert.",
@@ -365,6 +365,7 @@
365
365
  "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732": "Das Modul \"{0}\" wurde nicht gefunden. Erwägen Sie die Verwendung von \"--resolveJsonModule\" zum Importieren eines Moduls mit der Erweiterung \".json\".",
366
366
  "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_t_2792": "Das Modul \"{0}\" wurde nicht gefunden. Möchten Sie die Option \"moduleResolution\" auf \"nodenext\" festlegen oder Aliase zur Option \"paths\" hinzufügen?",
367
367
  "Cannot_find_module_0_or_its_corresponding_type_declarations_2307": "Das Modul \"{0}\" oder die zugehörigen Typdeklarationen wurden nicht gefunden.",
368
+ "Cannot_find_module_or_type_declarations_for_side_effect_import_of_0_2882": "Es können keine Modul- oder Typdeklarationen für den Import von Nebeneffekten von „{0}“ gefunden werden.",
368
369
  "Cannot_find_name_0_2304": "Der Name \"{0}\" wurde nicht gefunden.",
369
370
  "Cannot_find_name_0_Did_you_mean_1_2552": "Der Name \"{0}\" wurde nicht gefunden. Meinten Sie \"{1}\"?",
370
371
  "Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663": "Der Name \"{0}\" wurde nicht gefunden. Meinten Sie den Instanzmember \"this.{0}\"?",
@@ -1895,6 +1896,7 @@
1895
1896
  "Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625": "Das variadic-Element an Position {0} in der Quelle stimmt nicht mit dem Element an Position {1} im Ziel überein.",
1896
1897
  "Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637": "Abweichungsanmerkungen werden nur in Typaliasnamen für Objekt-, Funktions-, Konstruktor- und zugeordnete Typen unterstützt.",
1897
1898
  "Version_0_6029": "Version {0}",
1899
+ "Visit_https_Colon_Slash_Slashaka_ms_Slashts6_for_migration_information_5111": "Weitere Informationen zur Migration finden Sie unter https://aka.ms/ts6.",
1898
1900
  "Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110": "Besuchen Sie https://aka.ms/tsconfig, um mehr über diese Datei zu erfahren.",
1899
1901
  "WATCH_OPTIONS_6918": "ÜBERWACHUNGSOPTIONEN",
1900
1902
  "Watch_and_Build_Modes_6250": "Überwachungs- und Buildmodi",
@@ -2045,6 +2047,7 @@
2045
2047
  "extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020": "Die \"extends\"-Klausel der exportierten Klasse \"{0}\" besitzt oder verwendet den privaten Namen \"{1}\".",
2046
2048
  "extends_clause_of_exported_class_has_or_is_using_private_name_0_4021": "Die extends-Klausel der exportierten Klasse besitzt oder verwendet den privaten Namen \"{0}\".",
2047
2049
  "extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022": "Die \"extends\"-Klausel der exportierten Schnittstelle \"{0}\" besitzt oder verwendet den privaten Namen \"{1}\".",
2050
+ "false_unless_checkJs_is_set_6932": "„false“, es sei denn „checkJs“ ist festgelegt",
2048
2051
  "false_unless_composite_is_set_6906": "'false', es sei denn 'composite' ist festgelegt",
2049
2052
  "false_unless_strict_is_set_6905": "'false', es sei denn, 'strict' ist festgelegt",
2050
2053
  "file_6025": "Datei",
@@ -2059,10 +2062,9 @@
2059
2062
  "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338": "infer-Deklarationen sind nur in der extends-Klausel eines bedingten Typs zulässig.",
2060
2063
  "k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets_1510": "Auf „\\k“ muss ein Erfassungsgruppenname folgen, der in spitzen Klammern eingeschlossen ist.",
2061
2064
  "let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480": "\"let\" darf nicht als Name in let- oder const-Deklarationen verwendet werden.",
2062
- "module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node_69010": "Modul === 'AMD' oder 'UMD' oder 'System' oder 'ES6', dann 'Klassisch', andernfalls 'Knoten'",
2063
- "module_system_or_esModuleInterop_6904": "Modul === \"System\" oder esModuleInterop",
2064
2065
  "new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009": "Der new-Ausdruck, in dessen Ziel eine Konstruktsignatur fehlt, weist implizit einen Typ \"any\" auf.",
2065
2066
  "node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified_6907": "'[\"node_modules\",\"bower_components\",\"jspm_packages\"]', plus der Wert von 'outDir', wenn ein Wert angegeben ist.",
2067
+ "nodenext_if_module_is_nodenext_node16_if_module_is_node16_or_node18_otherwise_bundler_69010": "„nodenext“, wenn „module“ auf „nodenext“ festgelegt ist; „node16“, wenn „module“ auf „node16“ oder „node18“ festgelegt ist; andernfalls „bundler“.",
2066
2068
  "one_of_Colon_6900": "eines von:",
2067
2069
  "one_or_more_Colon_6901": "eins oder mehr:",
2068
2070
  "options_6024": "Optionen",
@@ -1896,6 +1896,7 @@
1896
1896
  "Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625": "El elemento variádico en la posición {0} del origen no coincide con el elemento en la posición {1} del destino.",
1897
1897
  "Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637": "Las anotaciones de varianza solo se admiten en alias de tipo para los tipos objeto, función, constructor y asignado.",
1898
1898
  "Version_0_6029": "Versión {0}",
1899
+ "Visit_https_Colon_Slash_Slashaka_ms_Slashts6_for_migration_information_5111": "Visite https://aka.ms/ts6 para obtener información sobre la migración.",
1899
1900
  "Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110": "Visite https://aka.ms/tsconfig para obtener más información acerca de este archivo",
1900
1901
  "WATCH_OPTIONS_6918": "OPCIONES DE INSPECCIÓN",
1901
1902
  "Watch_and_Build_Modes_6250": "Modos de compilación e inspección",
@@ -2046,6 +2047,7 @@
2046
2047
  "extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020": "La cláusula \"extends\" de la clase \"{0}\" exportada tiene o usa el nombre privado \"{1}\".",
2047
2048
  "extends_clause_of_exported_class_has_or_is_using_private_name_0_4021": "La cláusula \"extends\" de la clase exportada tiene o usa el nombre privado \"{0}\".",
2048
2049
  "extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022": "La cláusula \"extends\" de la interfaz \"{0}\" exportada tiene o usa el nombre privado \"{1}\".",
2050
+ "false_unless_checkJs_is_set_6932": "`false`, a menos que se establezca `checkJs`",
2049
2051
  "false_unless_composite_is_set_6906": "\"false\", a menos que se establezca \"composite\"",
2050
2052
  "false_unless_strict_is_set_6905": "\"false\", a menos que se establezca como \"strict\"",
2051
2053
  "file_6025": "archivo",
@@ -2060,10 +2062,9 @@
2060
2062
  "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338": "Las declaraciones \"infer\" solo se permiten en la cláusula \"extends\" de un tipo condicional.",
2061
2063
  "k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets_1510": "“\\k” debe ir seguido de un nombre de grupo de captura entre corchetes angulares.",
2062
2064
  "let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480": "No se permite usar \"let\" como nombre en las declaraciones \"let\" o \"const\".",
2063
- "module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node_69010": "módulo === \"AMD\" o \"UMD\" o \"System\" o \"ES6\", después, \"Classic\", de lo contrario \"Node\"",
2064
- "module_system_or_esModuleInterop_6904": "módulo === \"system\" o esModuleInterop",
2065
2065
  "new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009": "La expresión \"new\", a cuyo destino le falta una signatura de construcción, tiene implícitamente un tipo \"any\".",
2066
2066
  "node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified_6907": "\"[\"node_modules\", \"bower_components\", \"jspm_packages\"]\", más el valor de \"outDir\", si se especifica uno.",
2067
+ "nodenext_if_module_is_nodenext_node16_if_module_is_node16_or_node18_otherwise_bundler_69010": "`nodenext` si `module` es `nodenext`; `node16` si `module` es `node16` o `node18`; de lo contrario, `bundler`.",
2067
2068
  "one_of_Colon_6900": "uno de:",
2068
2069
  "one_or_more_Colon_6901": "uno o más:",
2069
2070
  "options_6024": "Opciones",
@@ -26,7 +26,7 @@
26
26
  "A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165": "Un nom de propriété calculée dans un contexte ambiant doit faire référence à une expression dont le type est un type littéral ou un type 'unique symbol'.",
27
27
  "A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169": "Un nom de propriété calculée dans une interface doit faire référence à une expression dont le type est un type littéral ou un type 'unique symbol'.",
28
28
  "A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464": "Un nom de propriété calculée doit être de type 'string', 'number', 'symbol' ou 'any'.",
29
- "A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array__1355": "Une assertion 'const' peut uniquement être appliquée aux références à des membres enum, des littéraux de chaînes, des littéraux de nombres, des littéraux de valeurs booléennes, des littéraux de tableaux ou des littéraux d'objets.",
29
+ "A_const_assertion_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_o_1355": "Une assertion « const » peut uniquement être appliquée aux références à des membres enum, des littéraux de chaînes, des littéraux de nombres, des littéraux de valeurs booléennes, des littéraux de tableaux ou des littéraux d'objets.",
30
30
  "A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476": "Un membre d'enum const n'est accessible qu'à l'aide d'un littéral de chaîne.",
31
31
  "A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_refere_1254": "Un initialiseur 'const' dans un contexte ambiant doit être un littéral de chaîne ou un littéral numérique, ou une référence à un enum littéral.",
32
32
  "A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005": "Un constructeur ne peut pas contenir d'appel de 'super' quand sa classe étend 'null'.",
@@ -365,6 +365,7 @@
365
365
  "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732": "Le module '{0}' est introuvable. Utilisez '--resolveJsonModule' pour importer le module avec l'extension '.json'.",
366
366
  "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_t_2792": "Le module « {0} » est introuvable. Vouliez-vous définir l’option « moduleResolution » sur la valeur « node » ou ajouter des alias à l’option « paths » ?",
367
367
  "Cannot_find_module_0_or_its_corresponding_type_declarations_2307": "Impossible de localiser le module '{0}' ou les déclarations de type correspondantes.",
368
+ "Cannot_find_module_or_type_declarations_for_side_effect_import_of_0_2882": "Impossible de trouver les déclarations de module ou de type pour l’importation à effet secondaire de « {0} ».",
368
369
  "Cannot_find_name_0_2304": "Le nom '{0}' est introuvable.",
369
370
  "Cannot_find_name_0_Did_you_mean_1_2552": "Le nom '{0}' est introuvable. Est-ce qu'il ne s'agit pas plutôt de '{1}' ?",
370
371
  "Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663": "Le nom '{0}' est introuvable. Voulez-vous utiliser le membre d'instance 'this.{0}' ?",
@@ -1895,6 +1896,7 @@
1895
1896
  "Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625": "L'élément variadique situé à la position {0} dans la source ne correspond pas à l'élément situé à la position {1} dans la cible.",
1896
1897
  "Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637": "Les annotations de variance sont uniquement prises en charge dans les alias de type pour les types objet, fonction, constructeur et mappé.",
1897
1898
  "Version_0_6029": "Version {0}",
1899
+ "Visit_https_Colon_Slash_Slashaka_ms_Slashts6_for_migration_information_5111": "Visitez https://aka.ms/ts6 pour obtenir des informations sur la migration.",
1898
1900
  "Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110": "Visitez https://aka.ms/tsconfig pour en savoir plus sur ce fichier",
1899
1901
  "WATCH_OPTIONS_6918": "OPTIONS D’OBSERVATION",
1900
1902
  "Watch_and_Build_Modes_6250": "Modes d’Observation et de Génération",
@@ -2045,6 +2047,7 @@
2045
2047
  "extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020": "La clause 'extends' de la classe exportée '{0}' comporte ou utilise le nom privé '{1}'.",
2046
2048
  "extends_clause_of_exported_class_has_or_is_using_private_name_0_4021": "La clause 'extends' de la classe exportée comporte ou utilise le nom privé '{0}'.",
2047
2049
  "extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022": "La clause 'extends' de l'interface exportée '{0}' comporte ou utilise le nom privé '{1}'.",
2050
+ "false_unless_checkJs_is_set_6932": "« false », sauf si « checkJs » est défini",
2048
2051
  "false_unless_composite_is_set_6906": "« false », sauf si « composite » est défini",
2049
2052
  "false_unless_strict_is_set_6905": "« false », sauf si « strict » est défini",
2050
2053
  "file_6025": "fichier",
@@ -2059,10 +2062,9 @@
2059
2062
  "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338": "Les déclarations 'infer' sont uniquement autorisées dans la clause 'extends' d’un type conditionnel.",
2060
2063
  "k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets_1510": "« \\k » doit être suivi d’un nom de groupe de capture placé entre crochets angulaires.",
2061
2064
  "let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480": "'let' ne peut pas être utilisé comme nom dans les déclarations 'let' ou 'const'.",
2062
- "module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node_69010": "module === « AMD » ou « UMD » ou « System » ou « ES6 », puis « Classic », sinon « Node »",
2063
- "module_system_or_esModuleInterop_6904": "module === « system » ou esModuleInterop",
2064
2065
  "new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009": "L'expression 'new', dont la cible ne dispose pas d'une signature de construction, possède implicitement un type 'any'.",
2065
2066
  "node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified_6907": "« [ « node_modules », « bower_components », « jspm_packages »] », plus la valeur de « outDir » si elle est spécifiée.",
2067
+ "nodenext_if_module_is_nodenext_node16_if_module_is_node16_or_node18_otherwise_bundler_69010": "`nodenext` si `module` est `nodenext` ; `node16` si `module` est `node16` ou `node18` ; sinon, `bundler`.",
2066
2068
  "one_of_Colon_6900": "L'un de :",
2067
2069
  "one_or_more_Colon_6901": "un ou plusieurs :",
2068
2070
  "options_6024": "options",
@@ -26,7 +26,7 @@
26
26
  "A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165": "環境コンテキスト内の計算されたプロパティ名は、型がリテラル型または 'unique symbol' 型の式を参照する必要があります。",
27
27
  "A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169": "インターフェイス内の計算されたプロパティ名は、型がリテラル型または 'unique symbol' 型の式を参照する必要があります。",
28
28
  "A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464": "計算されたプロパティ名は 'string' 型、'number' 型、'symbol' 型、または 'any' 型のいずれかでなければなりません。",
29
- "A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array__1355": "'const' アサーションは、列挙型メンバーへの参照、文字列、数値、ブール値、配列、オブジェクト リテラルにのみ適用できます。",
29
+ "A_const_assertion_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_o_1355": "'const' アサーションは、列挙型メンバーへの参照、または文字列、数値、ブール値、配列、オブジェクト リテラルへの参照にのみ適用できます。",
30
30
  "A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476": "const 列挙型メンバーは、文字列リテラルを使用してのみアクセスできます。",
31
31
  "A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_refere_1254": "環境コンテキストの 'const' 初期化子は、文字列または数値リテラル、もしくはリテラル列挙型の参照である必要があります。",
32
32
  "A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005": "コンストラクターのクラスが 'null' を拡張する場合、そのコンストラクターに 'super' の呼び出しを含めることはできません。",
@@ -365,6 +365,7 @@
365
365
  "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732": "モジュール '{0}' が見つかりません。'--resolveJsonModule' を使用して '.json' 拡張子を持つモジュールをインポートすることをご検討ください。",
366
366
  "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_t_2792": "モジュール '{0}' が見つかりません。'moduleResolution' オプションを 'nodenext' に設定するか、'paths' オプションにエイリアスを追加するつもりでしたか?",
367
367
  "Cannot_find_module_0_or_its_corresponding_type_declarations_2307": "モジュール '{0}' またはそれに対応する型宣言が見つかりません。",
368
+ "Cannot_find_module_or_type_declarations_for_side_effect_import_of_0_2882": "'{0}' の副作用インポートに対するモジュールまたは型宣言が見つかりません。",
368
369
  "Cannot_find_name_0_2304": "名前 '{0}' が見つかりません。",
369
370
  "Cannot_find_name_0_Did_you_mean_1_2552": "'{0}' という名前は見つかりません。'{1}' ですか?",
370
371
  "Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663": "名前 '{0}' が見つかりません。インスタンス メンバー 'this.{0}' ですか?",
@@ -1895,6 +1896,7 @@
1895
1896
  "Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625": "ソースの位置 {0} にある可変個引数要素は、ターゲットの位置 {1} にある要素と一致しません。",
1896
1897
  "Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637": "分散注釈は、オブジェクト、関数、コンストラクター、およびマップされた型の型エイリアスでのみサポートされています。",
1897
1898
  "Version_0_6029": "バージョン {0}",
1899
+ "Visit_https_Colon_Slash_Slashaka_ms_Slashts6_for_migration_information_5111": "移行情報については、http://aka.ms/ts6 にアクセスしてください。",
1898
1900
  "Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110": "このファイルの詳細については、https://aka.ms/tsconfig をご覧ください",
1899
1901
  "WATCH_OPTIONS_6918": "ウォッチ オプション",
1900
1902
  "Watch_and_Build_Modes_6250": "ウォッチ モードとビルド モード",
@@ -2045,6 +2047,7 @@
2045
2047
  "extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020": "エクスポートされたクラス '{0}' の 'extends' 句がプライベート名 '{1}' を持っているか、使用しています。",
2046
2048
  "extends_clause_of_exported_class_has_or_is_using_private_name_0_4021": "エクスポートされたクラスの 'extends' 句がプライベート名 '{0}' を持っているか、使用しています。",
2047
2049
  "extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022": "エクスポートされたインターフェイス '{0}' の 'extends' 句がプライベート名 '{1}' を持っているか、使用しています。",
2050
+ "false_unless_checkJs_is_set_6932": "`false`、`checkJs` が設定されている場合を除く",
2048
2051
  "false_unless_composite_is_set_6906": "'composite' が設定されていない場合は 'false'",
2049
2052
  "false_unless_strict_is_set_6905": "'strict' が設定されている場合を除き、' false '",
2050
2053
  "file_6025": "ファイル",
@@ -2059,10 +2062,9 @@
2059
2062
  "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338": "'infer' 宣言は、条件付き型の 'extends' 句でのみ許可されます。",
2060
2063
  "k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets_1510": "'\\k' の後には、山かっこで囲まれたキャプチャ グループ名を指定する必要があります。",
2061
2064
  "let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480": "'let' は、'let' 宣言または 'const' 宣言で名前として使用することはできません。",
2062
- "module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node_69010": "モジュール === 'AMD'、'UMD'、'System'、'ES6'、'Classic'、それ以外の場合は 'Node'",
2063
- "module_system_or_esModuleInterop_6904": "module === \"system\" or esModuleInterop",
2064
2065
  "new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009": "ターゲットにコンストラクト シグネチャがない 'new' 式の型は、暗黙的に 'any' になります。",
2065
2066
  "node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified_6907": "`[\"node_modules\", \"bower_components\", \"jspm_packages\"]`' と、指定されている場合は 'outDir' の値を加算します。",
2067
+ "nodenext_if_module_is_nodenext_node16_if_module_is_node16_or_node18_otherwise_bundler_69010": "`module` が `nodenext` の場合は `nodenext`、`module` が `node16` または `node18` の場合は `node16`、それ以外の場合は `bundler`。",
2066
2068
  "one_of_Colon_6900": "次のいずれか:",
2067
2069
  "one_or_more_Colon_6901": "1 つ以上",
2068
2070
  "options_6024": "オプション",
@@ -26,7 +26,7 @@
26
26
  "A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_t_1165": "Nazwa właściwości obliczanej w otaczającym kontekście musi odwoływać się do wyrażenia, którego typem jest literał lub „unique symbol”.",
27
27
  "A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_1169": "Nazwa właściwości obliczanej w interfejsie musi odwoływać się do wyrażenia, którego typem jest literał lub „unique symbol”.",
28
28
  "A_computed_property_name_must_be_of_type_string_number_symbol_or_any_2464": "Obliczona nazwa właściwości musi być typu „string”, „number”, „symbol” lub „any”.",
29
- "A_const_assertions_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array__1355": "Asercje „const” mogą być stosowane tylko do odwołań do elementów członkowskich wyliczenia lub literałów typu string, number, boolean, array lub object.",
29
+ "A_const_assertion_can_only_be_applied_to_references_to_enum_members_or_string_number_boolean_array_o_1355": "Asercja „const” może być stosowana tylko do odwołań do elementów członkowskich wyliczenia lub ciągu, liczby, wartości logicznej, tablicy lub literałów obiektów.",
30
30
  "A_const_enum_member_can_only_be_accessed_using_a_string_literal_2476": "Dostęp do składowej wyliczenia ze specyfikatorem const można uzyskać tylko za pomocą literału ciągu.",
31
31
  "A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal_or_literal_enum_refere_1254": "Inicjator „const” w otaczającym kontekście musi być ciągiem, literałem liczbowym albo odwołaniem do literału wyliczenia.",
32
32
  "A_constructor_cannot_contain_a_super_call_when_its_class_extends_null_17005": "Konstruktor nie może zawierać wywołania „super”, gdy jego klasa rozszerza wartość „null”.",
@@ -365,6 +365,7 @@
365
365
  "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732": "Nie można znaleźć modułu „{0}”. Rozważ użycie opcji „--resolveJsonModule” do importowania modułu z rozszerzeniem „.json”.",
366
366
  "Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_t_2792": "Nie można odnaleźć modułu „{0}”. Czy chcesz ustawić opcję „moduleResolution” na wartość „nodenext”, czy dodać aliasy do opcji „paths”?",
367
367
  "Cannot_find_module_0_or_its_corresponding_type_declarations_2307": "Nie można odnaleźć modułu „{0}” lub odpowiadających mu deklaracji typów.",
368
+ "Cannot_find_module_or_type_declarations_for_side_effect_import_of_0_2882": "Nie można odnaleźć deklaracji modułu lub typu dla importu efektu ubocznego elementu „{0}”.",
368
369
  "Cannot_find_name_0_2304": "Nie można odnaleźć nazwy „{0}”.",
369
370
  "Cannot_find_name_0_Did_you_mean_1_2552": "Nie można znaleźć nazwy „{0}”. Czy chodziło Ci o „{1}”?",
370
371
  "Cannot_find_name_0_Did_you_mean_the_instance_member_this_0_2663": "Nie można znaleźć nazwy „{0}”. Czy chodziło o składową wystąpienia „this.{0}”?",
@@ -1895,6 +1896,7 @@
1895
1896
  "Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625": "Element ze zmienną liczbą argumentów na pozycji {0} w źródle nie jest zgodny z elementem na pozycji {1} w lokalizacji docelowej.",
1896
1897
  "Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637": "Adnotacje wariancji są obsługiwane tylko w aliasach typów obiektów, funkcji, konstruktorów i mapowanych typów.",
1897
1898
  "Version_0_6029": "Wersja {0}",
1899
+ "Visit_https_Colon_Slash_Slashaka_ms_Slashts6_for_migration_information_5111": "Odwiedź https://aka.ms/ts6, aby uzyskać informacje o migracji.",
1898
1900
  "Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110": "Odwiedź https://aka.ms/tsconfig, aby dowiedzieć się więcej o tym pliku",
1899
1901
  "WATCH_OPTIONS_6918": "OPCJE OBSERWACJI",
1900
1902
  "Watch_and_Build_Modes_6250": "Tryb wyrażeń kontrolnych i kompilowania",
@@ -2045,6 +2047,7 @@
2045
2047
  "extends_clause_of_exported_class_0_has_or_is_using_private_name_1_4020": "Klauzula „extends” wyeksportowanej klasy „{0}” ma nazwę prywatną „{1}” lub używa tej nazwy.",
2046
2048
  "extends_clause_of_exported_class_has_or_is_using_private_name_0_4021": "Klauzula „extends” wyeksportowanej klasy ma nazwę prywatną „{0}” lub używa tej nazwy.",
2047
2049
  "extends_clause_of_exported_interface_0_has_or_is_using_private_name_1_4022": "Klauzula „extends” wyeksportowanego interfejsu „{0}” ma nazwę prywatną „{1}” lub używa tej nazwy.",
2050
+ "false_unless_checkJs_is_set_6932": "`false`, chyba że ustawiono `checkJs`",
2048
2051
  "false_unless_composite_is_set_6906": "\"false\", chyba że ustawiono element \"composite\"",
2049
2052
  "false_unless_strict_is_set_6905": "\"false\", chyba że ustawiono \"strict\"",
2050
2053
  "file_6025": "plik",
@@ -2059,10 +2062,9 @@
2059
2062
  "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338": "Deklaracje „infer” są dozwolone tylko w klauzuli „extends” typu warunkowego.",
2060
2063
  "k_must_be_followed_by_a_capturing_group_name_enclosed_in_angle_brackets_1510": "Po wyrażeniu „\\k” musi następować nazwa grupy przechwytywania ujęta w nawiasy ostre.",
2061
2064
  "let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations_2480": "Element „let” nie może być używany jako nazwa w deklaracjach „let” ani „const”.",
2062
- "module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node_69010": "module === \"AMD\" lub \"UMD\" lub \"System\" lub \"ES6\", a następnie \"Classic\", w przeciwnym razie \"Node\"",
2063
- "module_system_or_esModuleInterop_6904": "module === \"system\" lub esModuleInterop",
2064
2065
  "new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type_7009": "Wyrażenie „new”, którego element docelowy nie ma sygnatury konstrukcji, jest niejawnie typu „any”.",
2065
2066
  "node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified_6907": "\"[\"node_modules\", \"bower_components\", \"jspm_packages\"]\", plus wartość elementu \"outDir\", jeśli jest określona.",
2067
+ "nodenext_if_module_is_nodenext_node16_if_module_is_node16_or_node18_otherwise_bundler_69010": "`nodenext`, jeśli `module` ma wartość `nodenext`; `node16`, jeśli `module` ma wartość `node16` lub `node18`; w przeciwnym razie `bundler`.",
2066
2068
  "one_of_Colon_6900": "jeden z:",
2067
2069
  "one_or_more_Colon_6901": "co najmniej jeden:",
2068
2070
  "options_6024": "opcje",
package/lib/typescript.js CHANGED
@@ -2286,7 +2286,7 @@ module.exports = __toCommonJS(typescript_exports);
2286
2286
 
2287
2287
  // src/compiler/corePublic.ts
2288
2288
  var versionMajorMinor = "6.0";
2289
- var version = `${versionMajorMinor}.0-dev.20251030`;
2289
+ var version = `${versionMajorMinor}.0-dev.20251031`;
2290
2290
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2291
2291
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2292
2292
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -75623,7 +75623,7 @@ function createTypeChecker(host) {
75623
75623
  if (!hasDefaultClause) {
75624
75624
  return caseType;
75625
75625
  }
75626
- const defaultType = filterType(type, (t) => !(isUnitLikeType(t) && contains(switchTypes, t.flags & 32768 /* Undefined */ ? undefinedType : getRegularTypeOfLiteralType(extractUnitType(t)))));
75626
+ const defaultType = filterType(type, (t) => !(isUnitLikeType(t) && contains(switchTypes, t.flags & 32768 /* Undefined */ ? undefinedType : getRegularTypeOfLiteralType(extractUnitType(t)), (t1, t2) => isUnitType(t1) && areTypesComparable(t1, t2))));
75627
75627
  return caseType.flags & 131072 /* Never */ ? defaultType : getUnionType([caseType, defaultType]);
75628
75628
  }
75629
75629
  function narrowTypeByTypeName(type, typeName) {
@@ -83253,6 +83253,9 @@ function createTypeChecker(host) {
83253
83253
  let fallbackReturnType = voidType;
83254
83254
  if (func.body.kind !== 242 /* Block */) {
83255
83255
  returnType = checkExpressionCached(func.body, checkMode && checkMode & ~8 /* SkipGenericFunctions */);
83256
+ if (isConstContext(func.body)) {
83257
+ returnType = getRegularTypeOfLiteralType(returnType);
83258
+ }
83256
83259
  if (isAsync) {
83257
83260
  returnType = unwrapAwaitedType(checkAwaitedType(
83258
83261
  returnType,
@@ -83284,7 +83287,7 @@ function createTypeChecker(host) {
83284
83287
  /*contextFlags*/
83285
83288
  void 0
83286
83289
  );
83287
- const returnType2 = contextualReturnType && (unwrapReturnType(contextualReturnType, functionFlags) || voidType).flags & 32768 /* Undefined */ ? undefinedType : voidType;
83290
+ const returnType2 = contextualReturnType && someType(unwrapReturnType(contextualReturnType, functionFlags) || voidType, (t) => !!(t.flags & 32768 /* Undefined */)) ? undefinedType : voidType;
83288
83291
  return functionFlags & 2 /* Async */ ? createPromiseReturnType(func, returnType2) : (
83289
83292
  // Async function
83290
83293
  returnType2
@@ -83364,7 +83367,10 @@ function createTypeChecker(host) {
83364
83367
  const nextTypes = [];
83365
83368
  const isAsync = (getFunctionFlags(func) & 2 /* Async */) !== 0;
83366
83369
  forEachYieldExpression(func.body, (yieldExpression) => {
83367
- const yieldExpressionType = yieldExpression.expression ? checkExpression(yieldExpression.expression, checkMode) : undefinedWideningType;
83370
+ let yieldExpressionType = yieldExpression.expression ? checkExpression(yieldExpression.expression, checkMode) : undefinedWideningType;
83371
+ if (yieldExpression.expression && isConstContext(yieldExpression.expression)) {
83372
+ yieldExpressionType = getRegularTypeOfLiteralType(yieldExpressionType);
83373
+ }
83368
83374
  pushIfUnique(yieldTypes, getYieldedTypeOfYieldExpression(yieldExpression, yieldExpressionType, anyType, isAsync));
83369
83375
  let nextType;
83370
83376
  if (yieldExpression.asteriskToken) {
@@ -83481,7 +83487,7 @@ function createTypeChecker(host) {
83481
83487
  if (type.flags & 131072 /* Never */) {
83482
83488
  hasReturnOfTypeNever = true;
83483
83489
  }
83484
- pushIfUnique(aggregatedTypes, type);
83490
+ pushIfUnique(aggregatedTypes, isConstContext(expr) ? getRegularTypeOfLiteralType(type) : type);
83485
83491
  } else {
83486
83492
  hasReturnWithNoExpression = true;
83487
83493
  }
@@ -154243,6 +154249,7 @@ function getSymbolAtLocationForQuickInfo(node, checker) {
154243
154249
  return checker.getSymbolAtLocation(node);
154244
154250
  }
154245
154251
  function getPropertySymbolsFromContextualType(node, checker, contextualType, unionSymbolOk) {
154252
+ contextualType = contextualType.getNonNullableType();
154246
154253
  const name = getNameFromPropertyName(node.name);
154247
154254
  if (!name) return emptyArray;
154248
154255
  if (!contextualType.isUnion()) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "typescript",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "6.0.0-dev.20251030",
5
+ "version": "6.0.0-dev.20251031",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -115,5 +115,5 @@
115
115
  "node": "20.1.0",
116
116
  "npm": "8.19.4"
117
117
  },
118
- "gitHead": "2a90a739c1c1e87e3c3d0c93e16f7e5baadf8035"
118
+ "gitHead": "ac7825c48476a39aeeb7ea519d416c5d77fc34b8"
119
119
  }