typescript 4.5.0-dev.20210926 → 4.5.0-dev.20210927

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.
@@ -1052,6 +1052,7 @@
1052
1052
  "Private_accessor_was_defined_without_a_getter_2806": "Privátní přístupový objekt se definoval bez metody getter.",
1053
1053
  "Private_identifiers_are_not_allowed_in_variable_declarations_18029": "Privátní identifikátory se v deklaracích proměnných nepovolují.",
1054
1054
  "Private_identifiers_are_not_allowed_outside_class_bodies_18016": "Privátní identifikátory se mimo těla tříd nepovolují.",
1055
+ "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451": "Privátní identifikátory jsou povolené jenom v tělech třídy a smí se používat jenom jako součást deklarace člena třídy nebo přístupu k vlastnosti, případně na levé straně výrazu in.",
1055
1056
  "Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028": "Privátní identifikátory jsou dostupné jen při cílení na ECMAScript 2015 a novější.",
1056
1057
  "Private_identifiers_cannot_be_used_as_parameters_18009": "Privátní identifikátory se nedají použít jako parametry.",
1057
1058
  "Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105": "K privátnímu nebo chráněnému členu {0} se nedá přistupovat v parametru typu.",
@@ -1376,7 +1377,7 @@
1376
1377
  "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2362": "Levá strana aritmetické operace musí mít typ any, number, bigint nebo být typu výčtu.",
1377
1378
  "The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access_2779": "Levá strana výrazu přiřazení nemůže představovat přístup k nepovinné vlastnosti.",
1378
1379
  "The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364": "Levá strana výrazu přiřazení musí být proměnná nebo přístup k vlastnosti.",
1379
- "The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol_2360": "Levá strana výrazu in musí být typu any, string, number nebo symbol.",
1380
+ "The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or__2360": "Levá strana výrazu in musí být privátní identifikátor nebo typu any, string, number nebo symbol.",
1380
1381
  "The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358": "Levá strana výrazu instanceof musí být typu any, typem objektu nebo parametrem typu.",
1381
1382
  "The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156": "Národní prostředí, které se používá při zobrazování zpráv uživateli (třeba cs-CZ)",
1382
1383
  "The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136": "Maximální hloubka závislostí pro vyhledávání pod node_modules a načítání javascriptových souborů",
@@ -1052,6 +1052,7 @@
1052
1052
  "Private_accessor_was_defined_without_a_getter_2806": "La funzione di accesso privata è stata definita senza un getter.",
1053
1053
  "Private_identifiers_are_not_allowed_in_variable_declarations_18029": "Gli identificatori privati non sono consentiti nelle dichiarazioni di variabili.",
1054
1054
  "Private_identifiers_are_not_allowed_outside_class_bodies_18016": "Gli identificatori privati non sono consentiti all'esterno del corpo della classe.",
1055
+ "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451": "Gli identificatori privati sono consentiti solo nei corpi di classe e possono essere usati solo come parte di una dichiarazione di un membro della classe, dell'accesso alle proprietà o sulla parte sinistra di un'espressione 'in'.",
1055
1056
  "Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028": "Gli identificatori privati sono disponibili solo se destinati a ECMAScript 2015 e versioni successive.",
1056
1057
  "Private_identifiers_cannot_be_used_as_parameters_18009": "Non è possibile usare gli identificatori privati come parametri.",
1057
1058
  "Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105": "Non è possibile accedere al membro privato o protetto '{0}' in un parametro di tipo.",
@@ -1376,7 +1377,7 @@
1376
1377
  "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2362": "La parte sinistra di un'operazione aritmetica deve essere di tipo 'any', 'number', 'bigint' o un tipo enumerazione.",
1377
1378
  "The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access_2779": "La parte sinistra di un'espressione di assegnazione non può essere un accesso a proprietà facoltativo.",
1378
1379
  "The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364": "La parte sinistra di un'espressione di assegnazione deve essere una variabile o un accesso a proprietà.",
1379
- "The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol_2360": "La parte sinistra di un'espressione 'in' deve essere di tipo 'any', 'string', 'number' o 'symbol'.",
1380
+ "The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or__2360": "La parte sinistra di un'espressione 'in' deve essere un identificatore privato o di tipo 'any', 'string', 'number' o 'symbol'.",
1380
1381
  "The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358": "La parte sinistra di un'espressione 'instanceof' deve essere di tipo 'any' oppure essere un tipo di oggetto o un parametro di tipo.",
1381
1382
  "The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156": "Impostazioni locali usate per la visualizzazione di messaggi all'utente, ad esempio 'it-it'",
1382
1383
  "The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136": "Profondità massima delle dipendenze per la ricerca in node_modules e il caricamento dei file JavaScript.",
@@ -1052,6 +1052,7 @@
1052
1052
  "Private_accessor_was_defined_without_a_getter_2806": "프라이빗 접근자가 getter 없이 정의되었습니다.",
1053
1053
  "Private_identifiers_are_not_allowed_in_variable_declarations_18029": "변수 선언에서 프라이빗 식별자를 사용할 수 없습니다.",
1054
1054
  "Private_identifiers_are_not_allowed_outside_class_bodies_18016": "클래스 본문 외부에서 프라이빗 식별자를 사용할 수 없습니다.",
1055
+ "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451": "비공개 식별자는 클래스 본문에서만 허용되며 클래스 멤버 선언의 일부, 속성 액세스 또는 'in' 식의 왼쪽에서만 사용할 수 있습니다.",
1055
1056
  "Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028": "프라이빗 식별자는 ECMAScript 2015 이상을 대상으로 지정할 때만 사용할 수 있습니다.",
1056
1057
  "Private_identifiers_cannot_be_used_as_parameters_18009": "프라이빗 식별자는 매개 변수로 사용할 수 없습니다.",
1057
1058
  "Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105": "형식 매개 변수에서 프라이빗 또는 보호된 멤버 '{0}'에 액세스할 수 없습니다.",
@@ -1376,7 +1377,7 @@
1376
1377
  "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2362": "산술 연산의 왼쪽은 'any', 'number', 'bigint' 또는 열거형 형식이어야 합니다.",
1377
1378
  "The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access_2779": "할당 식의 왼쪽은 선택적 속성 액세스일 수 없습니다.",
1378
1379
  "The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364": "할당 식의 왼쪽은 변수 또는 속성 액세스여야 합니다.",
