typescript 4.6.0-dev.20220205 → 4.6.0-dev.20220209

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.
@@ -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.20220205";
92
+ ts.version = ts.versionMajorMinor + ".0-dev.20220209";
93
93
  /* @internal */
94
94
  var Comparison;
95
95
  (function (Comparison) {
@@ -13886,6 +13886,10 @@ var ts;
13886
13886
  return undefined;
13887
13887
  }
13888
13888
  ts.getDeclarationOfKind = getDeclarationOfKind;
13889
+ function getDeclarationsOfKind(symbol, kind) {
13890
+ return ts.filter(symbol.declarations || ts.emptyArray, function (d) { return d.kind === kind; });
13891
+ }
13892
+ ts.getDeclarationsOfKind = getDeclarationsOfKind;
13889
13893
  function createSymbolTable(symbols) {
13890
13894
  var result = new ts.Map();
13891
13895
  if (symbols) {
@@ -55475,6 +55479,39 @@ var ts;
55475
55479
  }
55476
55480
  return links.type;
55477
55481
  }
55482
+ function getWriteTypeOfSymbolWithDeferredType(symbol) {
55483
+ var links = getSymbolLinks(symbol);
55484
+ if (!links.writeType && links.deferralWriteConstituents) {
55485
+ ts.Debug.assertIsDefined(links.deferralParent);
55486
+ ts.Debug.assertIsDefined(links.deferralConstituents);
55487
+ links.writeType = links.deferralParent.flags & 1048576 /* Union */ ? getUnionType(links.deferralWriteConstituents) : getIntersectionType(links.deferralWriteConstituents);
55488
+ }
55489
+ return links.writeType;
55490
+ }
55491
+ /**
55492
+ * Distinct write types come only from set accessors, but union and intersection
55493
+ * properties deriving from set accessors will either pre-compute or defer the
55494
+ * union or intersection of the writeTypes of their constituents. To account for
55495
+ * this, we will assume that any deferred type or transient symbol may have a
55496
+ * `writeType` (or a deferred write type ready to be computed) that should be
55497
+ * used before looking for set accessor declarations.
55498
+ */
55499
+ function getWriteTypeOfSymbol(symbol) {
55500
+ var checkFlags = ts.getCheckFlags(symbol);
55501
+ if (checkFlags & 65536 /* DeferredType */) {
55502
+ var writeType = getWriteTypeOfSymbolWithDeferredType(symbol);
55503
+ if (writeType) {
55504
+ return writeType;
55505
+ }
55506
+ }
55507
+ if (symbol.flags & 33554432 /* Transient */) {
55508
+ var writeType = symbol.writeType;
55509
+ if (writeType) {
55510
+ return writeType;
55511
+ }
55512
+ }
55513
+ return getSetAccessorTypeOfSymbol(symbol);
55514
+ }
55478
55515
  function getSetAccessorTypeOfSymbol(symbol) {
55479
55516
  if (symbol.flags & 98304 /* Accessor */) {
55480
55517
  var type = getTypeOfSetAccessor(symbol);
@@ -57845,6 +57882,7 @@ var ts;
57845
57882
  var firstType;
57846
57883
  var nameType;
57847
57884
  var propTypes = [];
57885
+ var writeTypes;
57848
57886
  var firstValueDeclaration;
57849
57887
  var hasNonUniformValueDeclaration = false;
57850
57888
  for (var _d = 0, props_1 = props; _d < props_1.length; _d++) {
@@ -57861,6 +57899,10 @@ var ts;
57861
57899
  firstType = type;
57862
57900
  nameType = getSymbolLinks(prop).nameType;
57863
57901
  }
57902
+ var writeType = getWriteTypeOfSymbol(prop);
57903
+ if (writeTypes || writeType !== type) {
57904
+ writeTypes = ts.append(!writeTypes ? propTypes.slice() : writeTypes, writeType);
57905
+ }
57864
57906
  else if (type !== firstType) {
57865
57907
  checkFlags |= 64 /* HasNonUniformType */;
57866
57908
  }
@@ -57889,9 +57931,13 @@ var ts;
57889
57931
  result.checkFlags |= 65536 /* DeferredType */;
57890
57932
  result.deferralParent = containingType;
57891
57933
  result.deferralConstituents = propTypes;
57934
+ result.deferralWriteConstituents = writeTypes;
57892
57935
  }
57893
57936
  else {
57894
57937
  result.type = isUnion ? getUnionType(propTypes) : getIntersectionType(propTypes);
57938
+ if (writeTypes) {
57939
+ result.writeType = isUnion ? getUnionType(writeTypes) : getIntersectionType(writeTypes);
57940
+ }
57895
57941
  }
57896
57942
  return result;
57897
57943
  }
@@ -59033,7 +59079,7 @@ var ts;
59033
59079
  }
59034
59080
  function getImpliedConstraint(type, checkNode, extendsNode) {
59035
59081
  return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, checkNode.elements[0], extendsNode.elements[0]) :
59036
- getActualTypeVariable(getTypeFromTypeNode(checkNode)) === type ? getTypeFromTypeNode(extendsNode) :
59082
+ getActualTypeVariable(getTypeFromTypeNode(checkNode)) === getActualTypeVariable(type) ? getTypeFromTypeNode(extendsNode) :
59037
59083
  undefined;
59038
59084
  }
59039
59085
  function getConditionalFlowTypeOfType(type, node) {
@@ -73022,7 +73068,7 @@ var ts;
73022
73068
  error(right, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, ts.idText(right));
73023
73069
  return errorType;
73024
73070
  }
73025
- propType = isThisPropertyAccessInConstructor(node, prop) ? autoType : writing ? getSetAccessorTypeOfSymbol(prop) : getTypeOfSymbol(prop);
73071
+ propType = isThisPropertyAccessInConstructor(node, prop) ? autoType : writing ? getWriteTypeOfSymbol(prop) : getTypeOfSymbol(prop);
73026
73072
  }
73027
73073
  return getFlowTypeOfAccessExpression(node, prop, propType, right, checkMode);
73028
73074
  }
@@ -435,6 +435,7 @@
435
435
  "Convert_function_to_an_ES2015_class_95001": "将函数转换为 ES2015 类",
436
436
  "Convert_invalid_character_to_its_html_entity_code_95100": "将无效字符转换为其 HTML 实体代码",
437
437
  "Convert_named_export_to_default_export_95062": "将命名导出转换为默认导出",
438
+ "Convert_named_imports_to_default_import_95170": "将命名导入转换为默认导入",
438
439
  "Convert_named_imports_to_namespace_import_95057": "将命名导入转换为命名空间导入",
439
440
  "Convert_namespace_import_to_named_imports_95056": "将命名空间导入转换为命名导入",
440
441
  "Convert_overload_list_to_single_signature_95118": "将重载列表转换为单一签名",
@@ -1116,7 +1117,6 @@
1116
1117
  "Property_0_is_protected_in_type_1_but_public_in_type_2_2444": "属性“{0}”在类型“{1}”中受保护,但在类型“{2}”中为公共属性。",
1117
1118
  "Property_0_is_used_before_being_assigned_2565": "在赋值前使用了属性“{0}”。",
1118
1119
  "Property_0_is_used_before_its_initialization_2729": "属性 \"{0}\" 在其初始化前已被使用。",
1119
- "Property_0_may_not_be_used_in_a_static_property_s_initializer_in_the_same_class_when_target_is_esnex_2810": "当 “target” 为 “esnext” 且 “useDefineForClassFields” 为 ”false” 时,属性“{0}”不能用在同一类静态属性的初始化表达式中。",
1120
1120
  "Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568": "类型“{1}”上不存在属性“{0}”。你是否是指“{2}”?",
1121
1121
  "Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property_2606": "JSX 展开特性的“{0}”属性不能分配给目标属性。",
1122
1122
  "Property_0_of_exported_class_expression_may_not_be_private_or_protected_4094": "导出类表达式的属性“{0}”可能不是私密或受保护的属性。",
@@ -1324,7 +1324,6 @@
1324
1324
  "Starting_compilation_in_watch_mode_6031": "在监视模式下开始编译...",
1325
1325
  "Statement_expected_1129": "应为语句。",
