Merge branch 'main' into only-suggest-param-codefixes-in-ts

This commit is contained in:
Nathan Shively-Sanders
2022-02-18 14:45:28 -08:00
52 changed files with 554 additions and 208 deletions
+1 -1
View File
@@ -25081,7 +25081,7 @@ namespace ts {
const substituteConstraints = !(checkMode && checkMode & CheckMode.Inferential) &&
someType(type, isGenericTypeWithUnionConstraint) &&
(isConstraintPosition(type, reference) || hasContextualTypeWithNoGenericTypes(reference, checkMode));
return substituteConstraints ? mapType(type, t => t.flags & TypeFlags.Instantiable && !isMappedTypeGenericIndexedAccess(t) ? getBaseConstraintOrType(t) : t) : type;
return substituteConstraints ? mapType(type, t => t.flags & TypeFlags.Instantiable ? getBaseConstraintOrType(t) : t) : type;
}
function isExportOrExportExpression(location: Node) {
+1 -1
View File
@@ -2498,7 +2498,7 @@ namespace ts {
const result: string[] = [];
result.push(`{`);
result.push(`${tab}"compilerOptions": {`);
result.push(`${tab}${tab}/* ${getLocaleSpecificMessage(Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_json_to_read_more_about_this_file)} */`);
result.push(`${tab}${tab}/* ${getLocaleSpecificMessage(Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file)} */`);
result.push("");
// Print out each row, aligning all the descriptions on the same column.
for (const entry of entries) {
+1 -2
View File
@@ -5852,7 +5852,6 @@
"code": 6930
},
"Variable '{0}' implicitly has an '{1}' type.": {
"category": "Error",
"code": 7005
@@ -6911,7 +6910,7 @@
"category": "Message",
"code": 95109
},
"Visit https://aka.ms/tsconfig.json to read more about this file": {
"Visit https://aka.ms/tsconfig to read more about this file": {
"category": "Message",
"code": 95110
},
+3 -3
View File
@@ -396,7 +396,7 @@ namespace ts {
output = [
...output,
...generateSectionOptionsOutput(sys, getDiagnosticText(Diagnostics.COMMAND_LINE_FLAGS), cliCommands, /*subCategory*/ false, /* beforeOptionsDescription */ undefined, /* afterOptionsDescription*/ undefined),
...generateSectionOptionsOutput(sys, getDiagnosticText(Diagnostics.COMMON_COMPILER_OPTIONS), configOpts, /*subCategory*/ false, /* beforeOptionsDescription */ undefined, formatMessage(/*_dummy*/ undefined, Diagnostics.You_can_learn_about_all_of_the_compiler_options_at_0, "https://aka.ms/tsconfig-reference"))
...generateSectionOptionsOutput(sys, getDiagnosticText(Diagnostics.COMMON_COMPILER_OPTIONS), configOpts, /*subCategory*/ false, /* beforeOptionsDescription */ undefined, formatMessage(/*_dummy*/ undefined, Diagnostics.You_can_learn_about_all_of_the_compiler_options_at_0, "https://aka.ms/tsc"))
];
for (const line of output) {
@@ -414,7 +414,7 @@ namespace ts {
function printAllHelp(sys: System, compilerOptions: readonly CommandLineOption[], buildOptions: readonly CommandLineOption[], watchOptions: readonly CommandLineOption[]) {
let output: string[] = [...getHeader(sys,`${getDiagnosticText(Diagnostics.tsc_Colon_The_TypeScript_Compiler)} - ${getDiagnosticText(Diagnostics.Version_0, version)}`)];
output = [...output, ...generateSectionOptionsOutput(sys, getDiagnosticText(Diagnostics.ALL_COMPILER_OPTIONS), compilerOptions, /*subCategory*/ true, /* beforeOptionsDescription */ undefined, formatMessage(/*_dummy*/ undefined, Diagnostics.You_can_learn_about_all_of_the_compiler_options_at_0, "https://aka.ms/tsconfig-reference"))];
output = [...output, ...generateSectionOptionsOutput(sys, getDiagnosticText(Diagnostics.ALL_COMPILER_OPTIONS), compilerOptions, /*subCategory*/ true, /* beforeOptionsDescription */ undefined, formatMessage(/*_dummy*/ undefined, Diagnostics.You_can_learn_about_all_of_the_compiler_options_at_0, "https://aka.ms/tsc"))];
output = [...output, ...generateSectionOptionsOutput(sys, getDiagnosticText(Diagnostics.WATCH_OPTIONS), watchOptions, /*subCategory*/ false, getDiagnosticText(Diagnostics.Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon))];
output = [...output, ...generateSectionOptionsOutput(sys, getDiagnosticText(Diagnostics.BUILD_OPTIONS), buildOptions, /*subCategory*/ false, formatMessage(/*_dummy*/ undefined, Diagnostics.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0, "https://aka.ms/tsc-composite-builds"))];
for (const line of output) {
@@ -1061,7 +1061,7 @@ namespace ts {
sys.writeFile(file, generateTSConfig(options, fileNames, sys.newLine));
const output: string[] = [sys.newLine, ...getHeader(sys,"Created a new tsconfig.json with:")];
output.push(getCompilerOptionsDiffValue(options, sys.newLine) + sys.newLine + sys.newLine);
output.push(`You can learn more at https://aka.ms/tsconfig.json` + sys.newLine);
output.push(`You can learn more at https://aka.ms/tsconfig` + sys.newLine);
for (const line of output) {
sys.write(line);
}
+3 -3
View File
@@ -263,7 +263,7 @@ interface ObjectConstructor {
* @param target The target object to copy to.
* @param source The source object from which to copy properties.
*/
assign<T, U>(target: T, source: U): T & U;
assign<T extends {}, U>(target: T, source: U): T & U;
/**
* Copy the values of all of the enumerable own properties from one or more source objects to a
@@ -272,7 +272,7 @@ interface ObjectConstructor {
* @param source1 The first source object from which to copy properties.
* @param source2 The second source object from which to copy properties.
*/
assign<T, U, V>(target: T, source1: U, source2: V): T & U & V;
assign<T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;
/**
* Copy the values of all of the enumerable own properties from one or more source objects to a
@@ -282,7 +282,7 @@ interface ObjectConstructor {
* @param source2 The second source object from which to copy properties.
* @param source3 The third source object from which to copy properties.
*/
assign<T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
assign<T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
/**
* Copy the values of all of the enumerable own properties from one or more source objects to a
@@ -546,15 +546,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list_1384" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A 'new' expression with type arguments must always be followed by a parenthesized argument list.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[具有类型参数的 "new" 表达式的后面必须始终是带括号的参数列表。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_non_dry_build_would_build_project_0_6357" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A non-dry build would build project '{0}']]></Val>
@@ -13806,6 +13797,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' has no signatures for which the type argument list is applicable.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[类型“{0}”没有类型参数列表适用的签名。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is missing the following properties from type '{1}': {2}]]></Val>
@@ -555,15 +555,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list_1384" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A 'new' expression with type arguments must always be followed by a parenthesized argument list.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Za výrazem new s argumenty typů musí vždy následovat seznam argumentů v závorkách.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_non_dry_build_would_build_project_0_6357" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A non-dry build would build project '{0}']]></Val>
@@ -4569,6 +4560,24 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Decorator_function_return_type_0_is_not_assignable_to_type_1_1270" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Decorator function return type '{0}' is not assignable to type '{1}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Návratový typ funkce dekoratéru {0} se nedá přiřadit k typu {1}.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Decorator function return type is '{0}' but is expected to be 'void' or 'any'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Návratový typ funkce dekoratéru je {0}, ale očekává se, že bude void nebo any.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Decorators_are_not_valid_here_1206" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Decorators are not valid here.]]></Val>
@@ -11034,6 +11043,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Resolution_modes_are_only_supported_when_moduleResolution_is_node12_or_nodenext_1452" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Resolution modes are only supported when `moduleResolution` is `node12` or `nodenext`.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Režimy řešení se podporují pouze v případě, že moduleResolution je node12 nebo nodenext.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols_6195" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Resolve 'keyof' to string valued property names only (no numbers or symbols).]]></Val>
@@ -13788,6 +13806,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' has no signatures for which the type argument list is applicable.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[U typu {0} nejsou žádné podpisy, pro které platí seznam argumentů obecného typu.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is missing the following properties from type '{1}': {2}]]></Val>
@@ -16335,6 +16362,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";resolution_mode_should_be_either_require_or_import_1453" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[`resolution-mode` should be either `require` or `import`.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[resolution-mode by měl být buď require, nebo import.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA['rootDirs' option is set, using it to resolve relative module name '{0}'.]]></Val>
@@ -555,15 +555,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list_1384" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A 'new' expression with type arguments must always be followed by a parenthesized argument list.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Una expresión "new" con argumentos de tipo siempre debe ir seguida de una lista de argumentos entre paréntesis.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_non_dry_build_would_build_project_0_6357" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A non-dry build would build project '{0}']]></Val>
@@ -4572,6 +4563,24 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Decorator_function_return_type_0_is_not_assignable_to_type_1_1270" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Decorator function return type '{0}' is not assignable to type '{1}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[El tipo de valor devuelto de la función Decorator "{0}" no se puede asignar al tipo "{1}".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Decorator function return type is '{0}' but is expected to be 'void' or 'any'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[El tipo de valor devuelto de la función Decorator es "{0}" pero se espera que sea "void" o "any".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Decorators_are_not_valid_here_1206" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Decorators are not valid here.]]></Val>
@@ -11037,6 +11046,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Resolution_modes_are_only_supported_when_moduleResolution_is_node12_or_nodenext_1452" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Resolution modes are only supported when `moduleResolution` is `node12` or `nodenext`.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Los modos de resolución solo se admiten cuando "moduleResolution" es "node12" o "nodenext".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols_6195" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Resolve 'keyof' to string valued property names only (no numbers or symbols).]]></Val>
@@ -13791,6 +13809,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' has no signatures for which the type argument list is applicable.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[El tipo "{0}" no tiene firmas para las que sea aplicable la lista de argumentos de tipo.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is missing the following properties from type '{1}': {2}]]></Val>
@@ -16338,6 +16365,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";resolution_mode_should_be_either_require_or_import_1453" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[`resolution-mode` should be either `require` or `import`.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA["modo de resolución" debe ser "requerir" o "importar".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA['rootDirs' option is set, using it to resolve relative module name '{0}'.]]></Val>
@@ -555,15 +555,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list_1384" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A 'new' expression with type arguments must always be followed by a parenthesized argument list.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Une expression 'new' avec des arguments de type doit toujours être suivie d'une liste d'arguments entre parenthèses.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_non_dry_build_would_build_project_0_6357" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A non-dry build would build project '{0}']]></Val>
@@ -13818,6 +13809,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' has no signatures for which the type argument list is applicable.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Le type '{0}' na aucune signature pour laquelle la liste darguments de type est applicable.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is missing the following properties from type '{1}': {2}]]></Val>
@@ -546,15 +546,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list_1384" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A 'new' expression with type arguments must always be followed by a parenthesized argument list.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Un'espressione 'new' con argomenti di tipo deve essere sempre seguita da un elenco di argomenti tra parentesi.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_non_dry_build_would_build_project_0_6357" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A non-dry build would build project '{0}']]></Val>
@@ -13806,6 +13797,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' has no signatures for which the type argument list is applicable.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Il tipo '{0}' non ha firme per cui è applicabile l'elenco degli argomenti tipo.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is missing the following properties from type '{1}': {2}]]></Val>
@@ -546,15 +546,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list_1384" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A 'new' expression with type arguments must always be followed by a parenthesized argument list.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[型引数を伴う 'new' 式の後には常に、かっこで囲んだ引数リストを指定しなければなりません。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_non_dry_build_would_build_project_0_6357" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A non-dry build would build project '{0}']]></Val>
@@ -4560,6 +4551,24 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Decorator_function_return_type_0_is_not_assignable_to_type_1_1270" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Decorator function return type '{0}' is not assignable to type '{1}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[デコレーター関数の戻り値の型 '{0}' は、型 '{1}' に割り当てられません。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Decorator function return type is '{0}' but is expected to be 'void' or 'any'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[デコレーター関数の戻り値の型は '{0}' ですが、"void" または "any" である必要があります。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Decorators_are_not_valid_here_1206" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Decorators are not valid here.]]></Val>
@@ -11025,6 +11034,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Resolution_modes_are_only_supported_when_moduleResolution_is_node12_or_nodenext_1452" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Resolution modes are only supported when `moduleResolution` is `node12` or `nodenext`.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[解決モードは、"moduleResolution" が "node12" または "nodenext" の場合にのみサポートされます。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols_6195" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Resolve 'keyof' to string valued property names only (no numbers or symbols).]]></Val>
@@ -13779,6 +13797,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' has no signatures for which the type argument list is applicable.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[型 '{0}' には、型引数リストを適用できるシグネチャがありません。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is missing the following properties from type '{1}': {2}]]></Val>
@@ -16326,6 +16353,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";resolution_mode_should_be_either_require_or_import_1453" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[`resolution-mode` should be either `require` or `import`.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA["resolution-mode" は "require" または "import" のいずれかにする必要があります。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA['rootDirs' option is set, using it to resolve relative module name '{0}'.]]></Val>
@@ -546,15 +546,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list_1384" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A 'new' expression with type arguments must always be followed by a parenthesized argument list.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[형식 인수가 포함된 'new' 식은 뒤에 항상 괄호로 묶인 인수 목록이 있어야 합니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_non_dry_build_would_build_project_0_6357" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A non-dry build would build project '{0}']]></Val>
@@ -13806,6 +13797,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' has no signatures for which the type argument list is applicable.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[유형 '{0}'에는 유형 인수 목록을 적용할 수 있는 서명이 없습니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is missing the following properties from type '{1}': {2}]]></Val>
@@ -539,15 +539,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list_1384" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A 'new' expression with type arguments must always be followed by a parenthesized argument list.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Po wyrażeniu „new” z argumentami typu musi zawsze występować lista argumentów ujęta w nawiasy.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_non_dry_build_would_build_project_0_6357" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A non-dry build would build project '{0}']]></Val>
@@ -13793,6 +13784,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' has no signatures for which the type argument list is applicable.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Typ „{0}” nie ma podpisów, dla których ma zastosowanie lista argumentów typu ogólnego.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is missing the following properties from type '{1}': {2}]]></Val>
@@ -539,15 +539,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list_1384" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A 'new' expression with type arguments must always be followed by a parenthesized argument list.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Uma expressão 'new' com argumentos de tipo precisa ser sempre seguida por uma lista de argumentos entre parênteses.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_non_dry_build_would_build_project_0_6357" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A non-dry build would build project '{0}']]></Val>
@@ -13796,6 +13787,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' has no signatures for which the type argument list is applicable.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[O tipo “{0}” não tem assinaturas para as quais a lista de argumentos de tipo é aplicável.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is missing the following properties from type '{1}': {2}]]></Val>
@@ -545,15 +545,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list_1384" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A 'new' expression with type arguments must always be followed by a parenthesized argument list.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[После выражения "new" с аргументами типа должен всегда следовать список аргументов в круглых скобках.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_non_dry_build_would_build_project_0_6357" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A non-dry build would build project '{0}']]></Val>
@@ -13805,6 +13796,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' has no signatures for which the type argument list is applicable.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Тип "{0}" не содержит подписей, к которым применим список аргументов типа.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is missing the following properties from type '{1}': {2}]]></Val>
+11 -2
View File
@@ -152,14 +152,23 @@ namespace ts.JsDoc {
function getDisplayPartsFromComment(comment: string | readonly JSDocComment[], checker: TypeChecker | undefined): SymbolDisplayPart[] {
if (typeof comment === "string") {
return [textPart(comment)];
return [textPart(skipSeparatorFromComment(comment))];
}
return flatMap(
comment,
node => node.kind === SyntaxKind.JSDocText ? [textPart(node.text)] : buildLinkParts(node, checker)
node => node.kind === SyntaxKind.JSDocText ? [textPart(skipSeparatorFromComment(node.text))] : buildLinkParts(node, checker)
) as SymbolDisplayPart[];
}
function skipSeparatorFromComment(text: string) {
let pos = 0;
if (text.charCodeAt(pos++) === CharacterCodes.minus) {
while (pos < text.length && text.charCodeAt(pos) === CharacterCodes.space) pos++;
return text.slice(pos);
}
return text;
}
function getCommentDisplayParts(tag: JSDocTag, checker?: TypeChecker): SymbolDisplayPart[] | undefined {
const { comment, kind } = tag;
const namePart = getTagNameDisplayPart(kind);
+10 -10
View File
@@ -386,11 +386,11 @@ x(1)`
displayPartsForJSDoc: false,
tags: [{
name: "param",
text: "y - {@link C}"
text: "y {@link C}"
}],
documentation: [{
kind: "text",
text: "- "
text: ""
}, {
kind: "link",
text: "{@link "
@@ -425,7 +425,7 @@ x(1)`
text: " "
}, {
kind: "text",
text: "- "
text: ""
}, {
kind: "link",
text: "{@link "
@@ -461,11 +461,11 @@ x(1)`
displayPartsForJSDoc: false,
tags: [{
name: "param",
text: "y - {@link C}"
text: "y {@link C}"
}],
documentation: [{
kind: "text",
text: "- "
text: ""
}, {
kind: "link",
text: "{@link "
@@ -496,7 +496,7 @@ x(1)`
text: " "
}, {
kind: "text",
text: "- "
text: ""
}, {
kind: "link",
text: "{@link "
@@ -610,7 +610,7 @@ foo`
text: " "
}, {
kind: "text",
text: "- see "
text: "see "
}, {
kind: "link",
text: "{@link "
@@ -641,7 +641,7 @@ foo`
displayPartsForJSDoc: false,
tags: [{
name: "param",
text: "x - see {@link C}",
text: "x see {@link C}",
}],
});
});
@@ -659,7 +659,7 @@ foo`
text: " "
}, {
kind: "text",
text: "- see "
text: "see "
}, {
kind: "link",
text: "{@link "
@@ -686,7 +686,7 @@ foo`
displayPartsForJSDoc: false,
tags: [{
name: "param",
text: "x - see {@link C}",
text: "x see {@link C}",
}],
});
});
@@ -69,9 +69,9 @@ export enum PubSubRecordIsStoredInRedisAsA {
>buildPubSubRecordType : <SO_FAR>(soFar: SO_FAR) => BuildPubSubRecordType<SO_FAR>
>Object.assign({}, soFar, {name: instance as TYPE}) as SO_FAR & {name: TYPE} : SO_FAR & { name: TYPE; }
>Object.assign({}, soFar, {name: instance as TYPE}) : SO_FAR & { name: TYPE; }
>Object.assign : { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, source1: U, source2: V): T & U & V; <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>Object.assign : { <T extends {}, U>(target: T, source: U): T & U; <T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V; <T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>Object : ObjectConstructor
>assign : { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, source1: U, source2: V): T & U & V; <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>assign : { <T extends {}, U>(target: T, source: U): T & U; <T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V; <T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>{} : {}
>soFar : SO_FAR
>{name: instance as TYPE} : { name: TYPE; }
@@ -123,9 +123,9 @@ export enum PubSubRecordIsStoredInRedisAsA {
>buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString})) : BuildPubSubRecordType<SO_FAR & { storedAs: PubSubRecordIsStoredInRedisAsA; }>
>buildPubSubRecordType : <SO_FAR>(soFar: SO_FAR) => BuildPubSubRecordType<SO_FAR>
>Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString}) : SO_FAR & { storedAs: PubSubRecordIsStoredInRedisAsA; }
>Object.assign : { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, source1: U, source2: V): T & U & V; <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>Object.assign : { <T extends {}, U>(target: T, source: U): T & U; <T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V; <T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>Object : ObjectConstructor
>assign : { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, source1: U, source2: V): T & U & V; <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>assign : { <T extends {}, U>(target: T, source: U): T & U; <T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V; <T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>{} : {}
>soFar : SO_FAR
>{storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString} : { storedAs: PubSubRecordIsStoredInRedisAsA.jsonEncodedRedisString; }
@@ -147,9 +147,9 @@ export enum PubSubRecordIsStoredInRedisAsA {
>buildPubSubRecordType(Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash})) : BuildPubSubRecordType<SO_FAR & { storedAs: PubSubRecordIsStoredInRedisAsA; }>
>buildPubSubRecordType : <SO_FAR>(soFar: SO_FAR) => BuildPubSubRecordType<SO_FAR>
>Object.assign({}, soFar, {storedAs: PubSubRecordIsStoredInRedisAsA.redisHash}) : SO_FAR & { storedAs: PubSubRecordIsStoredInRedisAsA; }
>Object.assign : { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, source1: U, source2: V): T & U & V; <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>Object.assign : { <T extends {}, U>(target: T, source: U): T & U; <T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V; <T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>Object : ObjectConstructor
>assign : { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, source1: U, source2: V): T & U & V; <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>assign : { <T extends {}, U>(target: T, source: U): T & U; <T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V; <T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>{} : {}
>soFar : SO_FAR
>{storedAs: PubSubRecordIsStoredInRedisAsA.redisHash} : { storedAs: PubSubRecordIsStoredInRedisAsA.redisHash; }
@@ -213,9 +213,9 @@ export enum PubSubRecordIsStoredInRedisAsA {
>buildPubSubRecordType : <SO_FAR>(soFar: SO_FAR) => BuildPubSubRecordType<SO_FAR>
>Object.assign({}, soFar, {identifier: instance as TYPE}) as SO_FAR & {identifier: TYPE} : SO_FAR & { identifier: TYPE; }
>Object.assign({}, soFar, {identifier: instance as TYPE}) : SO_FAR & { identifier: TYPE; }
>Object.assign : { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, source1: U, source2: V): T & U & V; <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>Object.assign : { <T extends {}, U>(target: T, source: U): T & U; <T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V; <T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>Object : ObjectConstructor
>assign : { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, source1: U, source2: V): T & U & V; <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>assign : { <T extends {}, U>(target: T, source: U): T & U; <T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V; <T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>{} : {}
>soFar : SO_FAR
>{identifier: instance as TYPE} : { identifier: TYPE; }
@@ -265,9 +265,9 @@ export enum PubSubRecordIsStoredInRedisAsA {
>buildPubSubRecordType : <SO_FAR>(soFar: SO_FAR) => BuildPubSubRecordType<SO_FAR>
>Object.assign({}, soFar, {record: instance as TYPE}) as SO_FAR & {record: TYPE} : SO_FAR & { record: TYPE; }
>Object.assign({}, soFar, {record: instance as TYPE}) : SO_FAR & { record: TYPE; }
>Object.assign : { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, source1: U, source2: V): T & U & V; <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>Object.assign : { <T extends {}, U>(target: T, source: U): T & U; <T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V; <T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>Object : ObjectConstructor
>assign : { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, source1: U, source2: V): T & U & V; <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>assign : { <T extends {}, U>(target: T, source: U): T & U; <T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V; <T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>{} : {}
>soFar : SO_FAR
>{record: instance as TYPE} : { record: TYPE; }
@@ -321,9 +321,9 @@ export enum PubSubRecordIsStoredInRedisAsA {
>buildPubSubRecordType(Object.assign({}, soFar, {maxMsToWaitBeforePublishing: instance})) : BuildPubSubRecordType<SO_FAR & { maxMsToWaitBeforePublishing: number; }>
>buildPubSubRecordType : <SO_FAR>(soFar: SO_FAR) => BuildPubSubRecordType<SO_FAR>
>Object.assign({}, soFar, {maxMsToWaitBeforePublishing: instance}) : SO_FAR & { maxMsToWaitBeforePublishing: number; }
>Object.assign : { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, source1: U, source2: V): T & U & V; <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>Object.assign : { <T extends {}, U>(target: T, source: U): T & U; <T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V; <T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>Object : ObjectConstructor
>assign : { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, source1: U, source2: V): T & U & V; <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>assign : { <T extends {}, U>(target: T, source: U): T & U; <T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V; <T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>{} : {}
>soFar : SO_FAR
>{maxMsToWaitBeforePublishing: instance} : { maxMsToWaitBeforePublishing: number; }
@@ -340,9 +340,9 @@ export enum PubSubRecordIsStoredInRedisAsA {
>buildPubSubRecordType(Object.assign({}, soFar, {maxMsToWaitBeforePublishing: 0})) : BuildPubSubRecordType<SO_FAR & { maxMsToWaitBeforePublishing: number; }>
>buildPubSubRecordType : <SO_FAR>(soFar: SO_FAR) => BuildPubSubRecordType<SO_FAR>
>Object.assign({}, soFar, {maxMsToWaitBeforePublishing: 0}) : SO_FAR & { maxMsToWaitBeforePublishing: number; }
>Object.assign : { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, source1: U, source2: V): T & U & V; <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>Object.assign : { <T extends {}, U>(target: T, source: U): T & U; <T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V; <T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>Object : ObjectConstructor
>assign : { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, source1: U, source2: V): T & U & V; <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>assign : { <T extends {}, U>(target: T, source: U): T & U; <T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V; <T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>{} : {}
>soFar : SO_FAR
>{maxMsToWaitBeforePublishing: 0} : { maxMsToWaitBeforePublishing: number; }
@@ -441,9 +441,9 @@ export enum PubSubRecordIsStoredInRedisAsA {
>soFar : SO_FAR
>Object.assign( {}, buildNameFieldConstructor(soFar), buildIdentifierFieldConstructor(soFar), buildRecordFieldConstructor(soFar), buildStoredAsConstructor(soFar), buildMaxMsToWaitBeforePublishingFieldConstructor(soFar), buildType(soFar) ) as BuildPubSubRecordType<SO_FAR> : BuildPubSubRecordType<SO_FAR>
>Object.assign( {}, buildNameFieldConstructor(soFar), buildIdentifierFieldConstructor(soFar), buildRecordFieldConstructor(soFar), buildStoredAsConstructor(soFar), buildMaxMsToWaitBeforePublishingFieldConstructor(soFar), buildType(soFar) ) : any
>Object.assign : { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, source1: U, source2: V): T & U & V; <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>Object.assign : { <T extends {}, U>(target: T, source: U): T & U; <T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V; <T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>Object : ObjectConstructor
>assign : { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, source1: U, source2: V): T & U & V; <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>assign : { <T extends {}, U>(target: T, source: U): T & U; <T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V; <T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
{},
>{} : {}
@@ -181,6 +181,34 @@ function f3<K extends keyof ArgMap>(funcs: Funcs, key: K, arg: ArgMap[K]) {
function f4<K extends keyof ArgMap>(x: Funcs[keyof ArgMap], y: Funcs[K]) {
x = y;
}
// Repro from #47890
interface MyObj {
someKey: {
name: string;
}
someOtherKey: {
name: number;
}
}
const ref: MyObj = {
someKey: { name: "" },
someOtherKey: { name: 42 }
};
function func<K extends keyof MyObj>(k: K): MyObj[K]['name'] | undefined {
const myObj: Partial<MyObj>[K] = ref[k];
if (myObj) {
return myObj.name;
}
const myObj2: Partial<MyObj>[keyof MyObj] = ref[k];
if (myObj2) {
return myObj2.name;
}
return undefined;
}
//// [correlatedUnions.js]
@@ -282,6 +310,21 @@ function f3(funcs, key, arg) {
function f4(x, y) {
x = y;
}
var ref = {
someKey: { name: "" },
someOtherKey: { name: 42 }
};
function func(k) {
var myObj = ref[k];
if (myObj) {
return myObj.name;
}
var myObj2 = ref[k];
if (myObj2) {
return myObj2.name;
}
return undefined;
}
//// [correlatedUnions.d.ts]
@@ -398,3 +441,13 @@ declare function f1<K extends keyof ArgMap>(funcs: Funcs, key: K, arg: ArgMap[K]
declare function f2<K extends keyof ArgMap>(funcs: Funcs, key: K, arg: ArgMap[K]): void;
declare function f3<K extends keyof ArgMap>(funcs: Funcs, key: K, arg: ArgMap[K]): void;
declare function f4<K extends keyof ArgMap>(x: Funcs[keyof ArgMap], y: Funcs[K]): void;
interface MyObj {
someKey: {
name: string;
};
someOtherKey: {
name: number;
};
}
declare const ref: MyObj;
declare function func<K extends keyof MyObj>(k: K): MyObj[K]['name'] | undefined;
@@ -675,3 +675,81 @@ function f4<K extends keyof ArgMap>(x: Funcs[keyof ArgMap], y: Funcs[K]) {
>y : Symbol(y, Decl(correlatedUnions.ts, 179, 59))
}
// Repro from #47890
interface MyObj {
>MyObj : Symbol(MyObj, Decl(correlatedUnions.ts, 181, 1))
someKey: {
>someKey : Symbol(MyObj.someKey, Decl(correlatedUnions.ts, 185, 17))
name: string;
>name : Symbol(name, Decl(correlatedUnions.ts, 186, 14))
}
someOtherKey: {
>someOtherKey : Symbol(MyObj.someOtherKey, Decl(correlatedUnions.ts, 188, 5))
name: number;
>name : Symbol(name, Decl(correlatedUnions.ts, 189, 19))
}
}
const ref: MyObj = {
>ref : Symbol(ref, Decl(correlatedUnions.ts, 194, 5))
>MyObj : Symbol(MyObj, Decl(correlatedUnions.ts, 181, 1))
someKey: { name: "" },
>someKey : Symbol(someKey, Decl(correlatedUnions.ts, 194, 20))
>name : Symbol(name, Decl(correlatedUnions.ts, 195, 14))
someOtherKey: { name: 42 }
>someOtherKey : Symbol(someOtherKey, Decl(correlatedUnions.ts, 195, 26))
>name : Symbol(name, Decl(correlatedUnions.ts, 196, 19))
};
function func<K extends keyof MyObj>(k: K): MyObj[K]['name'] | undefined {
>func : Symbol(func, Decl(correlatedUnions.ts, 197, 2))
>K : Symbol(K, Decl(correlatedUnions.ts, 199, 14))
>MyObj : Symbol(MyObj, Decl(correlatedUnions.ts, 181, 1))
>k : Symbol(k, Decl(correlatedUnions.ts, 199, 37))
>K : Symbol(K, Decl(correlatedUnions.ts, 199, 14))
>MyObj : Symbol(MyObj, Decl(correlatedUnions.ts, 181, 1))
>K : Symbol(K, Decl(correlatedUnions.ts, 199, 14))
const myObj: Partial<MyObj>[K] = ref[k];
>myObj : Symbol(myObj, Decl(correlatedUnions.ts, 200, 9))
>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --))
>MyObj : Symbol(MyObj, Decl(correlatedUnions.ts, 181, 1))
>K : Symbol(K, Decl(correlatedUnions.ts, 199, 14))
>ref : Symbol(ref, Decl(correlatedUnions.ts, 194, 5))
>k : Symbol(k, Decl(correlatedUnions.ts, 199, 37))
if (myObj) {
>myObj : Symbol(myObj, Decl(correlatedUnions.ts, 200, 9))
return myObj.name;
>myObj.name : Symbol(name, Decl(correlatedUnions.ts, 186, 14), Decl(correlatedUnions.ts, 189, 19))
>myObj : Symbol(myObj, Decl(correlatedUnions.ts, 200, 9))
>name : Symbol(name, Decl(correlatedUnions.ts, 186, 14), Decl(correlatedUnions.ts, 189, 19))
}
const myObj2: Partial<MyObj>[keyof MyObj] = ref[k];
>myObj2 : Symbol(myObj2, Decl(correlatedUnions.ts, 204, 9))
>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --))
>MyObj : Symbol(MyObj, Decl(correlatedUnions.ts, 181, 1))
>MyObj : Symbol(MyObj, Decl(correlatedUnions.ts, 181, 1))
>ref : Symbol(ref, Decl(correlatedUnions.ts, 194, 5))
>k : Symbol(k, Decl(correlatedUnions.ts, 199, 37))
if (myObj2) {
>myObj2 : Symbol(myObj2, Decl(correlatedUnions.ts, 204, 9))
return myObj2.name;
>myObj2.name : Symbol(name, Decl(correlatedUnions.ts, 186, 14), Decl(correlatedUnions.ts, 189, 19))
>myObj2 : Symbol(myObj2, Decl(correlatedUnions.ts, 204, 9))
>name : Symbol(name, Decl(correlatedUnions.ts, 186, 14), Decl(correlatedUnions.ts, 189, 19))
}
return undefined;
>undefined : Symbol(undefined)
}
@@ -624,3 +624,74 @@ function f4<K extends keyof ArgMap>(x: Funcs[keyof ArgMap], y: Funcs[K]) {
>y : Funcs[K]
}
// Repro from #47890
interface MyObj {
someKey: {
>someKey : { name: string; }
name: string;
>name : string
}
someOtherKey: {
>someOtherKey : { name: number; }
name: number;
>name : number
}
}
const ref: MyObj = {
>ref : MyObj
>{ someKey: { name: "" }, someOtherKey: { name: 42 }} : { someKey: { name: string; }; someOtherKey: { name: number; }; }
someKey: { name: "" },
>someKey : { name: string; }
>{ name: "" } : { name: string; }
>name : string
>"" : ""
someOtherKey: { name: 42 }
>someOtherKey : { name: number; }
>{ name: 42 } : { name: number; }
>name : number
>42 : 42
};
function func<K extends keyof MyObj>(k: K): MyObj[K]['name'] | undefined {
>func : <K extends keyof MyObj>(k: K) => MyObj[K]['name'] | undefined
>k : K
const myObj: Partial<MyObj>[K] = ref[k];
>myObj : Partial<MyObj>[K]
>ref[k] : MyObj[K]
>ref : MyObj
>k : K
if (myObj) {
>myObj : Partial<MyObj>[K]
return myObj.name;
>myObj.name : string | number
>myObj : { name: string; } | { name: number; }
>name : string | number
}
const myObj2: Partial<MyObj>[keyof MyObj] = ref[k];
>myObj2 : { name: string; } | { name: number; } | undefined
>ref[k] : { name: string; } | { name: number; }
>ref : MyObj
>k : K
if (myObj2) {
>myObj2 : { name: string; } | { name: number; }
return myObj2.name;
>myObj2.name : string | number
>myObj2 : { name: string; } | { name: number; }
>name : string | number
}
return undefined;
>undefined : undefined
}
@@ -39,9 +39,9 @@ export const updateIfChanged = <T>(t: T) => {
return Object.assign(
>Object.assign( <K extends Key<U>>(key: K) => reduce<Value<K, U>>(u[key as keyof U] as Value<K, U>, (v: Value<K, U>) => { return update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v })); }), { map: (updater: (u: U) => U) => set(updater(u)), set }) : (<K extends keyof U>(key: K) => (<K extends keyof Value<K, U>>(key: K) => (<K extends keyof Value<K, Value<K, U>>>(key: K) => (<K extends keyof Value<K, Value<K, Value<K, U>>>>(key: K) => (<K extends keyof Value<K, Value<K, Value<K, Value<K, U>>>>>(key: K) => (<K extends keyof Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>(key: K) => (<K extends keyof Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>(key: K) => (<K extends keyof Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>>(key: K) => (<K extends keyof Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>>>(key: K) => (<K extends keyof Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>>>>(key: K) => (<K extends keyof Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>>>>>(key: K) => any & { map: (updater: (u: Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>>>>>) => Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>>>>>) => T; set: (newU: Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>>>>>) => T; }) & { map: (updater: (u: Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>>>>) => Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>>>>) => T; set: (newU: Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>>>>) => T; }) & { map: (updater: (u: Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>>>) => Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>>>) => T; set: (newU: Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>>>) => T; }) & { map: (updater: (u: Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>>) => Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>>) => T; set: (newU: Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>>) => T; }) & { map: (updater: (u: Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>) => Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>) => T; set: (newU: Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>) => T; }) & { map: (updater: (u: Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>) => Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>) => T; set: (newU: Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>) => T; }) & { map: (updater: (u: Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>) => Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>) => T; set: (newU: Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>) => T; }) & { map: (updater: (u: Value<K, Value<K, Value<K, Value<K, U>>>>) => Value<K, Value<K, Value<K, Value<K, U>>>>) => T; set: (newU: Value<K, Value<K, Value<K, Value<K, U>>>>) => T; }) & { map: (updater: (u: Value<K, Value<K, Value<K, U>>>) => Value<K, Value<K, Value<K, U>>>) => T; set: (newU: Value<K, Value<K, Value<K, U>>>) => T; }) & { map: (updater: (u: Value<K, Value<K, U>>) => Value<K, Value<K, U>>) => T; set: (newU: Value<K, Value<K, U>>) => T; }) & { map: (updater: (u: Value<K, U>) => Value<K, U>) => T; set: (newU: Value<K, U>) => T; }) & { map: (updater: (u: U) => U) => T; set: (newU: U) => T; }
>Object.assign : { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, source1: U, source2: V): T & U & V; <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>Object.assign : { <T extends {}, U>(target: T, source: U): T & U; <T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V; <T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>Object : ObjectConstructor
>assign : { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, source1: U, source2: V): T & U & V; <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>assign : { <T extends {}, U>(target: T, source: U): T & U; <T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V; <T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
<K extends Key<U>>(key: K) =>
><K extends Key<U>>(key: K) => reduce<Value<K, U>>(u[key as keyof U] as Value<K, U>, (v: Value<K, U>) => { return update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v })); }) : <K extends keyof U>(key: K) => (<K extends keyof Value<K, U>>(key: K) => (<K extends keyof Value<K, Value<K, U>>>(key: K) => (<K extends keyof Value<K, Value<K, Value<K, U>>>>(key: K) => (<K extends keyof Value<K, Value<K, Value<K, Value<K, U>>>>>(key: K) => (<K extends keyof Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>(key: K) => (<K extends keyof Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>(key: K) => (<K extends keyof Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>>(key: K) => (<K extends keyof Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>>>(key: K) => (<K extends keyof Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>>>>(key: K) => (<K extends keyof Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>>>>>(key: K) => any & { map: (updater: (u: Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>>>>>) => Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>>>>>) => T; set: (newU: Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>>>>>) => T; }) & { map: (updater: (u: Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>>>>) => Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>>>>) => T; set: (newU: Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>>>>) => T; }) & { map: (updater: (u: Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>>>) => Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>>>) => T; set: (newU: Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>>>) => T; }) & { map: (updater: (u: Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>>) => Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>>) => T; set: (newU: Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>>) => T; }) & { map: (updater: (u: Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>) => Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>) => T; set: (newU: Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>>) => T; }) & { map: (updater: (u: Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>) => Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>) => T; set: (newU: Value<K, Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>>) => T; }) & { map: (updater: (u: Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>) => Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>) => T; set: (newU: Value<K, Value<K, Value<K, Value<K, Value<K, U>>>>>) => T; }) & { map: (updater: (u: Value<K, Value<K, Value<K, Value<K, U>>>>) => Value<K, Value<K, Value<K, Value<K, U>>>>) => T; set: (newU: Value<K, Value<K, Value<K, Value<K, U>>>>) => T; }) & { map: (updater: (u: Value<K, Value<K, Value<K, U>>>) => Value<K, Value<K, Value<K, U>>>) => T; set: (newU: Value<K, Value<K, Value<K, U>>>) => T; }) & { map: (updater: (u: Value<K, Value<K, U>>) => Value<K, Value<K, U>>) => T; set: (newU: Value<K, Value<K, U>>) => T; }) & { map: (updater: (u: Value<K, U>) => Value<K, U>) => T; set: (newU: Value<K, U>) => T; }
@@ -62,9 +62,9 @@ export const updateIfChanged = <T>(t: T) => {
>update(Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v })) : T
>update : (u: U) => T
>Object.assign(Array.isArray(u) ? [] : {}, u, { [key]: v }) : U & { [x: string]: Value<K, U>; }
>Object.assign : { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, source1: U, source2: V): T & U & V; <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>Object.assign : { <T extends {}, U>(target: T, source: U): T & U; <T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V; <T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>Object : ObjectConstructor
>assign : { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, source1: U, source2: V): T & U & V; <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>assign : { <T extends {}, U>(target: T, source: U): T & U; <T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V; <T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>Array.isArray(u) ? [] : {} : undefined[] | {}
>Array.isArray(u) : boolean
>Array.isArray : (arg: any) => arg is any[]
@@ -2,9 +2,9 @@
const test = Object.assign({}, { test: true });
>test : { test: boolean; }
>Object.assign({}, { test: true }) : { test: boolean; }
>Object.assign : { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, source1: U, source2: V): T & U & V; <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>Object.assign : { <T extends {}, U>(target: T, source: U): T & U; <T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V; <T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>Object : ObjectConstructor
>assign : { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, source1: U, source2: V): T & U & V; <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>assign : { <T extends {}, U>(target: T, source: U): T & U; <T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V; <T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>{} : {}
>{ test: true } : { test: true; }
>test : true
@@ -76,9 +76,9 @@ const intersectDictionaries = <F1 extends Dictionary, F2 extends Dictionary>(
): F1 & F2 => Object.assign({}, d1, d2);
>Object.assign({}, d1, d2) : {} & F1 & F2
>Object.assign : { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, source1: U, source2: V): T & U & V; <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>Object.assign : { <T extends {}, U>(target: T, source: U): T & U; <T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V; <T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>Object : ObjectConstructor
>assign : { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, source1: U, source2: V): T & U & V; <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>assign : { <T extends {}, U>(target: T, source: U): T & U; <T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V; <T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>{} : {}
>d1 : F1
>d2 : F2
@@ -52,7 +52,7 @@
"name": "p1",
"documentation": [
{
"text": "- A string param",
"text": "A string param",
"kind": "text"
}
],
@@ -81,7 +81,7 @@
"name": "p2",
"documentation": [
{
"text": "- An optional param",
"text": "An optional param",
"kind": "text"
}
],
@@ -110,7 +110,7 @@
"name": "p3",
"documentation": [
{
"text": "- Another optional param",
"text": "Another optional param",
"kind": "text"
}
],
@@ -143,7 +143,7 @@
"name": "p4",
"documentation": [
{
"text": "- An optional param with a default value",
"text": "An optional param with a default value",
"kind": "text"
}
],
@@ -187,7 +187,7 @@
"kind": "space"
},
{
"text": "- A string param",
"text": "A string param",
"kind": "text"
}
]
@@ -204,7 +204,7 @@
"kind": "space"
},
{
"text": "- An optional param",
"text": "An optional param",
"kind": "text"
}
]
@@ -221,7 +221,7 @@
"kind": "space"
},
{
"text": "- Another optional param",
"text": "Another optional param",
"kind": "text"
}
]
@@ -238,7 +238,7 @@
"kind": "space"
},
{
"text": "- An optional param with a default value",
"text": "An optional param with a default value",
"kind": "text"
}
]
@@ -308,7 +308,7 @@
"name": "p1",
"documentation": [
{
"text": "- A string param",
"text": "A string param",
"kind": "text"
}
],
@@ -337,7 +337,7 @@
"name": "p2",
"documentation": [
{
"text": "- An optional param",
"text": "An optional param",
"kind": "text"
}
],
@@ -366,7 +366,7 @@
"name": "p3",
"documentation": [
{
"text": "- Another optional param",
"text": "Another optional param",
"kind": "text"
}
],
@@ -399,7 +399,7 @@
"name": "p4",
"documentation": [
{
"text": "- An optional param with a default value",
"text": "An optional param with a default value",
"kind": "text"
}
],
@@ -443,7 +443,7 @@
"kind": "space"
},
{
"text": "- A string param",
"text": "A string param",
"kind": "text"
}
]
@@ -460,7 +460,7 @@
"kind": "space"
},
{
"text": "- An optional param",
"text": "An optional param",
"kind": "text"
}
]
@@ -477,7 +477,7 @@
"kind": "space"
},
{
"text": "- Another optional param",
"text": "Another optional param",
"kind": "text"
}
]
@@ -494,7 +494,7 @@
"kind": "space"
},
{
"text": "- An optional param with a default value",
"text": "An optional param with a default value",
"kind": "text"
}
]
@@ -564,7 +564,7 @@
"name": "p1",
"documentation": [
{
"text": "- A string param",
"text": "A string param",
"kind": "text"
}
],
@@ -593,7 +593,7 @@
"name": "p2",
"documentation": [
{
"text": "- An optional param",
"text": "An optional param",
"kind": "text"
}
],
@@ -622,7 +622,7 @@
"name": "p3",
"documentation": [
{
"text": "- Another optional param",
"text": "Another optional param",
"kind": "text"
}
],
@@ -655,7 +655,7 @@
"name": "p4",
"documentation": [
{
"text": "- An optional param with a default value",
"text": "An optional param with a default value",
"kind": "text"
}
],
@@ -699,7 +699,7 @@
"kind": "space"
},
{
"text": "- A string param",
"text": "A string param",
"kind": "text"
}
]
@@ -716,7 +716,7 @@
"kind": "space"
},
{
"text": "- An optional param",
"text": "An optional param",
"kind": "text"
}
]
@@ -733,7 +733,7 @@
"kind": "space"
},
{
"text": "- Another optional param",
"text": "Another optional param",
"kind": "text"
}
]
@@ -750,7 +750,7 @@
"kind": "space"
},
{
"text": "- An optional param with a default value",
"text": "An optional param with a default value",
"kind": "text"
}
]
@@ -820,7 +820,7 @@
"name": "p1",
"documentation": [
{
"text": "- A string param",
"text": "A string param",
"kind": "text"
}
],
@@ -849,7 +849,7 @@
"name": "p2",
"documentation": [
{
"text": "- An optional param",
"text": "An optional param",
"kind": "text"
}
],
@@ -878,7 +878,7 @@
"name": "p3",
"documentation": [
{
"text": "- Another optional param",
"text": "Another optional param",
"kind": "text"
}
],
@@ -911,7 +911,7 @@
"name": "p4",
"documentation": [
{
"text": "- An optional param with a default value",
"text": "An optional param with a default value",
"kind": "text"
}
],
@@ -955,7 +955,7 @@
"kind": "space"
},
{
"text": "- A string param",
"text": "A string param",
"kind": "text"
}
]
@@ -972,7 +972,7 @@
"kind": "space"
},
{
"text": "- An optional param",
"text": "An optional param",
"kind": "text"
}
]
@@ -989,7 +989,7 @@
"kind": "space"
},
{
"text": "- Another optional param",
"text": "Another optional param",
"kind": "text"
}
]
@@ -1006,7 +1006,7 @@
"kind": "space"
},
{
"text": "- An optional param with a default value",
"text": "An optional param with a default value",
"kind": "text"
}
]
@@ -107,7 +107,7 @@
"kind": "space"
},
{
"text": "- x comment",
"text": "x comment",
"kind": "text"
}
]
@@ -124,7 +124,7 @@
"kind": "space"
},
{
"text": "- y comment",
"text": "y comment",
"kind": "text"
}
]
@@ -147,7 +147,7 @@
"kind": "space"
},
{
"text": "- x comment",
"text": "x comment",
"kind": "text"
}
]
@@ -164,7 +164,7 @@
"kind": "space"
},
{
"text": "- y comment",
"text": "y comment",
"kind": "text"
}
]
@@ -147,7 +147,7 @@
"kind": "space"
},
{
"text": "- x comment",
"text": "x comment",
"kind": "text"
}
]
@@ -164,7 +164,7 @@
"kind": "space"
},
{
"text": "- y comment",
"text": "y comment",
"kind": "text"
}
]
@@ -147,7 +147,7 @@
"kind": "space"
},
{
"text": "- x comment",
"text": "x comment",
"kind": "text"
}
]
@@ -164,7 +164,7 @@
"kind": "space"
},
{
"text": "- y comment",
"text": "y comment",
"kind": "text"
}
]
@@ -52,7 +52,7 @@
"name": "eventName",
"documentation": [
{
"text": "- So many words",
"text": "So many words",
"kind": "text"
}
],
@@ -81,7 +81,7 @@
"name": "eventName2",
"documentation": [
{
"text": "- Silence is golden",
"text": "Silence is golden",
"kind": "text"
}
],
@@ -126,7 +126,7 @@
"name": "eventName3",
"documentation": [
{
"text": "- Osterreich mos def",
"text": "Osterreich mos def",
"kind": "text"
}
],
@@ -234,7 +234,7 @@
"name": "eventName",
"documentation": [
{
"text": "- So many words",
"text": "So many words",
"kind": "text"
}
],
@@ -263,7 +263,7 @@
"name": "eventName2",
"documentation": [
{
"text": "- Silence is golden",
"text": "Silence is golden",
"kind": "text"
}
],
@@ -308,7 +308,7 @@
"name": "eventName3",
"documentation": [
{
"text": "- Osterreich mos def",
"text": "Osterreich mos def",
"kind": "text"
}
],
@@ -416,7 +416,7 @@
"name": "eventName",
"documentation": [
{
"text": "- So many words",
"text": "So many words",
"kind": "text"
}
],
@@ -445,7 +445,7 @@
"name": "eventName2",
"documentation": [
{
"text": "- Silence is golden",
"text": "Silence is golden",
"kind": "text"
}
],
@@ -490,7 +490,7 @@
"name": "eventName3",
"documentation": [
{
"text": "- Osterreich mos def",
"text": "Osterreich mos def",
"kind": "text"
}
],
@@ -1,6 +1,6 @@
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Projects */
// "incremental": true, /* Enable incremental compilation */
@@ -1,6 +1,6 @@
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Projects */
// "incremental": true, /* Enable incremental compilation */
@@ -1,6 +1,6 @@
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Projects */
// "incremental": true, /* Enable incremental compilation */
@@ -1,6 +1,6 @@
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Projects */
// "incremental": true, /* Enable incremental compilation */
@@ -1,6 +1,6 @@
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Projects */
// "incremental": true, /* Enable incremental compilation */
@@ -1,6 +1,6 @@
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Projects */
// "incremental": true, /* Enable incremental compilation */
@@ -1,6 +1,6 @@
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Projects */
// "incremental": true, /* Enable incremental compilation */
@@ -1,6 +1,6 @@
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Projects */
// "incremental": true, /* Enable incremental compilation */
@@ -1,6 +1,6 @@
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Projects */
// "incremental": true, /* Enable incremental compilation */
@@ -145,7 +145,7 @@ Emit additional JavaScript to ease support for importing CommonJS modules. This
type: boolean
default: false
You can learn about all of the compiler options at https://aka.ms/tsconfig-reference
You can learn about all of the compiler options at https://aka.ms/tsc
exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped
@@ -145,7 +145,7 @@ Emit additional JavaScript to ease support for importing CommonJS modules. This
type: boolean
default: false
You can learn about all of the compiler options at https://aka.ms/tsconfig-reference
You can learn about all of the compiler options at https://aka.ms/tsc
exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped
@@ -145,7 +145,7 @@ Emit additional JavaScript to ease support for importing CommonJS modules. This
type: boolean
default: false
You can learn about all of the compiler options at https://aka.ms/tsconfig-reference
You can learn about all of the compiler options at https://aka.ms/tsc
exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped
@@ -21,7 +21,7 @@ interface Array<T> { length: number; [n: number]: T; }
//// [/user/username/projects/myproject/tsconfig.json]
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Projects */
// "incremental": true, /* Enable incremental compilation */
@@ -21,7 +21,7 @@ interface Array<T> { length: number; [n: number]: T; }
//// [/user/username/projects/myproject/tsconfig.json]
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Projects */
// "incremental": true, /* Enable incremental compilation */
@@ -21,7 +21,7 @@ interface Array<T> { length: number; [n: number]: T; }
//// [/user/username/projects/myproject/tsconfig.json]
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Projects */
// "incremental": true, /* Enable incremental compilation */
@@ -21,7 +21,7 @@ interface Array<T> { length: number; [n: number]: T; }
//// [/user/username/projects/myproject/tsconfig.json]
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Projects */
// "incremental": true, /* Enable incremental compilation */
@@ -21,7 +21,7 @@ interface Array<T> { length: number; [n: number]: T; }
//// [/user/username/projects/myproject/tsconfig.json]
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Projects */
// "incremental": true, /* Enable incremental compilation */
@@ -21,7 +21,7 @@ interface Array<T> { length: number; [n: number]: T; }
//// [/user/username/projects/myproject/tsconfig.json]
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Projects */
// "incremental": true, /* Enable incremental compilation */
@@ -246,9 +246,9 @@ const assign = <T, U>(a: T, b: U) => Object.assign(a, b);
>a : T
>b : U
>Object.assign(a, b) : T & U
>Object.assign : { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, source1: U, source2: V): T & U & V; <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>Object.assign : { <T extends {}, U>(target: T, source: U): T & U; <T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V; <T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>Object : ObjectConstructor
>assign : { <T, U>(target: T, source: U): T & U; <T, U, V>(target: T, source1: U, source2: V): T & U & V; <T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>assign : { <T extends {}, U>(target: T, source: U): T & U; <T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V; <T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W; (target: object, ...sources: any[]): any; }
>a : T
>b : U
+28
View File
@@ -183,3 +183,31 @@ function f3<K extends keyof ArgMap>(funcs: Funcs, key: K, arg: ArgMap[K]) {
function f4<K extends keyof ArgMap>(x: Funcs[keyof ArgMap], y: Funcs[K]) {
x = y;
}
// Repro from #47890
interface MyObj {
someKey: {
name: string;
}
someOtherKey: {
name: number;
}
}
const ref: MyObj = {
someKey: { name: "" },
someOtherKey: { name: 42 }
};
function func<K extends keyof MyObj>(k: K): MyObj[K]['name'] | undefined {
const myObj: Partial<MyObj>[K] = ref[k];
if (myObj) {
return myObj.name;
}
const myObj2: Partial<MyObj>[keyof MyObj] = ref[k];
if (myObj2) {
return myObj2.name;
}
return undefined;
}
@@ -30,6 +30,6 @@ verify.quickInfoIs("var t: FooHandler");
goTo.marker("2");
verify.quickInfoIs("var t2: FooHandler2");
goTo.marker("3");
verify.quickInfoIs("type FooHandler2 = (eventName?: string | undefined, eventName2?: string) => any", "- What, another one?");
verify.quickInfoIs("type FooHandler2 = (eventName?: string | undefined, eventName2?: string) => any", "What, another one?");
goTo.marker("8");
verify.quickInfoIs("type FooHandler = (eventName: string, eventName2: number | string, eventName3: any) => number", "- A kind of magic");
verify.quickInfoIs("type FooHandler = (eventName: string, eventName2: number | string, eventName3: any) => number", "A kind of magic");
@@ -71,4 +71,4 @@ verify.completions(
{ marker: "catAge", includes: "toExponential" },
);
verify.quickInfoAt("AnimalType", "type Animal = {\n animalName: string;\n animalAge: number;\n}", "- think Giraffes");
verify.quickInfoAt("AnimalType", "type Animal = {\n animalName: string;\n animalAge: number;\n}", "think Giraffes");