1379
- "The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol_2360": "'in' 식의 왼쪽은 'any', 'string', 'number' 또는 'symbol' 유형이어야 합니다.",
1380
+ "The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or__2360": "'in' 식의 왼쪽은 비공개 식별자이거나 'any', 'string', 'number' 또는 'symbol' 유형이어야 합니다.",
1380
1381
  "The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358": "'instanceof' 식 왼쪽은 'any' 형식, 개체 형식 또는 형식 매개 변수여야 합니다.",
1381
1382
  "The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156": "사용자에게 메시지를 표시할 때 사용되는 로캘입니다(예: 'en-us').",
1382
1383
  "The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136": "node_modules에서 검색하고 JavaScript 파일을 로드할 최대 종속성 깊이입니다.",
@@ -1052,6 +1052,7 @@
1052
1052
  "Private_accessor_was_defined_without_a_getter_2806": "O acessador privado foi definido sem um getter.",
1053
1053
  "Private_identifiers_are_not_allowed_in_variable_declarations_18029": "Identificadores privados não são permitidos em declarações de variáveis.",
1054
1054
  "Private_identifiers_are_not_allowed_outside_class_bodies_18016": "Identificadores privados não são permitidos fora dos corpos de classe.",
1055
+ "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451": "Identificadores privados são permitidos apenas em corpos de classe e só podem ser usados como parte de uma declaração de membro de classe, acesso de propriedade ou no lado esquerdo de uma expressão 'em'",
1055
1056
  "Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028": "Identificadores privados só estão disponíveis ao direcionar para o ECMAScript 2015 ou superior.",
1056
1057
  "Private_identifiers_cannot_be_used_as_parameters_18009": "Não é possível usar identificadores privados como parâmetros.",
1057
1058
  "Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105": "O membro privado ou protegido '{0}' não pode ser acessado em um parâmetro de tipo.",
@@ -1376,7 +1377,7 @@
1376
1377
  "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2362": "O lado esquerdo de uma operação aritmética deve ser do tipo 'any', 'number', 'bigint' ou um tipo enumerado.",
1377
1378
  "The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access_2779": "O lado esquerdo de uma expressão de atribuição pode não ser um acesso opcional de propriedade.",
1378
1379
  "The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364": "O lado esquerdo de uma expressão de atribuição deve ser uma variável ou um acesso à propriedade.",
1379
- "The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol_2360": "O lado esquerdo de uma expressão 'in' deve ser do tipo 'any', 'string', 'number' ou 'symbol'.",
1380
+ "The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or__2360": "O lado esquerdo de uma expressão 'em' deve ser um identificador privado ou do tipo 'qualquer', 'cadeia de caracteres', 'número' ou 'símbolo'.",
1380
1381
  "The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358": "O lado esquerdo de uma expressão 'instanceof' deve ser do tipo 'any', um tipo de objeto ou um parâmetro de tipo.",
1381
1382
  "The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156": "O local usado ao exibir mensagens ao usuário (por exemplo, 'en-us')",
1382
1383
  "The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136": "A profundidade máxima de dependência a ser pesquisada em arquivos node_modules e de carregamento de JavaScript.",
@@ -1052,6 +1052,7 @@
1052
1052
  "Private_accessor_was_defined_without_a_getter_2806": "Частный метод доступа был определен без метода получения.",
1053
1053
  "Private_identifiers_are_not_allowed_in_variable_declarations_18029": "Закрытые идентификаторы запрещено использовать в объявлениях переменных.",
1054
1054
  "Private_identifiers_are_not_allowed_outside_class_bodies_18016": "Закрытые идентификаторы запрещено использовать вне тела классов.",
1055
+ "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451": "Закрытые идентификаторы разрешены только в теле класса и могут использоваться только как часть объявления члена класса, доступа к свойствам или левой стороны выражения \"in\"",
1055
1056
  "Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028": "Закрытые идентификаторы доступны только при разработке для ECMAScript 2015 или более поздних версий.",
1056
1057
  "Private_identifiers_cannot_be_used_as_parameters_18009": "Закрытые идентификаторы не могут использоваться в качестве параметров.",
1057
1058
  "Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105": "Не удается обратиться к закрытому или защищенному члену \"{0}\" в параметре типа.",
@@ -1376,7 +1377,7 @@
1376
1377
  "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2362": "Левый операнд арифметической операции должен иметь тип \"any\", \"number\", \"bigint\" или тип перечисления.",
1377
1378
  "The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access_2779": "Левая часть выражения присваивания не может быть обращением к необязательному свойству.",
1378
1379
  "The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364": "В левой части выражения назначения должна быть переменная или доступ к свойству.",
1379
- "The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol_2360": "Левый операнд выражения in должен иметь тип any, string, number или Symbol.",
1380
+ "The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or__2360": "Левый операнд выражения \"in\" должен быть закрытым идентификатором или иметь тип any, string, number или symbol.",
1380
1381
  "The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358": "Левый операнд выражения instanceof должен иметь тип any, тип объекта или параметр типа.",
1381
1382
  "The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156": "Языковой стандарт, который используется при отображении сообщений пользователю (например, en-us)",
1382
1383
  "The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136": "Максимальная глубина зависимостей для поиска в папке node_modules и загрузки файлов JavaScript.",
package/lib/tsc.js CHANGED
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
69
69
  var ts;