1326
1326
  "Statements_are_not_allowed_in_ambient_contexts_1036": "不允许在环境上下文中使用语句。",
1327
- "Static_fields_with_private_names_can_t_have_initializers_when_the_useDefineForClassFields_flag_is_no_2805": "若未使用 \"esnext\" 的 \"--target\" 指定 \"--useDefineForClassFields\" 标志,则具有专用名称的静态字段不能有初始值设定项。请考虑添加 \"--useDefineForClassFields\" 标志。",
1328
1327
  "Static_members_cannot_reference_class_type_parameters_2302": "静态成员不能引用类类型参数。",
1329
1328
  "Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1_2699": "静态属性“{0}”与构造函数“{1}”的内置属性函数“{0}”冲突。",
1330
1329
  "String_literal_expected_1141": "应为字符串文本。",
@@ -435,6 +435,7 @@
435
435
  "Convert_function_to_an_ES2015_class_95001": "將函式轉換為 ES2015 類別",
436
436
  "Convert_invalid_character_to_its_html_entity_code_95100": "將無效字元轉換為其 HTML 實體代碼",
437
437
  "Convert_named_export_to_default_export_95062": "將具名匯出轉換為預設匯出",
438
+ "Convert_named_imports_to_default_import_95170": "將具名匯入轉換為預設匯入",
438
439
  "Convert_named_imports_to_namespace_import_95057": "將具名匯入轉換為命名空間匯入",
439
440
  "Convert_namespace_import_to_named_imports_95056": "將命名空間匯入轉換為具名匯入",
440
441
  "Convert_overload_list_to_single_signature_95118": "將多載清單轉換成單一特徵標記",
@@ -1116,7 +1117,6 @@
1116
1117
  "Property_0_is_protected_in_type_1_but_public_in_type_2_2444": "在類型 '{1}' 中,'{0}' 是受保護屬性,但在類型 '{2}' 中是公用屬性。",
1117
1118
  "Property_0_is_used_before_being_assigned_2565": "屬性 '{0}' 已在指派之前使用。",
1118
1119
  "Property_0_is_used_before_its_initialization_2729": "將屬性 '{0}' 初始化前已使用該屬性。",
1119
- "Property_0_may_not_be_used_in_a_static_property_s_initializer_in_the_same_class_when_target_is_esnex_2810": "當 'target' 為 'esnext' 且 'useDefineForClassFields' 為 'false' 時,不能在同一個類別的靜態屬性初始設定式中使用屬性 '{0}'。",
1120
1120
  "Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568": "類型 '{1}' 可能不存在屬性 '{0}'。您指的是 '{2}' 嗎?",
1121
1121
  "Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property_2606": "JSX 擴張屬性 (Attribute) 的屬性 (Property) '{0}' 不可指派給目標屬性 (Property)。",
1122
1122
  "Property_0_of_exported_class_expression_may_not_be_private_or_protected_4094": "匯出之類別運算式的屬性 '{0}' 可能為私人或受保護。",
@@ -1324,7 +1324,6 @@
1324
1324
  "Starting_compilation_in_watch_mode_6031": "在監看模式中開始編譯...",
1325
1325
  "Statement_expected_1129": "必須是陳述式。",
1326
1326
  "Statements_are_not_allowed_in_ambient_contexts_1036": "環境內容中不得有陳述式。",
1327
- "Static_fields_with_private_names_can_t_have_initializers_when_the_useDefineForClassFields_flag_is_no_2805": "當 '--useDefineForClassFields' 旗標未以 'esnext' 的 '--target' 指定時,具有私人名稱的靜態欄位不得有初始設定式。請考慮新增 '--useDefineForClassFields' 旗標。",
1328
1327
  "Static_members_cannot_reference_class_type_parameters_2302": "靜態成員不得參考類別類型參數。",
1329
1328
  "Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1_2699": "靜態屬性 '{0}' 與建構函式 '{1}' 的內建屬性 'Function.{0}' 相衝突。",
1330
1329
  "String_literal_expected_1141": "必須是字串常值。",
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.6.0-dev.20220205",
5
+ "version": "4.6.0-dev.20220209",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [