typescript 4.7.0-dev.20220327 → 4.7.0-dev.20220330
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/de/diagnosticMessages.generated.json +1 -0
- package/lib/ja/diagnosticMessages.generated.json +1 -0
- package/lib/ko/diagnosticMessages.generated.json +1 -0
- package/lib/pl/diagnosticMessages.generated.json +1 -0
- package/lib/protocol.d.ts +7 -0
- package/lib/ru/diagnosticMessages.generated.json +1 -0
- package/lib/tr/diagnosticMessages.generated.json +1 -0
- package/lib/tsc.js +127 -134
- package/lib/tsserver.js +455 -271
- package/lib/tsserverlibrary.d.ts +8 -0
- package/lib/tsserverlibrary.js +455 -271
- package/lib/typescript.d.ts +1 -0
- package/lib/typescript.js +455 -271
- package/lib/typescriptServices.d.ts +1 -0
- package/lib/typescriptServices.js +455 -271
- package/lib/typingsInstaller.js +140 -147
- package/package.json +1 -1
|
@@ -1481,6 +1481,7 @@
|
|
|
1481
1481
|
"This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354": "Diese Syntax erfordert ein importiertes Hilfsprogramm, aber das Modul \"{0}\" wurde nicht gefunden.",
|
|
1482
1482
|
"This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343": "Diese Syntax erfordert ein importiertes Hilfsprogramm namens \"{1}\", das in \"{0}\" nicht vorhanden ist. Erwägen Sie ein Upgrade Ihrer Version von \"{0}\".",
|
|
1483
1483
|
"This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807": "Diese Syntax erfordert ein importiertes Hilfsprogramm mit dem Namen \"{1}\" mit {2} Parametern, die nicht mit der in \"{0}\" kompatibel ist. Erwägen Sie ein Upgrade Ihrer Version von \"{0}\".",
|
|
1484
|
+
"This_type_parameter_probably_needs_an_extends_object_constraint_2208": "Dieser Typparameter benötigt wahrscheinlich eine „extends object“-Einschränkung.",
|
|
1484
1485
|
"Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378": "„Await“-Ausdrücke der obersten Ebene sind nur zulässig, wenn die Option \"module\" auf \"es2022\", \"esnext\", \"system\" oder \"nodenext\" festgelegt ist und die Option \"target\" auf \"es2017\" oder höher festgelegt ist.",
|
|
1485
1486
|
"Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": "Deklarationen der obersten Ebene in .d.ts-Dateien müssen entweder mit einem declare- oder einem export-Modifizierer beginnen.",
|
|
1486
1487
|
"Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or__1432": "„For Await“-Schleifen der obersten Ebene sind nur zulässig, wenn die „module“-Option auf \"es2022\", \"esnext\", \"system\" oder \"nodenext\" festgelegt ist und die Option \"target\" auf \"es2017\" oder höher festgelegt ist.",
|
|
@@ -1481,6 +1481,7 @@
|
|
|
1481
1481
|
"This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354": "この構文にはインポートされたヘルパーが必要ですが、モジュール '{0}' が見つかりません。",
|
|
1482
1482
|
"This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343": "この構文には、'{1}' という名前のインポートされたヘルパーが必要ですが、'{0}' には存在しません。'{0}' のバージョンのアップグレードを検討してください。",
|
|
1483
1483
|
"This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807": "この構文には、{2} パラメーターを持つ '{1}' という名前のインポートされたヘルパーが必要ですが、'{0}' にあるものと互換性がありません。'{0}' のバージョンをアップグレードすることをご検討ください。",
|
|
1484
|
+
"This_type_parameter_probably_needs_an_extends_object_constraint_2208": "この型パラメーターには、`extends object` 制約が必要な可能性があります。",
|
|
1484
1485
|
"Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378": "トップレベルの 'await' 式は、'module' オプションが 'es2022'、'esnext'、'system'、または 'nodenext' に設定されていて、'target' オプションが 'es2017' 以上に設定されている場合にのみ使用できます。",
|
|
1485
1486
|
"Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": ".d.ts ファイルのトップレベルの宣言は、'declare' または 'export' 修飾子で始める必要があります。",
|
|
1486
1487
|
"Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or__1432": "トップレベルの 'for await' ループは、'module' オプションが 'es2022'、'esnext'、'system'、または 'nodenext' に設定されていて、'target' オプションが 'es2017' 以上に設定されている場合にのみ使用できます。",
|
|
@@ -1481,6 +1481,7 @@
|
|
|
1481
1481
|
"This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354": "이 구문에는 가져온 도우미가 필요하지만 '{0}' 모듈을 찾을 수 없습니다.",
|
|
1482
1482
|
"This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343": "이 구문에는 '{0}'에 없는 '{1}'(이)라는 가져온 도우미가 필요합니다. '{0}'의 버전을 업그레이드하는 것이 좋습니다.",
|
|
1483
1483
|
"This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807": "이 구문에는 {2} 매개 변수가 포함된 '{1}'(이)라는 가져온 도우미가 필요하지만, 이 도우미는 '{0}'에 있는 도우미와 호환되지 않습니다. '{0}' 버전을 업그레이드하는 것이 좋습니다.",
|
|
1484
|
+
"This_type_parameter_probably_needs_an_extends_object_constraint_2208": "이 형식 매개 변수에는 `extends object` 제약 조건이 필요할 수 있습니다.",
|
|
1484
1485
|
"Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378": "최상위 'await' 식은 'module' 옵션이 'es2022', 'esnext', 'system' 또는 'nodenext'로 설정되고 'target' 옵션이 'es2017' 이상으로 설정된 경우에만 허용됩니다.",
|
|
1485
1486
|
"Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": ".d.ts 파일의 최상위 수준 선언은 'declare' 또는 'export' 한정자로 시작해야 합니다.",
|
|
1486
1487
|
"Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or__1432": "최상위 'for await' 루프는 'module' 옵션이 'es2022', 'esnext', 'system' 또는 'nodenext'로 설정되고 'target' 옵션이 'es2017' 이상으로 설정된 경우에만 허용됩니다.",
|
|
@@ -1481,6 +1481,7 @@
|
|
|
1481
1481
|
"This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354": "Ta składnia wymaga zaimportowanego pomocnika, ale nie można znaleźć modułu „{0}”.",
|
|
1482
1482
|
"This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343": "Ta składnia wymaga zaimportowanego pomocnika o nazwie „{1}”, który nie istnieje w elemencie „{0}”. Rozważ uaktualnienie wersji „{0}”.",
|
|
1483
1483
|
"This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807": "Ta składnia wymaga zaimportowanego pomocnika o nazwie „{1}” z parametrami {2}, który nie jest zgodny z tym w elemencie „{0}”. Rozważ uaktualnienie wersji elementu „{0}”.",
|
|
1484
|
+
"This_type_parameter_probably_needs_an_extends_object_constraint_2208": "Ten parametr typu prawdopodobnie wymaga ograniczenia „extends object”.",
|
|
1484
1485
|
"Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378": "Wyrażenia „await” najwyższego poziomu są dozwolone tylko wtedy, gdy opcja „module” jest ustawiona na wartość „es2022”, „esnext”, „system” lub „nodenext”, a opcja „target” jest ustawiona na wartość „es2017” lub wyższą.",
|
|
1485
1486
|
"Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": "Deklaracje najwyższego poziomu w plikach .d.ts muszą rozpoczynać się od modyfikatora „declare” lub „export”.",
|
|
1486
1487
|
"Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or__1432": "Pętle najwyższego poziomu „for await” są dozwolone tylko wtedy, gdy opcja „module” jest ustawiona na wartość „es2022”, „esnext”, „system” lub „nodenext”, a opcja „target” jest ustawiona na wartość „es2017” lub wyższą.",
|
package/lib/protocol.d.ts
CHANGED
|
@@ -2644,6 +2644,13 @@ declare namespace ts.server.protocol {
|
|
|
2644
2644
|
* `class A { foo }`.
|
|
2645
2645
|
*/
|
|
2646
2646
|
readonly includeCompletionsWithClassMemberSnippets?: boolean;
|
|
2647
|
+
/**
|
|
2648
|
+
* If enabled, object literal methods will have a method declaration completion entry in addition
|
|
2649
|
+
* to the regular completion entry containing just the method name.
|
|
2650
|
+
* E.g., `const objectLiteral: T = { f| }` could be completed to `const objectLiteral: T = { foo(): void {} }`,
|
|
2651
|
+
* in addition to `const objectLiteral: T = { foo }`.
|
|
2652
|
+
*/
|
|
2653
|
+
readonly includeCompletionsWithObjectLiteralMethodSnippets?: boolean;
|
|
2647
2654
|
readonly allowIncompleteCompletions?: boolean;
|
|
2648
2655
|
readonly importModuleSpecifierPreference?: "shortest" | "project-relative" | "relative" | "non-relative";
|
|
2649
2656
|
/** Determines whether we import `foo/index.ts` as "foo", "foo/index", or "foo/index.js" */
|
|
@@ -1481,6 +1481,7 @@
|
|
|
1481
1481
|
"This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354": "Для этого синтаксиса требуется импортированный вспомогательный объект, но найти модуль \"{0}\" не удается.",
|
|
1482
1482
|
"This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343": "Для этого синтаксиса требуется импортированный вспомогательный объект с именем \"{1}\", который не существует в \"{0}\". Рекомендуется обновить версию \"{0}\".",
|
|
1483
1483
|
"This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807": "Для этого синтаксиса требуется импортированный вспомогательный объект с именем \"{1}\" и параметрами ({2}), который не совместим с объектом в \"{0}\". Попробуйте обновить версию \"{0}\".",
|
|
1484
|
+
"This_type_parameter_probably_needs_an_extends_object_constraint_2208": "Возможно, для этого параметра типа требуется ограничение \"extends object\".",
|
|
1484
1485
|
"Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378": "Выражения \"await\" верхнего уровня допускаются, только если параметру \"module\" присвоено значение \"es2022\", \"esnext\", \"system\" или \"nodenext\", а параметру \"target\" присвоено значение \"es2017\" или выше.",
|
|
1485
1486
|
"Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": "Объявления верхнего уровня в файлах .d.ts должны начинаться с модификатора \"declare\" или \"export\".",
|
|
1486
1487
|
"Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or__1432": "Циклы \"for await\" верхнего уровня допускаются, только если параметру \"module\" присвоено значение \"es2022\", \"esnext\", \"system\" или \"nodenext\", а параметру \"target\" присвоено значение \"es2017\" или выше.",
|
|
@@ -1481,6 +1481,7 @@
|
|
|
1481
1481
|
"This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found_2354": "Bu söz dizimi, içeri aktarılan bir yardımcı gerektiriyor ancak '{0}' modülü bulunamıyor.",
|
|
1482
1482
|
"This_syntax_requires_an_imported_helper_named_1_which_does_not_exist_in_0_Consider_upgrading_your_ve_2343": "Bu söz dizimi, '{0}' içinde bulunmayan '{1}' adlı içeri aktarılmış bir yardımcı gerektirir. '{0}' sürümünüzü yükseltmeyi deneyin.",
|
|
1483
1483
|
"This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807": "Bu söz dizimi, '{0}' içindeki yardımcı ile uyumlu olmayan, {2} parametreye sahip '{1}' adlı içeri aktarılan yardımcıyı gerektiriyor. '{0}' sürümünüzü yükseltmeyi düşünün.",
|
|
1484
|
+
"This_type_parameter_probably_needs_an_extends_object_constraint_2208": "Bu tür parametresi için bir `nesneyi genişletir` kısıtlaması gerekiyor olabilir.",
|
|
1484
1485
|
"Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_o_1378": "Üst düzey 'await' ifadelerine yalnızca 'module' seçeneği 'es2022', 'esnext', 'system' veya 'nodenext' olarak ayarlandığında ve 'target' seçeneği 'es2017' veya üzeri olarak ayarlandığında izin verilir.",
|
|
1485
1486
|
"Top_level_declarations_in_d_ts_files_must_start_with_either_a_declare_or_export_modifier_1046": ".d.ts dosyalarındaki üst düzey bildirimler bir 'declare' veya 'export' değiştiricisi ile başlamalıdır.",
|
|
1486
1487
|
"Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or__1432": "Üst düzey 'for await' döngülerine yalnızca 'module' seçeneği 'es2022', 'esnext', 'system' veya 'nodenext' olarak ayarlandığında ve 'target' seçeneği 'es2017' veya üzeri olarak ayarlandığında izin verilir.",
|
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.7";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220330";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -10092,7 +10092,9 @@ var ts;
|
|
|
10092
10092
|
|| kind === 174
|
|
10093
10093
|
|| kind === 166
|
|
10094
10094
|
|| kind === 168
|
|
10095
|
-
|| kind === 176
|
|
10095
|
+
|| kind === 176
|
|
10096
|
+
|| kind === 172
|
|
10097
|
+
|| kind === 173;
|
|
10096
10098
|
}
|
|
10097
10099
|
ts.isTypeElement = isTypeElement;
|
|
10098
10100
|
function isClassOrTypeElement(node) {
|
|
@@ -39072,26 +39074,10 @@ var ts;
|
|
|
39072
39074
|
if (!node) {
|
|
39073
39075
|
return undefined;
|
|
39074
39076
|
}
|
|
39075
|
-
|
|
39076
|
-
|
|
39077
|
-
if (contextFlags & 4 && containingCall) {
|
|
39078
|
-
var toMarkSkip = node;
|
|
39079
|
-
do {
|
|
39080
|
-
getNodeLinks(toMarkSkip).skipDirectInference = true;
|
|
39081
|
-
toMarkSkip = toMarkSkip.parent;
|
|
39082
|
-
} while (toMarkSkip && toMarkSkip !== containingCall);
|
|
39083
|
-
getNodeLinks(containingCall).resolvedSignature = undefined;
|
|
39084
|
-
}
|
|
39085
|
-
var result = getContextualType(node, contextFlags);
|
|
39086
|
-
if (contextFlags & 4 && containingCall) {
|
|
39087
|
-
var toMarkSkip = node;
|
|
39088
|
-
do {
|
|
39089
|
-
getNodeLinks(toMarkSkip).skipDirectInference = undefined;
|
|
39090
|
-
toMarkSkip = toMarkSkip.parent;
|
|
39091
|
-
} while (toMarkSkip && toMarkSkip !== containingCall);
|
|
39092
|
-
getNodeLinks(containingCall).resolvedSignature = containingCallResolvedSignature;
|
|
39077
|
+
if (contextFlags & 4) {
|
|
39078
|
+
return runWithInferenceBlockedFromSourceNode(node, function () { return getContextualType(node, contextFlags); });
|
|
39093
39079
|
}
|
|
39094
|
-
return
|
|
39080
|
+
return getContextualType(node, contextFlags);
|
|
39095
39081
|
},
|
|
39096
39082
|
getContextualTypeForObjectLiteralElement: function (nodeIn) {
|
|
39097
39083
|
var node = ts.getParseTreeNode(nodeIn, ts.isObjectLiteralElementLike);
|
|
@@ -39111,6 +39097,9 @@ var ts;
|
|
|
39111
39097
|
getResolvedSignature: function (node, candidatesOutArray, argumentCount) {
|
|
39112
39098
|
return getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0);
|
|
39113
39099
|
},
|
|
39100
|
+
getResolvedSignatureForStringLiteralCompletions: function (call, editingArgument, candidatesOutArray) {
|
|
39101
|
+
return getResolvedSignatureWorker(call, candidatesOutArray, undefined, 32, editingArgument);
|
|
39102
|
+
},
|
|
39114
39103
|
getResolvedSignatureForSignatureHelp: function (node, candidatesOutArray, argumentCount) {
|
|
39115
39104
|
return getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16);
|
|
39116
39105
|
},
|
|
@@ -39257,10 +39246,34 @@ var ts;
|
|
|
39257
39246
|
getTypeOnlyAliasDeclaration: getTypeOnlyAliasDeclaration,
|
|
39258
39247
|
getMemberOverrideModifierStatus: getMemberOverrideModifierStatus,
|
|
39259
39248
|
};
|
|
39260
|
-
function
|
|
39249
|
+
function runWithInferenceBlockedFromSourceNode(node, fn) {
|
|
39250
|
+
var containingCall = ts.findAncestor(node, ts.isCallLikeExpression);
|
|
39251
|
+
var containingCallResolvedSignature = containingCall && getNodeLinks(containingCall).resolvedSignature;
|
|
39252
|
+
if (containingCall) {
|
|
39253
|
+
var toMarkSkip = node;
|
|
39254
|
+
do {
|
|
39255
|
+
getNodeLinks(toMarkSkip).skipDirectInference = true;
|
|
39256
|
+
toMarkSkip = toMarkSkip.parent;
|
|
39257
|
+
} while (toMarkSkip && toMarkSkip !== containingCall);
|
|
39258
|
+
getNodeLinks(containingCall).resolvedSignature = undefined;
|
|
39259
|
+
}
|
|
39260
|
+
var result = fn();
|
|
39261
|
+
if (containingCall) {
|
|
39262
|
+
var toMarkSkip = node;
|
|
39263
|
+
do {
|
|
39264
|
+
getNodeLinks(toMarkSkip).skipDirectInference = undefined;
|
|
39265
|
+
toMarkSkip = toMarkSkip.parent;
|
|
39266
|
+
} while (toMarkSkip && toMarkSkip !== containingCall);
|
|
39267
|
+
getNodeLinks(containingCall).resolvedSignature = containingCallResolvedSignature;
|
|
39268
|
+
}
|
|
39269
|
+
return result;
|
|
39270
|
+
}
|
|
39271
|
+
function getResolvedSignatureWorker(nodeIn, candidatesOutArray, argumentCount, checkMode, editingArgument) {
|
|
39261
39272
|
var node = ts.getParseTreeNode(nodeIn, ts.isCallLikeExpression);
|
|
39262
39273
|
apparentArgumentCount = argumentCount;
|
|
39263
|
-
var res = node ?
|
|
39274
|
+
var res = !node ? undefined :
|
|
39275
|
+
editingArgument ? runWithInferenceBlockedFromSourceNode(editingArgument, function () { return getResolvedSignature(node, candidatesOutArray, checkMode); }) :
|
|
39276
|
+
getResolvedSignature(node, candidatesOutArray, checkMode);
|
|
39264
39277
|
apparentArgumentCount = undefined;
|
|
39265
39278
|
return res;
|
|
39266
39279
|
}
|
|
@@ -40140,6 +40153,10 @@ var ts;
|
|
|
40140
40153
|
}
|
|
40141
40154
|
}
|
|
40142
40155
|
}
|
|
40156
|
+
function isConstAssertion(location) {
|
|
40157
|
+
return (ts.isAssertionExpression(location) && ts.isConstTypeReference(location.type))
|
|
40158
|
+
|| (ts.isJSDocTypeTag(location) && ts.isConstTypeReference(location.typeExpression));
|
|
40159
|
+
}
|
|
40143
40160
|
function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggstions) {
|
|
40144
40161
|
if (excludeGlobals === void 0) { excludeGlobals = false; }
|
|
40145
40162
|
if (getSpellingSuggstions === void 0) { getSpellingSuggstions = true; }
|
|
@@ -40158,6 +40175,9 @@ var ts;
|
|
|
40158
40175
|
var grandparent;
|
|
40159
40176
|
var isInExternalModule = false;
|
|
40160
40177
|
loop: while (location) {
|
|
40178
|
+
if (name === "const" && isConstAssertion(location)) {
|
|
40179
|
+
return undefined;
|
|
40180
|
+
}
|
|
40161
40181
|
if (location.locals && !isGlobalSourceFile(location)) {
|
|
40162
40182
|
if (result = lookup(location.locals, name, meaning)) {
|
|
40163
40183
|
var useResult = true;
|
|
@@ -45282,6 +45302,8 @@ var ts;
|
|
|
45282
45302
|
return !!target.resolvedTypeArguments;
|
|
45283
45303
|
case 7:
|
|
45284
45304
|
return !!target.baseTypesResolved;
|
|
45305
|
+
case 8:
|
|
45306
|
+
return !!getSymbolLinks(target).writeType;
|
|
45285
45307
|
}
|
|
45286
45308
|
return ts.Debug.assertNever(propertyName);
|
|
45287
45309
|
}
|
|
@@ -45433,7 +45455,7 @@ var ts;
|
|
|
45433
45455
|
return type.flags & (128 | 256) ? "" + type.value : undefined;
|
|
45434
45456
|
}
|
|
45435
45457
|
function getTypeForBindingElement(declaration) {
|
|
45436
|
-
var checkMode = declaration.dotDotDotToken ?
|
|
45458
|
+
var checkMode = declaration.dotDotDotToken ? 64 : 0;
|
|
45437
45459
|
var parentType = getTypeForBindingElementParent(declaration.parent.parent, checkMode);
|
|
45438
45460
|
return parentType && getBindingElementTypeFromParentType(declaration, parentType);
|
|
45439
45461
|
}
|
|
@@ -46069,6 +46091,9 @@ var ts;
|
|
|
46069
46091
|
}
|
|
46070
46092
|
return getWidenedType(getWidenedLiteralType(checkExpression(declaration.statements[0].expression)));
|
|
46071
46093
|
}
|
|
46094
|
+
if (ts.isAccessor(declaration)) {
|
|
46095
|
+
return getTypeOfAccessors(symbol);
|
|
46096
|
+
}
|
|
46072
46097
|
if (!pushTypeResolution(symbol, 0)) {
|
|
46073
46098
|
if (symbol.flags & 512 && !(symbol.flags & 67108864)) {
|
|
46074
46099
|
return getTypeOfFuncClassEnumModule(symbol);
|
|
@@ -46127,9 +46152,6 @@ var ts;
|
|
|
46127
46152
|
else if (ts.isEnumMember(declaration)) {
|
|
46128
46153
|
type = getTypeOfEnumMember(symbol);
|
|
46129
46154
|
}
|
|
46130
|
-
else if (ts.isAccessor(declaration)) {
|
|
46131
|
-
type = resolveTypeOfAccessors(symbol) || ts.Debug.fail("Non-write accessor resolution must always produce a type");
|
|
46132
|
-
}
|
|
46133
46155
|
else {
|
|
46134
46156
|
return ts.Debug.fail("Unhandled declaration kind! " + ts.Debug.formatSyntaxKind(declaration.kind) + " for " + ts.Debug.formatSymbol(symbol));
|
|
46135
46157
|
}
|
|
@@ -46167,81 +46189,58 @@ var ts;
|
|
|
46167
46189
|
}
|
|
46168
46190
|
function getTypeOfAccessors(symbol) {
|
|
46169
46191
|
var links = getSymbolLinks(symbol);
|
|
46170
|
-
|
|
46171
|
-
|
|
46172
|
-
|
|
46173
|
-
|
|
46174
|
-
return links.writeType || (links.writeType = getTypeOfAccessorsWorker(symbol, true));
|
|
46175
|
-
}
|
|
46176
|
-
function getTypeOfAccessorsWorker(symbol, writing) {
|
|
46177
|
-
if (writing === void 0) { writing = false; }
|
|
46178
|
-
if (!pushTypeResolution(symbol, 0)) {
|
|
46179
|
-
return errorType;
|
|
46180
|
-
}
|
|
46181
|
-
var type = resolveTypeOfAccessors(symbol, writing);
|
|
46182
|
-
if (!popTypeResolution()) {
|
|
46192
|
+
if (!links.type) {
|
|
46193
|
+
if (!pushTypeResolution(symbol, 0)) {
|
|
46194
|
+
return errorType;
|
|
46195
|
+
}
|
|
46183
46196
|
var getter = ts.getDeclarationOfKind(symbol, 172);
|
|
46184
|
-
|
|
46185
|
-
|
|
46186
|
-
|
|
46197
|
+
var setter = ts.getDeclarationOfKind(symbol, 173);
|
|
46198
|
+
var type = getter && ts.isInJSFile(getter) && getTypeForDeclarationFromJSDocComment(getter) ||
|
|
46199
|
+
getAnnotatedAccessorType(getter) ||
|
|
46200
|
+
getAnnotatedAccessorType(setter) ||
|
|
46201
|
+
getter && getter.body && getReturnTypeFromBody(getter);
|
|
46202
|
+
if (!type) {
|
|
46203
|
+
if (setter && !isPrivateWithinAmbient(setter)) {
|
|
46204
|
+
errorOrSuggestion(noImplicitAny, setter, ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation, symbolToString(symbol));
|
|
46187
46205
|
}
|
|
46188
|
-
else if (
|
|
46206
|
+
else if (getter && !isPrivateWithinAmbient(getter)) {
|
|
46207
|
+
errorOrSuggestion(noImplicitAny, getter, ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation, symbolToString(symbol));
|
|
46208
|
+
}
|
|
46209
|
+
type = anyType;
|
|
46210
|
+
}
|
|
46211
|
+
if (!popTypeResolution()) {
|
|
46212
|
+
if (getAnnotatedAccessorTypeNode(getter)) {
|
|
46213
|
+
error(getter, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol));
|
|
46214
|
+
}
|
|
46215
|
+
else if (getAnnotatedAccessorTypeNode(setter)) {
|
|
46216
|
+
error(setter, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol));
|
|
46217
|
+
}
|
|
46218
|
+
else if (getter && noImplicitAny) {
|
|
46189
46219
|
error(getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol));
|
|
46190
46220
|
}
|
|
46221
|
+
type = anyType;
|
|
46191
46222
|
}
|
|
46192
|
-
type =
|
|
46223
|
+
links.type = type;
|
|
46193
46224
|
}
|
|
46194
|
-
return type;
|
|
46225
|
+
return links.type;
|
|
46195
46226
|
}
|
|
46196
|
-
function
|
|
46197
|
-
|
|
46198
|
-
|
|
46199
|
-
|
|
46200
|
-
|
|
46201
|
-
var setterType_1 = getAnnotatedAccessorType(setter);
|
|
46202
|
-
if (setterType_1) {
|
|
46203
|
-
return instantiateTypeIfNeeded(setterType_1, symbol);
|
|
46204
|
-
}
|
|
46205
|
-
}
|
|
46206
|
-
if (getter && ts.isInJSFile(getter)) {
|
|
46207
|
-
var jsDocType = getTypeForDeclarationFromJSDocComment(getter);
|
|
46208
|
-
if (jsDocType) {
|
|
46209
|
-
return instantiateTypeIfNeeded(jsDocType, symbol);
|
|
46210
|
-
}
|
|
46211
|
-
}
|
|
46212
|
-
var getterType = getAnnotatedAccessorType(getter);
|
|
46213
|
-
if (getterType) {
|
|
46214
|
-
return instantiateTypeIfNeeded(getterType, symbol);
|
|
46215
|
-
}
|
|
46216
|
-
var setterType = getAnnotatedAccessorType(setter);
|
|
46217
|
-
if (setterType) {
|
|
46218
|
-
return setterType;
|
|
46219
|
-
}
|
|
46220
|
-
if (getter && getter.body) {
|
|
46221
|
-
var returnTypeFromBody = getReturnTypeFromBody(getter);
|
|
46222
|
-
return instantiateTypeIfNeeded(returnTypeFromBody, symbol);
|
|
46223
|
-
}
|
|
46224
|
-
if (setter) {
|
|
46225
|
-
if (!isPrivateWithinAmbient(setter)) {
|
|
46226
|
-
errorOrSuggestion(noImplicitAny, setter, ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation, symbolToString(symbol));
|
|
46227
|
-
}
|
|
46228
|
-
return anyType;
|
|
46229
|
-
}
|
|
46230
|
-
else if (getter) {
|
|
46231
|
-
ts.Debug.assert(!!getter, "there must exist a getter as we are current checking either setter or getter in this function");
|
|
46232
|
-
if (!isPrivateWithinAmbient(getter)) {
|
|
46233
|
-
errorOrSuggestion(noImplicitAny, getter, ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation, symbolToString(symbol));
|
|
46227
|
+
function getWriteTypeOfAccessors(symbol) {
|
|
46228
|
+
var links = getSymbolLinks(symbol);
|
|
46229
|
+
if (!links.writeType) {
|
|
46230
|
+
if (!pushTypeResolution(symbol, 8)) {
|
|
46231
|
+
return errorType;
|
|
46234
46232
|
}
|
|
46235
|
-
|
|
46236
|
-
|
|
46237
|
-
|
|
46238
|
-
|
|
46239
|
-
|
|
46240
|
-
|
|
46241
|
-
|
|
46233
|
+
var setter = ts.getDeclarationOfKind(symbol, 173);
|
|
46234
|
+
var writeType = getAnnotatedAccessorType(setter);
|
|
46235
|
+
if (!popTypeResolution()) {
|
|
46236
|
+
if (getAnnotatedAccessorTypeNode(setter)) {
|
|
46237
|
+
error(setter, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol));
|
|
46238
|
+
}
|
|
46239
|
+
writeType = anyType;
|
|
46242
46240
|
}
|
|
46243
|
-
|
|
46241
|
+
links.writeType = writeType || getTypeOfAccessors(symbol);
|
|
46244
46242
|
}
|
|
46243
|
+
return links.writeType;
|
|
46245
46244
|
}
|
|
46246
46245
|
function getBaseTypeVariableOfClass(symbol) {
|
|
46247
46246
|
var baseConstructorType = getBaseConstructorTypeOfClass(getDeclaredTypeOfClassOrInterface(symbol));
|
|
@@ -46317,17 +46316,11 @@ var ts;
|
|
|
46317
46316
|
}
|
|
46318
46317
|
function getTypeOfInstantiatedSymbol(symbol) {
|
|
46319
46318
|
var links = getSymbolLinks(symbol);
|
|
46320
|
-
|
|
46321
|
-
|
|
46322
|
-
|
|
46323
|
-
|
|
46324
|
-
|
|
46325
|
-
if (!popTypeResolution()) {
|
|
46326
|
-
type = reportCircularityError(symbol);
|
|
46327
|
-
}
|
|
46328
|
-
links.type = type;
|
|
46329
|
-
}
|
|
46330
|
-
return links.type;
|
|
46319
|
+
return links.type || (links.type = instantiateType(getTypeOfSymbol(links.target), links.mapper));
|
|
46320
|
+
}
|
|
46321
|
+
function getWriteTypeOfInstantiatedSymbol(symbol) {
|
|
46322
|
+
var links = getSymbolLinks(symbol);
|
|
46323
|
+
return links.writeType || (links.writeType = instantiateType(getWriteTypeOfSymbol(links.target), links.mapper));
|
|
46331
46324
|
}
|
|
46332
46325
|
function reportCircularityError(symbol) {
|
|
46333
46326
|
var declaration = symbol.valueDeclaration;
|
|
@@ -46360,26 +46353,17 @@ var ts;
|
|
|
46360
46353
|
}
|
|
46361
46354
|
function getWriteTypeOfSymbol(symbol) {
|
|
46362
46355
|
var checkFlags = ts.getCheckFlags(symbol);
|
|
46363
|
-
if (
|
|
46364
|
-
|
|
46365
|
-
|
|
46366
|
-
|
|
46367
|
-
|
|
46356
|
+
if (symbol.flags & 4) {
|
|
46357
|
+
return checkFlags & 2 ?
|
|
46358
|
+
checkFlags & 65536 ?
|
|
46359
|
+
getWriteTypeOfSymbolWithDeferredType(symbol) || getTypeOfSymbolWithDeferredType(symbol) :
|
|
46360
|
+
symbol.writeType || symbol.type :
|
|
46361
|
+
getTypeOfSymbol(symbol);
|
|
46368
46362
|
}
|
|
46369
|
-
if (symbol.flags & 33554432) {
|
|
46370
|
-
var writeType = symbol.writeType;
|
|
46371
|
-
if (writeType) {
|
|
46372
|
-
return writeType;
|
|
46373
|
-
}
|
|
46374
|
-
}
|
|
46375
|
-
return getSetAccessorTypeOfSymbol(symbol);
|
|
46376
|
-
}
|
|
46377
|
-
function getSetAccessorTypeOfSymbol(symbol) {
|
|
46378
46363
|
if (symbol.flags & 98304) {
|
|
46379
|
-
|
|
46380
|
-
|
|
46381
|
-
|
|
46382
|
-
}
|
|
46364
|
+
return checkFlags & 1 ?
|
|
46365
|
+
getWriteTypeOfInstantiatedSymbol(symbol) :
|
|
46366
|
+
getWriteTypeOfAccessors(symbol);
|
|
46383
46367
|
}
|
|
46384
46368
|
return getTypeOfSymbol(symbol);
|
|
46385
46369
|
}
|
|
@@ -56912,7 +56896,7 @@ var ts;
|
|
|
56912
56896
|
for (var _i = 0, properties_3 = properties; _i < properties_3.length; _i++) {
|
|
56913
56897
|
var targetProp = properties_3[_i];
|
|
56914
56898
|
var sourceProp = getPropertyOfType(source, targetProp.escapedName);
|
|
56915
|
-
if (sourceProp) {
|
|
56899
|
+
if (sourceProp && !ts.some(sourceProp.declarations, hasSkipDirectInferenceFlag)) {
|
|
56916
56900
|
inferFromTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp));
|
|
56917
56901
|
}
|
|
56918
56902
|
}
|
|
@@ -59024,7 +59008,7 @@ var ts;
|
|
|
59024
59008
|
}
|
|
59025
59009
|
}
|
|
59026
59010
|
if (ts.isDeclarationName(location) && ts.isSetAccessor(location.parent) && getAnnotatedAccessorTypeNode(location.parent)) {
|
|
59027
|
-
return
|
|
59011
|
+
return getWriteTypeOfAccessors(location.parent.symbol);
|
|
59028
59012
|
}
|
|
59029
59013
|
return getNonMissingTypeOfSymbol(symbol);
|
|
59030
59014
|
}
|
|
@@ -59102,7 +59086,7 @@ var ts;
|
|
|
59102
59086
|
function hasContextualTypeWithNoGenericTypes(node, checkMode) {
|
|
59103
59087
|
var contextualType = (ts.isIdentifier(node) || ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node)) &&
|
|
59104
59088
|
!((ts.isJsxOpeningElement(node.parent) || ts.isJsxSelfClosingElement(node.parent)) && node.parent.tagName === node) &&
|
|
59105
|
-
(checkMode && checkMode &
|
|
59089
|
+
(checkMode && checkMode & 64 ?
|
|
59106
59090
|
getContextualType(node, 8)
|
|
59107
59091
|
: getContextualType(node));
|
|
59108
59092
|
return contextualType && !isGenericType(contextualType);
|
|
@@ -59826,7 +59810,7 @@ var ts;
|
|
|
59826
59810
|
var parent = declaration.parent.parent;
|
|
59827
59811
|
var name = declaration.propertyName || declaration.name;
|
|
59828
59812
|
var parentType = getContextualTypeForVariableLikeDeclaration(parent) ||
|
|
59829
|
-
parent.kind !== 203 && parent.initializer && checkDeclarationInitializer(parent, declaration.dotDotDotToken ?
|
|
59813
|
+
parent.kind !== 203 && parent.initializer && checkDeclarationInitializer(parent, declaration.dotDotDotToken ? 64 : 0);
|
|
59830
59814
|
if (!parentType || ts.isBindingPattern(name) || ts.isComputedNonLiteralName(name))
|
|
59831
59815
|
return undefined;
|
|
59832
59816
|
if (parent.name.kind === 202) {
|
|
@@ -62424,7 +62408,7 @@ var ts;
|
|
|
62424
62408
|
}
|
|
62425
62409
|
for (var i = 0; i < argCount; i++) {
|
|
62426
62410
|
var arg = args[i];
|
|
62427
|
-
if (arg.kind !== 227) {
|
|
62411
|
+
if (arg.kind !== 227 && !(checkMode & 32 && hasSkipDirectInferenceFlag(arg))) {
|
|
62428
62412
|
var paramType = getTypeAtPosition(signature, i);
|
|
62429
62413
|
var argType = checkExpressionWithContextualType(arg, paramType, context, checkMode);
|
|
62430
62414
|
inferTypes(context.inferences, argType, paramType);
|
|
@@ -63005,7 +62989,7 @@ var ts;
|
|
|
63005
62989
|
}
|
|
63006
62990
|
}
|
|
63007
62991
|
}
|
|
63008
|
-
return getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray);
|
|
62992
|
+
return getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray, checkMode);
|
|
63009
62993
|
function addImplementationSuccessElaboration(failed, diagnostic) {
|
|
63010
62994
|
var _a, _b;
|
|
63011
62995
|
var oldCandidatesForArgumentError = candidatesForArgumentError;
|
|
@@ -63096,11 +63080,11 @@ var ts;
|
|
|
63096
63080
|
return undefined;
|
|
63097
63081
|
}
|
|
63098
63082
|
}
|
|
63099
|
-
function getCandidateForOverloadFailure(node, candidates, args, hasCandidatesOutArray) {
|
|
63083
|
+
function getCandidateForOverloadFailure(node, candidates, args, hasCandidatesOutArray, checkMode) {
|
|
63100
63084
|
ts.Debug.assert(candidates.length > 0);
|
|
63101
63085
|
checkNodeDeferred(node);
|
|
63102
63086
|
return hasCandidatesOutArray || candidates.length === 1 || candidates.some(function (c) { return !!c.typeParameters; })
|
|
63103
|
-
? pickLongestCandidateSignature(node, candidates, args)
|
|
63087
|
+
? pickLongestCandidateSignature(node, candidates, args, checkMode)
|
|
63104
63088
|
: createUnionOfSignaturesForOverloadFailure(candidates);
|
|
63105
63089
|
}
|
|
63106
63090
|
function createUnionOfSignaturesForOverloadFailure(candidates) {
|
|
@@ -63143,7 +63127,7 @@ var ts;
|
|
|
63143
63127
|
function createCombinedSymbolForOverloadFailure(sources, type) {
|
|
63144
63128
|
return createSymbolWithType(ts.first(sources), type);
|
|
63145
63129
|
}
|
|
63146
|
-
function pickLongestCandidateSignature(node, candidates, args) {
|
|
63130
|
+
function pickLongestCandidateSignature(node, candidates, args, checkMode) {
|
|
63147
63131
|
var bestIndex = getLongestCandidateIndex(candidates, apparentArgumentCount === undefined ? args.length : apparentArgumentCount);
|
|
63148
63132
|
var candidate = candidates[bestIndex];
|
|
63149
63133
|
var typeParameters = candidate.typeParameters;
|
|
@@ -63153,7 +63137,7 @@ var ts;
|
|
|
63153
63137
|
var typeArgumentNodes = callLikeExpressionMayHaveTypeArguments(node) ? node.typeArguments : undefined;
|
|
63154
63138
|
var instantiated = typeArgumentNodes
|
|
63155
63139
|
? createSignatureInstantiation(candidate, getTypeArgumentsFromNodes(typeArgumentNodes, typeParameters, ts.isInJSFile(node)))
|
|
63156
|
-
: inferSignatureInstantiationForOverloadFailure(node, typeParameters, candidate, args);
|
|
63140
|
+
: inferSignatureInstantiationForOverloadFailure(node, typeParameters, candidate, args, checkMode);
|
|
63157
63141
|
candidates[bestIndex] = instantiated;
|
|
63158
63142
|
return instantiated;
|
|
63159
63143
|
}
|
|
@@ -63167,9 +63151,9 @@ var ts;
|
|
|
63167
63151
|
}
|
|
63168
63152
|
return typeArguments;
|
|
63169
63153
|
}
|
|
63170
|
-
function inferSignatureInstantiationForOverloadFailure(node, typeParameters, candidate, args) {
|
|
63154
|
+
function inferSignatureInstantiationForOverloadFailure(node, typeParameters, candidate, args, checkMode) {
|
|
63171
63155
|
var inferenceContext = createInferenceContext(typeParameters, candidate, ts.isInJSFile(node) ? 2 : 0);
|
|
63172
|
-
var typeArgumentTypes = inferTypeArguments(node, candidate, args, 4 | 8, inferenceContext);
|
|
63156
|
+
var typeArgumentTypes = inferTypeArguments(node, candidate, args, checkMode | 4 | 8, inferenceContext);
|
|
63173
63157
|
return createSignatureInstantiation(candidate, typeArgumentTypes);
|
|
63174
63158
|
}
|
|
63175
63159
|
function getLongestCandidateIndex(candidates, argsCount) {
|
|
@@ -68426,7 +68410,7 @@ var ts;
|
|
|
68426
68410
|
checkComputedPropertyName(node.propertyName);
|
|
68427
68411
|
}
|
|
68428
68412
|
var parent = node.parent.parent;
|
|
68429
|
-
var parentCheckMode = node.dotDotDotToken ?
|
|
68413
|
+
var parentCheckMode = node.dotDotDotToken ? 64 : 0;
|
|
68430
68414
|
var parentType = getTypeForBindingElementParent(parent, parentCheckMode);
|
|
68431
68415
|
var name = node.propertyName || node.name;
|
|
68432
68416
|
if (parentType && !ts.isBindingPattern(name)) {
|
|
@@ -68590,6 +68574,8 @@ var ts;
|
|
|
68590
68574
|
(condExpr.operatorToken.kind === 56 || condExpr.operatorToken.kind === 55)
|
|
68591
68575
|
? condExpr.right
|
|
68592
68576
|
: condExpr;
|
|
68577
|
+
if (ts.isModuleExportsAccessExpression(location))
|
|
68578
|
+
return;
|
|
68593
68579
|
var type = checkTruthinessExpression(location);
|
|
68594
68580
|
var isPropertyExpressionCast = ts.isPropertyAccessExpression(location) && isTypeAssertion(location.expression);
|
|
68595
68581
|
if (getFalsyFlags(type) || isPropertyExpressionCast)
|
|
@@ -96368,6 +96354,13 @@ var ts;
|
|
|
96368
96354
|
return "skip";
|
|
96369
96355
|
}
|
|
96370
96356
|
break;
|
|
96357
|
+
case 270:
|
|
96358
|
+
case 275:
|
|
96359
|
+
if (node.isTypeOnly) {
|
|
96360
|
+
diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, ts.isImportSpecifier(node) ? "import...type" : "export...type"));
|
|
96361
|
+
return "skip";
|
|
96362
|
+
}
|
|
96363
|
+
break;
|
|
96371
96364
|
case 265:
|
|
96372
96365
|
diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_TypeScript_files));
|
|
96373
96366
|
return "skip";
|