70
70
  (function (ts) {
71
71
  ts.versionMajorMinor = "4.5";
72
- ts.version = ts.versionMajorMinor + ".0-dev.20210926";
72
+ ts.version = ts.versionMajorMinor + ".0-dev.20210927";
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  function tryGetNativeMap() {
@@ -48957,8 +48957,6 @@ var ts;
48957
48957
  }
48958
48958
  if (!(flags & 131072)) {
48959
48959
  includes |= flags & 205258751;
48960
- if (flags & 469499904)
48961
- includes |= 262144;
48962
48960
  if (type === wildcardType)
48963
48961
  includes |= 8388608;
48964
48962
  if (!strictNullChecks && flags & 98304) {
@@ -49240,11 +49238,17 @@ var ts;
49240
49238
  if (type === wildcardType)
49241
49239
  includes |= 8388608;
49242
49240
  }
49243
- else if ((strictNullChecks || !(flags & 98304)) && !typeSet.has(type.id.toString())) {
49244
- if (type.flags & 109440 && includes & 109440) {
49245
- includes |= 67108864;
49241
+ else if (strictNullChecks || !(flags & 98304)) {
49242
+ if (exactOptionalPropertyTypes && type === missingType) {
49243
+ includes |= 262144;
49244
+ type = undefinedType;
49245
+ }
49246
+ if (!typeSet.has(type.id.toString())) {
49247
+ if (type.flags & 109440 && includes & 109440) {
49248
+ includes |= 67108864;
49249
+ }
49250
+ typeSet.set(type.id.toString(), type);
49246
49251
  }
49247
- typeSet.set(type.id.toString(), type);
49248
49252
  }
49249
49253
  includes |= flags & 205258751;
49250
49254
  }
@@ -49308,14 +49312,13 @@ var ts;
49308
49312
  }
49309
49313
  return false;
49310
49314
  }
49311
- function extractIrreducible(types, flag) {
49312
- if (ts.every(types, function (t) { return !!(t.flags & 1048576) && ts.some(t.types, function (tt) { return !!(tt.flags & flag); }); })) {
49313
- for (var i = 0; i < types.length; i++) {
49314
- types[i] = filterType(types[i], function (t) { return !(t.flags & flag); });
49315
- }
49316
- return true;
49315
+ function eachIsUnionContaining(types, flag) {
49316
+ return ts.every(types, function (t) { return !!(t.flags & 1048576) && ts.some(t.types, function (tt) { return !!(tt.flags & flag); }); });
49317
+ }
49318
+ function removeFromEach(types, flag) {
49319
+ for (var i = 0; i < types.length; i++) {
49320
+ types[i] = filterType(types[i], function (t) { return !(t.flags & flag); });
49317
49321
  }
49318
- return false;
49319
49322
  }
49320
49323
  function intersectUnionsOfPrimitiveTypes(types) {
49321
49324
  var unionTypes;
@@ -49395,6 +49398,9 @@ var ts;
49395
49398
  if (includes & 16777216 && includes & 524288) {
49396
49399
  ts.orderedRemoveItemAt(typeSet, ts.findIndex(typeSet, isEmptyAnonymousObjectType));
49397
49400
  }
49401
+ if (includes & 262144) {
49402
+ typeSet[typeSet.indexOf(undefinedType)] = missingType;
49403
+ }
49398
49404
  if (typeSet.length === 0) {
49399
49405
  return unknownType;
49400
49406
  }
@@ -49408,10 +49414,13 @@ var ts;
49408
49414
  if (intersectUnionsOfPrimitiveTypes(typeSet)) {
49409
49415
  result = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);
49410
49416
  }
49411
- else if (extractIrreducible(typeSet, 32768)) {
49412
- result = getUnionType([getIntersectionType(typeSet), undefinedType], 1, aliasSymbol, aliasTypeArguments);
49417
+ else if (eachIsUnionContaining(typeSet, 32768)) {
49418
+ var undefinedOrMissingType = exactOptionalPropertyTypes && ts.some(typeSet, function (t) { return containsType(t.types, missingType); }) ? missingType : undefinedType;
49419
+ removeFromEach(typeSet, 32768);
49420
+ result = getUnionType([getIntersectionType(typeSet), undefinedOrMissingType], 1, aliasSymbol, aliasTypeArguments);
49413
49421
  }
49414
- else if (extractIrreducible(typeSet, 65536)) {
49422
+ else if (eachIsUnionContaining(typeSet, 65536)) {
49423
+ removeFromEach(typeSet, 65536);
49415
49424
  result = getUnionType([getIntersectionType(typeSet), nullType], 1, aliasSymbol, aliasTypeArguments);
49416
49425
  }
49417
49426
  else {
package/lib/tsserver.js CHANGED
@@ -100,7 +100,7 @@ var ts;
100
100
  // The following is baselined as a literal template type without intervention
101
101
  /** The version of the TypeScript compiler release */
102
102
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
103
- ts.version = ts.versionMajorMinor + ".0-dev.20210926";
103
+ ts.version = ts.versionMajorMinor + ".0-dev.20210927";
104
104
  /* @internal */
105
105
  var Comparison;
106
106
  (function (Comparison) {
@@ -4866,7 +4866,7 @@ var ts;
4866
4866
  TypeFlags[TypeFlags["IncludesMask"] = 205258751] = "IncludesMask";
4867
4867
  // The following flags are used for different purposes during union and intersection type construction
4868
4868
  /* @internal */
4869
- TypeFlags[TypeFlags["IncludesStructuredOrInstantiable"] = 262144] = "IncludesStructuredOrInstantiable";
4869
+ TypeFlags[TypeFlags["IncludesMissingType"] = 262144] = "IncludesMissingType";
4870
4870
  /* @internal */
4871
4871
  TypeFlags[TypeFlags["IncludesNonWideningType"] = 4194304] = "IncludesNonWideningType";
4872
4872
  /* @internal */
@@ -59017,8 +59017,6 @@ var ts;
59017
59017
  // We ignore 'never' types in unions
59018
59018
  if (!(flags & 131072 /* Never */)) {
59019
59019
  includes |= flags & 205258751 /* IncludesMask */;
59020
- if (flags & 469499904 /* StructuredOrInstantiable */)
59021
- includes |= 262144 /* IncludesStructuredOrInstantiable */;
59022
59020
  if (type === wildcardType)
59023
59021
  includes |= 8388608 /* IncludesWildcard */;
59024
59022
  if (!strictNullChecks && flags & 98304 /* Nullable */) {
@@ -59324,13 +59322,19 @@ var ts;
59324
59322
  if (type === wildcardType)
59325
59323
  includes |= 8388608 /* IncludesWildcard */;
59326
59324
  }
59327
- else if ((strictNullChecks || !(flags & 98304 /* Nullable */)) && !typeSet.has(type.id.toString())) {
59328
- if (type.flags & 109440 /* Unit */ && includes & 109440 /* Unit */) {
59329
- // We have seen two distinct unit types which means we should reduce to an
59330
- // empty intersection. Adding TypeFlags.NonPrimitive causes that to happen.
59331
- includes |= 67108864 /* NonPrimitive */;
59325
+ else if (strictNullChecks || !(flags & 98304 /* Nullable */)) {
59326
+ if (exactOptionalPropertyTypes && type === missingType) {
59327
+ includes |= 262144 /* IncludesMissingType */;
59328
+ type = undefinedType;
59329
+ }
59330
+ if (!typeSet.has(type.id.toString())) {
59331
+ if (type.flags & 109440 /* Unit */ && includes & 109440 /* Unit */) {
59332
+ // We have seen two distinct unit types which means we should reduce to an
59333
+ // empty intersection. Adding TypeFlags.NonPrimitive causes that to happen.
59334
+ includes |= 67108864 /* NonPrimitive */;
59335
+ }
59336
+ typeSet.set(type.id.toString(), type);
59332
59337
  }
59333
- typeSet.set(type.id.toString(), type);
59334
59338
  }
59335
59339
  includes |= flags & 205258751 /* IncludesMask */;
59336
59340
  }
@@ -59403,14 +59407,13 @@ var ts;
59403
59407
  }
59404
59408
  return false;
59405
59409
  }
59406
- function extractIrreducible(types, flag) {
59407
- if (ts.every(types, function (t) { return !!(t.flags & 1048576 /* Union */) && ts.some(t.types, function (tt) { return !!(tt.flags & flag); }); })) {
59408
- for (var i = 0; i < types.length; i++) {
59409
- types[i] = filterType(types[i], function (t) { return !(t.flags & flag); });
59410
- }
59411
- return true;
59410
+ function eachIsUnionContaining(types, flag) {
59411
+ return ts.every(types, function (t) { return !!(t.flags & 1048576 /* Union */) && ts.some(t.types, function (tt) { return !!(tt.flags & flag); }); });
59412
+ }
59413
+ function removeFromEach(types, flag) {
59414
+ for (var i = 0; i < types.length; i++) {
59415
+ types[i] = filterType(types[i], function (t) { return !(t.flags & flag); });
59412
59416
  }
59413
- return false;
59414
59417
  }
59415
59418
  // If the given list of types contains more than one union of primitive types, replace the
59416
59419
  // first with a union containing an intersection of those primitive types, then remove the
@@ -59519,6 +59522,9 @@ var ts;
59519
59522
  if (includes & 16777216 /* IncludesEmptyObject */ && includes & 524288 /* Object */) {
59520
59523
  ts.orderedRemoveItemAt(typeSet, ts.findIndex(typeSet, isEmptyAnonymousObjectType));
59521
59524
  }
59525
+ if (includes & 262144 /* IncludesMissingType */) {
59526
+ typeSet[typeSet.indexOf(undefinedType)] = missingType;
59527
+ }
59522
59528
  if (typeSet.length === 0) {
59523
59529
  return unknownType;
59524
59530
  }
@@ -59535,10 +59541,13 @@ var ts;
59535
59541
  // reduced we'll never reduce again, so this occurs at most once.
59536
59542
  result = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);
59537
59543
  }
59538
- else if (extractIrreducible(typeSet, 32768 /* Undefined */)) {
59539
- result = getUnionType([getIntersectionType(typeSet), undefinedType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
59544
+ else if (eachIsUnionContaining(typeSet, 32768 /* Undefined */)) {
59545
+ var undefinedOrMissingType = exactOptionalPropertyTypes && ts.some(typeSet, function (t) { return containsType(t.types, missingType); }) ? missingType : undefinedType;
59546
+ removeFromEach(typeSet, 32768 /* Undefined */);
59547
+ result = getUnionType([getIntersectionType(typeSet), undefinedOrMissingType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
59540
59548
  }
59541
- else if (extractIrreducible(typeSet, 65536 /* Null */)) {
59549
+ else if (eachIsUnionContaining(typeSet, 65536 /* Null */)) {
59550
+ removeFromEach(typeSet, 65536 /* Null */);
59542
59551
  result = getUnionType([getIntersectionType(typeSet), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
59543
59552
  }
59544
59553
  else {
@@ -294,7 +294,7 @@ var ts;
294
294
  // The following is baselined as a literal template type without intervention
295
295
  /** The version of the TypeScript compiler release */
296
296
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
297
- ts.version = ts.versionMajorMinor + ".0-dev.20210926";
297
+ ts.version = ts.versionMajorMinor + ".0-dev.20210927";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -5060,7 +5060,7 @@ var ts;
5060
5060
  TypeFlags[TypeFlags["IncludesMask"] = 205258751] = "IncludesMask";
5061
5061
  // The following flags are used for different purposes during union and intersection type construction
5062
5062
  /* @internal */
5063
- TypeFlags[TypeFlags["IncludesStructuredOrInstantiable"] = 262144] = "IncludesStructuredOrInstantiable";
5063
+ TypeFlags[TypeFlags["IncludesMissingType"] = 262144] = "IncludesMissingType";
5064
5064
  /* @internal */
5065
5065
  TypeFlags[TypeFlags["IncludesNonWideningType"] = 4194304] = "IncludesNonWideningType";
5066
5066
  /* @internal */
@@ -59211,8 +59211,6 @@ var ts;
59211
59211
  // We ignore 'never' types in unions
59212
59212
  if (!(flags & 131072 /* Never */)) {
59213
59213
  includes |= flags & 205258751 /* IncludesMask */;
59214
- if (flags & 469499904 /* StructuredOrInstantiable */)
59215
- includes |= 262144 /* IncludesStructuredOrInstantiable */;
59216
59214
  if (type === wildcardType)
59217
59215
  includes |= 8388608 /* IncludesWildcard */;
59218
59216
  if (!strictNullChecks && flags & 98304 /* Nullable */) {
@@ -59518,13 +59516,19 @@ var ts;
59518
59516
  if (type === wildcardType)
59519
59517
  includes |= 8388608 /* IncludesWildcard */;
59520
59518
  }
59521
- else if ((strictNullChecks || !(flags & 98304 /* Nullable */)) && !typeSet.has(type.id.toString())) {
59522
- if (type.flags & 109440 /* Unit */ && includes & 109440 /* Unit */) {
59523
- // We have seen two distinct unit types which means we should reduce to an
59524
- // empty intersection. Adding TypeFlags.NonPrimitive causes that to happen.
59525
- includes |= 67108864 /* NonPrimitive */;
59519
+ else if (strictNullChecks || !(flags & 98304 /* Nullable */)) {
59520
+ if (exactOptionalPropertyTypes && type === missingType) {
59521
+ includes |= 262144 /* IncludesMissingType */;
59522
+ type = undefinedType;
59523
+ }
59524
+ if (!typeSet.has(type.id.toString())) {
59525
+ if (type.flags & 109440 /* Unit */ && includes & 109440 /* Unit */) {
59526
+ // We have seen two distinct unit types which means we should reduce to an
59527
+ // empty intersection. Adding TypeFlags.NonPrimitive causes that to happen.
59528
+ includes |= 67108864 /* NonPrimitive */;
59529
+ }
59530
+ typeSet.set(type.id.toString(), type);
59526
59531
  }
59527
- typeSet.set(type.id.toString(), type);
59528
59532
  }
59529
59533
  includes |= flags & 205258751 /* IncludesMask */;
59530
59534
  }
@@ -59597,14 +59601,13 @@ var ts;
59597
59601
  }
59598
59602
  return false;
59599
59603
  }
59600
- function extractIrreducible(types, flag) {
59601
- if (ts.every(types, function (t) { return !!(t.flags & 1048576 /* Union */) && ts.some(t.types, function (tt) { return !!(tt.flags & flag); }); })) {
59602
- for (var i = 0; i < types.length; i++) {
59603
- types[i] = filterType(types[i], function (t) { return !(t.flags & flag); });
59604
- }
59605
- return true;
59604
+ function eachIsUnionContaining(types, flag) {
59605
+ return ts.every(types, function (t) { return !!(t.flags & 1048576 /* Union */) && ts.some(t.types, function (tt) { return !!(tt.flags & flag); }); });
59606
+ }
59607
+ function removeFromEach(types, flag) {
59608
+ for (var i = 0; i < types.length; i++) {
59609
+ types[i] = filterType(types[i], function (t) { return !(t.flags & flag); });
59606
59610
  }
59607
- return false;
59608
59611
  }
59609
59612
  // If the given list of types contains more than one union of primitive types, replace the
59610
59613
  // first with a union containing an intersection of those primitive types, then remove the
@@ -59713,6 +59716,9 @@ var ts;
59713
59716
  if (includes & 16777216 /* IncludesEmptyObject */ && includes & 524288 /* Object */) {
59714
59717
  ts.orderedRemoveItemAt(typeSet, ts.findIndex(typeSet, isEmptyAnonymousObjectType));
59715
59718
  }
59719
+ if (includes & 262144 /* IncludesMissingType */) {
59720
+ typeSet[typeSet.indexOf(undefinedType)] = missingType;
59721
+ }
59716
59722
  if (typeSet.length === 0) {
59717
59723
  return unknownType;
59718
59724
  }
@@ -59729,10 +59735,13 @@ var ts;
59729
59735
  // reduced we'll never reduce again, so this occurs at most once.
59730
59736
  result = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);
59731
59737
  }
59732
- else if (extractIrreducible(typeSet, 32768 /* Undefined */)) {
59733
- result = getUnionType([getIntersectionType(typeSet), undefinedType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
59738
+ else if (eachIsUnionContaining(typeSet, 32768 /* Undefined */)) {
59739
+ var undefinedOrMissingType = exactOptionalPropertyTypes && ts.some(typeSet, function (t) { return containsType(t.types, missingType); }) ? missingType : undefinedType;
59740
+ removeFromEach(typeSet, 32768 /* Undefined */);
59741
+ result = getUnionType([getIntersectionType(typeSet), undefinedOrMissingType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
59734
59742
  }
59735
- else if (extractIrreducible(typeSet, 65536 /* Null */)) {
59743
+ else if (eachIsUnionContaining(typeSet, 65536 /* Null */)) {
59744
+ removeFromEach(typeSet, 65536 /* Null */);
59736
59745
  result = getUnionType([getIntersectionType(typeSet), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
59737
59746
  }
59738
59747
  else {
package/lib/typescript.js CHANGED
@@ -294,7 +294,7 @@ var ts;
294
294
  // The following is baselined as a literal template type without intervention
295
295
  /** The version of the TypeScript compiler release */
296
296
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
297
- ts.version = ts.versionMajorMinor + ".0-dev.20210926";
297
+ ts.version = ts.versionMajorMinor + ".0-dev.20210927";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -5060,7 +5060,7 @@ var ts;
5060
5060
  TypeFlags[TypeFlags["IncludesMask"] = 205258751] = "IncludesMask";
5061
5061
  // The following flags are used for different purposes during union and intersection type construction
5062
5062
  /* @internal */
5063
- TypeFlags[TypeFlags["IncludesStructuredOrInstantiable"] = 262144] = "IncludesStructuredOrInstantiable";
5063
+ TypeFlags[TypeFlags["IncludesMissingType"] = 262144] = "IncludesMissingType";
5064
5064
  /* @internal */
5065
5065
  TypeFlags[TypeFlags["IncludesNonWideningType"] = 4194304] = "IncludesNonWideningType";
5066
5066
  /* @internal */
@@ -59211,8 +59211,6 @@ var ts;
59211
59211
  // We ignore 'never' types in unions
59212
59212
  if (!(flags & 131072 /* Never */)) {
59213
59213
  includes |= flags & 205258751 /* IncludesMask */;
59214
- if (flags & 469499904 /* StructuredOrInstantiable */)
59215
- includes |= 262144 /* IncludesStructuredOrInstantiable */;
59216
59214
  if (type === wildcardType)
59217
59215
  includes |= 8388608 /* IncludesWildcard */;
59218
59216
  if (!strictNullChecks && flags & 98304 /* Nullable */) {
@@ -59518,13 +59516,19 @@ var ts;
59518
59516
  if (type === wildcardType)
59519
59517
  includes |= 8388608 /* IncludesWildcard */;
59520
59518
  }
59521
- else if ((strictNullChecks || !(flags & 98304 /* Nullable */)) && !typeSet.has(type.id.toString())) {
59522
- if (type.flags & 109440 /* Unit */ && includes & 109440 /* Unit */) {
59523
- // We have seen two distinct unit types which means we should reduce to an
59524
- // empty intersection. Adding TypeFlags.NonPrimitive causes that to happen.
59525
- includes |= 67108864 /* NonPrimitive */;
59519
+ else if (strictNullChecks || !(flags & 98304 /* Nullable */)) {
59520
+ if (exactOptionalPropertyTypes && type === missingType) {
59521
+ includes |= 262144 /* IncludesMissingType */;
59522
+ type = undefinedType;
59523
+ }
59524
+ if (!typeSet.has(type.id.toString())) {
59525
+ if (type.flags & 109440 /* Unit */ && includes & 109440 /* Unit */) {
59526
+ // We have seen two distinct unit types which means we should reduce to an
59527
+ // empty intersection. Adding TypeFlags.NonPrimitive causes that to happen.
59528
+ includes |= 67108864 /* NonPrimitive */;
59529
+ }
59530
+ typeSet.set(type.id.toString(), type);
59526
59531
  }
59527
- typeSet.set(type.id.toString(), type);
59528
59532
  }
59529
59533
  includes |= flags & 205258751 /* IncludesMask */;
59530
59534
  }
@@ -59597,14 +59601,13 @@ var ts;
59597
59601
  }
59598
59602
  return false;
59599
59603
  }
59600
- function extractIrreducible(types, flag) {
59601
- if (ts.every(types, function (t) { return !!(t.flags & 1048576 /* Union */) && ts.some(t.types, function (tt) { return !!(tt.flags & flag); }); })) {
59602
- for (var i = 0; i < types.length; i++) {
59603
- types[i] = filterType(types[i], function (t) { return !(t.flags & flag); });
59604
- }
59605
- return true;
59604
+ function eachIsUnionContaining(types, flag) {
59605
+ return ts.every(types, function (t) { return !!(t.flags & 1048576 /* Union */) && ts.some(t.types, function (tt) { return !!(tt.flags & flag); }); });
59606
+ }
59607
+ function removeFromEach(types, flag) {
59608
+ for (var i = 0; i < types.length; i++) {
59609
+ types[i] = filterType(types[i], function (t) { return !(t.flags & flag); });
59606
59610
  }
59607
- return false;
59608
59611
  }
59609
59612
  // If the given list of types contains more than one union of primitive types, replace the
59610
59613
  // first with a union containing an intersection of those primitive types, then remove the
@@ -59713,6 +59716,9 @@ var ts;
59713
59716
  if (includes & 16777216 /* IncludesEmptyObject */ && includes & 524288 /* Object */) {
59714
59717
  ts.orderedRemoveItemAt(typeSet, ts.findIndex(typeSet, isEmptyAnonymousObjectType));
59715
59718
  }
59719
+ if (includes & 262144 /* IncludesMissingType */) {
59720
+ typeSet[typeSet.indexOf(undefinedType)] = missingType;
59721
+ }
59716
59722
  if (typeSet.length === 0) {
59717
59723
  return unknownType;
59718
59724
  }
@@ -59729,10 +59735,13 @@ var ts;
59729
59735
  // reduced we'll never reduce again, so this occurs at most once.
59730
59736
  result = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);
59731
59737
  }
59732
- else if (extractIrreducible(typeSet, 32768 /* Undefined */)) {
59733
- result = getUnionType([getIntersectionType(typeSet), undefinedType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
59738
+ else if (eachIsUnionContaining(typeSet, 32768 /* Undefined */)) {
59739
+ var undefinedOrMissingType = exactOptionalPropertyTypes && ts.some(typeSet, function (t) { return containsType(t.types, missingType); }) ? missingType : undefinedType;
59740
+ removeFromEach(typeSet, 32768 /* Undefined */);
59741
+ result = getUnionType([getIntersectionType(typeSet), undefinedOrMissingType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
59734
59742
  }
59735
- else if (extractIrreducible(typeSet, 65536 /* Null */)) {
59743
+ else if (eachIsUnionContaining(typeSet, 65536 /* Null */)) {
59744
+ removeFromEach(typeSet, 65536 /* Null */);
59736
59745
  result = getUnionType([getIntersectionType(typeSet), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
59737
59746
  }
59738
59747
  else {
@@ -294,7 +294,7 @@ var ts;
294
294
  // The following is baselined as a literal template type without intervention
295
295
  /** The version of the TypeScript compiler release */
296
296
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
297
- ts.version = ts.versionMajorMinor + ".0-dev.20210926";
297
+ ts.version = ts.versionMajorMinor + ".0-dev.20210927";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -5060,7 +5060,7 @@ var ts;
5060
5060
  TypeFlags[TypeFlags["IncludesMask"] = 205258751] = "IncludesMask";
5061
5061
  // The following flags are used for different purposes during union and intersection type construction
5062
5062
  /* @internal */
5063
- TypeFlags[TypeFlags["IncludesStructuredOrInstantiable"] = 262144] = "IncludesStructuredOrInstantiable";
5063
+ TypeFlags[TypeFlags["IncludesMissingType"] = 262144] = "IncludesMissingType";
5064
5064
  /* @internal */
5065
5065
  TypeFlags[TypeFlags["IncludesNonWideningType"] = 4194304] = "IncludesNonWideningType";
5066
5066
  /* @internal */
@@ -59211,8 +59211,6 @@ var ts;
59211
59211
  // We ignore 'never' types in unions
59212
59212
  if (!(flags & 131072 /* Never */)) {
59213
59213
  includes |= flags & 205258751 /* IncludesMask */;
59214
- if (flags & 469499904 /* StructuredOrInstantiable */)
59215
- includes |= 262144 /* IncludesStructuredOrInstantiable */;
59216
59214
  if (type === wildcardType)
59217
59215
  includes |= 8388608 /* IncludesWildcard */;
59218
59216
  if (!strictNullChecks && flags & 98304 /* Nullable */) {
@@ -59518,13 +59516,19 @@ var ts;
59518
59516
  if (type === wildcardType)
59519
59517
  includes |= 8388608 /* IncludesWildcard */;
59520
59518
  }
59521
- else if ((strictNullChecks || !(flags & 98304 /* Nullable */)) && !typeSet.has(type.id.toString())) {
59522
- if (type.flags & 109440 /* Unit */ && includes & 109440 /* Unit */) {
59523
- // We have seen two distinct unit types which means we should reduce to an
59524
- // empty intersection. Adding TypeFlags.NonPrimitive causes that to happen.
59525
- includes |= 67108864 /* NonPrimitive */;
59519
+ else if (strictNullChecks || !(flags & 98304 /* Nullable */)) {
59520
+ if (exactOptionalPropertyTypes && type === missingType) {
59521
+ includes |= 262144 /* IncludesMissingType */;
59522
+ type = undefinedType;
59523
+ }
59524
+ if (!typeSet.has(type.id.toString())) {
59525
+ if (type.flags & 109440 /* Unit */ && includes & 109440 /* Unit */) {
59526
+ // We have seen two distinct unit types which means we should reduce to an
59527
+ // empty intersection. Adding TypeFlags.NonPrimitive causes that to happen.
59528
+ includes |= 67108864 /* NonPrimitive */;
59529
+ }
59530
+ typeSet.set(type.id.toString(), type);
59526
59531
  }
59527
- typeSet.set(type.id.toString(), type);
59528
59532
  }
59529
59533
  includes |= flags & 205258751 /* IncludesMask */;
59530
59534
  }
@@ -59597,14 +59601,13 @@ var ts;
59597
59601
  }
59598
59602
  return false;
59599
59603
  }
59600
- function extractIrreducible(types, flag) {
59601
- if (ts.every(types, function (t) { return !!(t.flags & 1048576 /* Union */) && ts.some(t.types, function (tt) { return !!(tt.flags & flag); }); })) {
59602
- for (var i = 0; i < types.length; i++) {
59603
- types[i] = filterType(types[i], function (t) { return !(t.flags & flag); });
59604
- }
59605
- return true;
59604
+ function eachIsUnionContaining(types, flag) {
59605
+ return ts.every(types, function (t) { return !!(t.flags & 1048576 /* Union */) && ts.some(t.types, function (tt) { return !!(tt.flags & flag); }); });
59606
+ }
59607
+ function removeFromEach(types, flag) {
59608
+ for (var i = 0; i < types.length; i++) {
59609
+ types[i] = filterType(types[i], function (t) { return !(t.flags & flag); });
59606
59610
  }
59607
- return false;
59608
59611
  }
59609
59612
  // If the given list of types contains more than one union of primitive types, replace the
59610
59613
  // first with a union containing an intersection of those primitive types, then remove the
@@ -59713,6 +59716,9 @@ var ts;
59713
59716
  if (includes & 16777216 /* IncludesEmptyObject */ && includes & 524288 /* Object */) {
59714
59717
  ts.orderedRemoveItemAt(typeSet, ts.findIndex(typeSet, isEmptyAnonymousObjectType));
59715
59718
  }
59719
+ if (includes & 262144 /* IncludesMissingType */) {
59720
+ typeSet[typeSet.indexOf(undefinedType)] = missingType;
59721
+ }
59716
59722
  if (typeSet.length === 0) {
59717
59723
  return unknownType;
59718
59724
  }
@@ -59729,10 +59735,13 @@ var ts;
59729
59735
  // reduced we'll never reduce again, so this occurs at most once.
59730
59736
  result = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);
59731
59737
  }
59732
- else if (extractIrreducible(typeSet, 32768 /* Undefined */)) {
59733
- result = getUnionType([getIntersectionType(typeSet), undefinedType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
59738
+ else if (eachIsUnionContaining(typeSet, 32768 /* Undefined */)) {
59739
+ var undefinedOrMissingType = exactOptionalPropertyTypes && ts.some(typeSet, function (t) { return containsType(t.types, missingType); }) ? missingType : undefinedType;
59740
+ removeFromEach(typeSet, 32768 /* Undefined */);
59741
+ result = getUnionType([getIntersectionType(typeSet), undefinedOrMissingType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
59734
59742
  }
59735
- else if (extractIrreducible(typeSet, 65536 /* Null */)) {
59743
+ else if (eachIsUnionContaining(typeSet, 65536 /* Null */)) {
59744
+ removeFromEach(typeSet, 65536 /* Null */);
59736
59745
  result = getUnionType([getIntersectionType(typeSet), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
59737
59746
  }
59738
59747
  else {
@@ -89,7 +89,7 @@ var ts;
89
89
  // The following is baselined as a literal template type without intervention
90
90
  /** The version of the TypeScript compiler release */
91
91
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
92
- ts.version = ts.versionMajorMinor + ".0-dev.20210926";
92
+ ts.version = ts.versionMajorMinor + ".0-dev.20210927";
93
93
  /* @internal */
94
94
  var Comparison;
95
95
  (function (Comparison) {
@@ -4855,7 +4855,7 @@ var ts;
4855
4855
  TypeFlags[TypeFlags["IncludesMask"] = 205258751] = "IncludesMask";
4856
4856
  // The following flags are used for different purposes during union and intersection type construction
4857
4857
  /* @internal */
4858
- TypeFlags[TypeFlags["IncludesStructuredOrInstantiable"] = 262144] = "IncludesStructuredOrInstantiable";
4858
+ TypeFlags[TypeFlags["IncludesMissingType"] = 262144] = "IncludesMissingType";
4859
4859
  /* @internal */
4860
4860
  TypeFlags[TypeFlags["IncludesNonWideningType"] = 4194304] = "IncludesNonWideningType";
4861
4861
  /* @internal */
@@ -59006,8 +59006,6 @@ var ts;
59006
59006
  // We ignore 'never' types in unions
59007
59007
  if (!(flags & 131072 /* Never */)) {
59008
59008
  includes |= flags & 205258751 /* IncludesMask */;
59009
- if (flags & 469499904 /* StructuredOrInstantiable */)
59010
- includes |= 262144 /* IncludesStructuredOrInstantiable */;
59011
59009
  if (type === wildcardType)
59012
59010
  includes |= 8388608 /* IncludesWildcard */;
59013
59011
  if (!strictNullChecks && flags & 98304 /* Nullable */) {
@@ -59313,13 +59311,19 @@ var ts;
59313
59311
  if (type === wildcardType)
59314
59312
  includes |= 8388608 /* IncludesWildcard */;
59315
59313
  }
59316
- else if ((strictNullChecks || !(flags & 98304 /* Nullable */)) && !typeSet.has(type.id.toString())) {
59317
- if (type.flags & 109440 /* Unit */ && includes & 109440 /* Unit */) {
59318
- // We have seen two distinct unit types which means we should reduce to an
59319
- // empty intersection. Adding TypeFlags.NonPrimitive causes that to happen.
59320
- includes |= 67108864 /* NonPrimitive */;
59314
+ else if (strictNullChecks || !(flags & 98304 /* Nullable */)) {
59315
+ if (exactOptionalPropertyTypes && type === missingType) {
59316
+ includes |= 262144 /* IncludesMissingType */;
59317
+ type = undefinedType;
59318
+ }
59319
+ if (!typeSet.has(type.id.toString())) {
59320
+ if (type.flags & 109440 /* Unit */ && includes & 109440 /* Unit */) {
59321
+ // We have seen two distinct unit types which means we should reduce to an
59322
+ // empty intersection. Adding TypeFlags.NonPrimitive causes that to happen.
59323
+ includes |= 67108864 /* NonPrimitive */;
59324
+ }
59325
+ typeSet.set(type.id.toString(), type);
59321
59326
  }
59322
- typeSet.set(type.id.toString(), type);
59323
59327
  }
59324
59328
  includes |= flags & 205258751 /* IncludesMask */;
59325
59329
  }
@@ -59392,14 +59396,13 @@ var ts;
59392
59396
  }
59393
59397
  return false;
59394
59398
  }
59395
- function extractIrreducible(types, flag) {
59396
- if (ts.every(types, function (t) { return !!(t.flags & 1048576 /* Union */) && ts.some(t.types, function (tt) { return !!(tt.flags & flag); }); })) {
59397
- for (var i = 0; i < types.length; i++) {
59398
- types[i] = filterType(types[i], function (t) { return !(t.flags & flag); });
59399
- }
59400
- return true;
59399
+ function eachIsUnionContaining(types, flag) {
59400
+ return ts.every(types, function (t) { return !!(t.flags & 1048576 /* Union */) && ts.some(t.types, function (tt) { return !!(tt.flags & flag); }); });
59401
+ }
59402
+ function removeFromEach(types, flag) {
59403
+ for (var i = 0; i < types.length; i++) {
59404
+ types[i] = filterType(types[i], function (t) { return !(t.flags & flag); });
59401
59405
  }
59402
- return false;
59403
59406
  }
59404
59407
  // If the given list of types contains more than one union of primitive types, replace the
59405
59408
  // first with a union containing an intersection of those primitive types, then remove the
@@ -59508,6 +59511,9 @@ var ts;
59508
59511
  if (includes & 16777216 /* IncludesEmptyObject */ && includes & 524288 /* Object */) {
59509
59512
  ts.orderedRemoveItemAt(typeSet, ts.findIndex(typeSet, isEmptyAnonymousObjectType));
59510
59513
  }
59514
+ if (includes & 262144 /* IncludesMissingType */) {
59515
+ typeSet[typeSet.indexOf(undefinedType)] = missingType;
59516
+ }
59511
59517
  if (typeSet.length === 0) {
59512
59518
  return unknownType;
59513
59519
  }
@@ -59524,10 +59530,13 @@ var ts;
59524
59530
  // reduced we'll never reduce again, so this occurs at most once.
59525
59531
  result = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);
59526
59532
  }
59527
- else if (extractIrreducible(typeSet, 32768 /* Undefined */)) {
59528
- result = getUnionType([getIntersectionType(typeSet), undefinedType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
59533
+ else if (eachIsUnionContaining(typeSet, 32768 /* Undefined */)) {
59534
+ var undefinedOrMissingType = exactOptionalPropertyTypes && ts.some(typeSet, function (t) { return containsType(t.types, missingType); }) ? missingType : undefinedType;
59535
+ removeFromEach(typeSet, 32768 /* Undefined */);
59536
+ result = getUnionType([getIntersectionType(typeSet), undefinedOrMissingType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
59529
59537
  }
59530
- else if (extractIrreducible(typeSet, 65536 /* Null */)) {
59538
+ else if (eachIsUnionContaining(typeSet, 65536 /* Null */)) {
59539
+ removeFromEach(typeSet, 65536 /* Null */);
59531
59540
  result = getUnionType([getIntersectionType(typeSet), nullType], 1 /* Literal */, aliasSymbol, aliasTypeArguments);
59532
59541
  }
59533
59542
  else {
@@ -1052,6 +1052,7 @@
1052
1052
  "Private_accessor_was_defined_without_a_getter_2806": "定义了专用访问器,但没有 Getter。",
1053
1053
  "Private_identifiers_are_not_allowed_in_variable_declarations_18029": "不允许在变量声明中使用专用标识符。",
1054
1054
  "Private_identifiers_are_not_allowed_outside_class_bodies_18016": "不允许在类主体之外使用专用标识符。",
1055
+ "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451": "专用标识符仅允许在类主体中使用,并且只能用作类成员声明的一部分、属性访问或用在 \"in\" 表达式的左侧",
1055
1056
  "Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028": "专用标识符仅在面向 ECMAScript 2015 和更高版本时可用。",
1056
1057
  "Private_identifiers_cannot_be_used_as_parameters_18009": "不能将专用标识符用作参数。",
1057
1058
  "Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105": "不能在类型参数上访问专用或受保护的成员 \"{0}\"。",
@@ -1376,7 +1377,7 @@
1376
1377
  "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2362": "算术运算左侧必须是 \"any\"、\"number\"、\"bigint\" 或枚举类型。",
1377
1378
  "The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access_2779": "赋值表达式的左侧不能是可选属性访问。",
1378
1379
  "The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364": "赋值表达式的左侧必须是变量或属性访问。",
1379
- "The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol_2360": "\"in\" 表达式左侧的类型必须为 \"any\"、\"string\"、\"number\" 或 \"symbol\"。",
1380
+ "The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or__2360": "\"in\" 表达式的左侧必须是专用标识符或其类型必须为 \"any\"、\"string\"、\"number\" 或 \"symbol\"。",
1380
1381
  "The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358": "\"instanceof\" 表达式左侧必须是 \"any\" 类型、对象类型或类型参数。",
1381
1382
  "The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156": "向用户显示消息时所用的区域设置(例如,\"en-us\")",
1382
1383
  "The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136": "用于搜索 node_modules 和加载 JavaScript 文件的最大依赖项深度。",
@@ -1052,6 +1052,7 @@
1052
1052
  "Private_accessor_was_defined_without_a_getter_2806": "私人存取子已在不使用 getter 的情況下定義。",
1053
1053
  "Private_identifiers_are_not_allowed_in_variable_declarations_18029": "變數宣告中不允許私人識別碼。",
1054
1054
  "Private_identifiers_are_not_allowed_outside_class_bodies_18016": "不允許私人識別碼位於類別主體外。",
1055
+ "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451": "私人識別碼只能在類別主體中使用,且只能做為類別成員宣告、屬性存取或 'in' 運算式左側的一部分使用",
1055
1056
  "Private_identifiers_are_only_available_when_targeting_ECMAScript_2015_and_higher_18028": "只有當目標為 ECMAScript 2015 及更新版本時,才可使用私人識別碼。",
1056
1057
  "Private_identifiers_cannot_be_used_as_parameters_18009": "私人識別碼不可用作為參數。",
1057
1058
  "Private_or_protected_member_0_cannot_be_accessed_on_a_type_parameter_4105": "無法在型別參數上存取私人或受保護的成員 '{0}'。",
@@ -1376,7 +1377,7 @@
1376
1377
  "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2362": "算術運算的左側內容必須屬於 'any'、'number'、'bigint' 或列舉類型。",
1377
1378
  "The_left_hand_side_of_an_assignment_expression_may_not_be_an_optional_property_access_2779": "指派運算式的左側不可為選擇性屬性存取。",
1378
1379
  "The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364": "指派運算式的左邊必須是變數或屬性存取。",
1379
- "The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol_2360": "'in' 運算式的左側必須是 'any'、'string'、'number' 或 'symbol' 類型。",
1380
+ "The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or__2360": "'in' 運算式的左側必須是私人識別碼或 'any'、'string'、'number' 或 'symbol' 類型。",
1380
1381
  "The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358": "'instanceof' 運算式左側必須是類型 'any'、物件類型或型別參數。",
1381
1382
  "The_locale_used_when_displaying_messages_to_the_user_e_g_en_us_6156": "對使用者顯示訊息時所使用的地區設定 (例如 'zh-tw')",
1382
1383
  "The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files_6136": "在 node_modules 及載入 JavaScript 檔案下搜尋時的最大相依性深度。",
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": "4.5.0-dev.20210926",
5
+ "version": "4.5.0-dev.20210927",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [