Skip to content

Commit 9062103

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix/silent-never-leak-anonymous-object-types
2 parents 5c5e329 + b33d372 commit 9062103

23 files changed

+1218
-7
lines changed

SECURITY.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Security
44

5-
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin).
5+
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations.
66

77
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below.
88

@@ -12,9 +12,7 @@ If you believe you have found a security vulnerability in any Microsoft-owned re
1212

1313
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report).
1414

15-
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp).
16-
17-
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
15+
You should receive a response within 24 hours. If for some reason you do not, please follow up using the messaging functionality found at the bottom of the Activity tab on your vulnerability report on [https://msrc.microsoft.com/report/vulnerability](https://msrc.microsoft.com/report/vulnerability/) or via email as described in the instructions at the bottom of [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report). Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc) or on MSRC's [FAQ page for reporting an issue](https://www.microsoft.com/en-us/msrc/faqs-report-an-issue).
1816

1917
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
2018

src/compiler/checker.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2840,7 +2840,9 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
28402840
// When merging the module augmentation into a.ts, the symbol for `A` will itself be merged, so its parent
28412841
// should be the merged module symbol. But the symbol for `B` has only one declaration, so its parent should
28422842
// be the module augmentation symbol, which contains its only declaration.
2843-
merged.parent = mergedParent;
2843+
if (merged.flags & SymbolFlags.Transient) {
2844+
merged.parent = mergedParent;
2845+
}
28442846
}
28452847
target.set(id, merged);
28462848
});
@@ -27580,10 +27582,20 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
2758027582
const constraint = getConstraintOfTypeParameter(inference.typeParameter);
2758127583
if (constraint) {
2758227584
const instantiatedConstraint = instantiateType(constraint, context.nonFixingMapper);
27583-
if (!inferredType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
27585+
if (inferredType) {
27586+
const constraintWithThis = getTypeWithThisArgument(instantiatedConstraint, inferredType);
27587+
if (!context.compareTypes(inferredType, constraintWithThis)) {
27588+
// If we have a pure return type inference, we may succeed by removing constituents of the inferred type
27589+
// that aren't assignable to the constraint type (pure return type inferences are speculation anyway).
27590+
const filteredByConstraint = inference.priority === InferencePriority.ReturnType ? filterType(inferredType, t => !!context.compareTypes(t, constraintWithThis)) : neverType;
27591+
inferredType = !(filteredByConstraint.flags & TypeFlags.Never) ? filteredByConstraint : undefined;
27592+
}
27593+
}
27594+
if (!inferredType) {
2758427595
// If the fallback type satisfies the constraint, we pick it. Otherwise, we pick the constraint.
27585-
inference.inferredType = fallbackType && context.compareTypes(fallbackType, getTypeWithThisArgument(instantiatedConstraint, fallbackType)) ? fallbackType : instantiatedConstraint;
27596+
inferredType = fallbackType && context.compareTypes(fallbackType, getTypeWithThisArgument(instantiatedConstraint, fallbackType)) ? fallbackType : instantiatedConstraint;
2758627597
}
27598+
inference.inferredType = inferredType;
2758727599
}
2758827600
clearActiveMapperCaches();
2758927601
}

src/loc/lcl/chs/diagnosticMessages/diagnosticMessages.generated.json.lcl

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8190,6 +8190,15 @@
81908190
</Str>
81918191
<Disp Icon="Str" />
81928192
</Item>
8193+
<Item ItemId=";Ignore_the_tsconfig_found_and_build_with_commandline_options_and_files_1549" ItemType="0" PsrId="306" Leaf="true">
8194+
<Str Cat="Text">
8195+
<Val><![CDATA[Ignore the tsconfig found and build with commandline options and files.]]></Val>
8196+
<Tgt Cat="Text" Stat="Loc" Orig="New">
8197+
<Val><![CDATA[忽略找到的 tsconfig,使用命令行选项和文件进行构建。]]></Val>
8198+
</Tgt>
8199+
</Str>
8200+
<Disp Icon="Str" />
8201+
</Item>
81938202
<Item ItemId=";Ignore_this_error_message_90019" ItemType="0" PsrId="306" Leaf="true">
81948203
<Str Cat="Text">
81958204
<Val><![CDATA[Ignore this error message]]></Val>
@@ -18630,6 +18639,15 @@
1863018639
</Str>
1863118640
<Disp Icon="Str" />
1863218641
</Item>
18642+
<Item ItemId=";await_using_declarations_are_not_allowed_in_case_or_default_clauses_unless_contained_within_a_block_1548" ItemType="0" PsrId="306" Leaf="true">
18643+
<Str Cat="Text">
18644+
<Val><![CDATA['await using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block.]]></Val>
18645+
<Tgt Cat="Text" Stat="Loc" Orig="New">
18646+
<Val><![CDATA[除非包含在块中,否则不允许在 "case" 或 "default" 子句中使用 "await using" 声明。]]></Val>
18647+
</Tgt>
18648+
</Str>
18649+
<Disp Icon="Str" />
18650+
</Item>
1863318651
<Item ItemId=";await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_th_2853" ItemType="0" PsrId="306" Leaf="true">
1863418652
<Str Cat="Text">
1863518653
<Val><![CDATA['await using' statements are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module.]]></Val>
@@ -19431,6 +19449,15 @@
1943119449
</Str>
1943219450
<Disp Icon="Str" />
1943319451
</Item>
19452+
<Item ItemId=";tsconfig_json_is_present_but_will_not_be_loaded_if_files_are_specified_on_commandline_Use_ignoreConf_5112" ItemType="0" PsrId="306" Leaf="true">
19453+
<Str Cat="Text">
19454+
<Val><![CDATA[tsconfig.json is present but will not be loaded if files are specified on commandline. Use '--ignoreConfig' to skip this error.]]></Val>
19455+
<Tgt Cat="Text" Stat="Loc" Orig="New">
19456+
<Val><![CDATA[存在 tsconfig.json,但如果命令行指定了文件,则不会加载该文件。使用 "--ignoreConfig" 跳过此错误。]]></Val>
19457+
</Tgt>
19458+
</Str>
19459+
<Disp Icon="Str" />
19460+
</Item>
1943419461
<Item ItemId=";type_Colon_6902" ItemType="0" PsrId="306" Leaf="true">
1943519462
<Str Cat="Text">
1943619463
<Val><![CDATA[type:]]></Val>
@@ -19494,6 +19521,15 @@
1949419521
</Str>
1949519522
<Disp Icon="Str" />
1949619523
</Item>
19524+
<Item ItemId=";using_declarations_are_not_allowed_in_case_or_default_clauses_unless_contained_within_a_block_1547" ItemType="0" PsrId="306" Leaf="true">
19525+
<Str Cat="Text">
19526+
<Val><![CDATA['using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block.]]></Val>
19527+
<Tgt Cat="Text" Stat="Loc" Orig="New">
19528+
<Val><![CDATA[除非包含在块中,否则不允许在 "case" 或 "default" 子句中使用 "using" 声明。]]></Val>
19529+
</Tgt>
19530+
</Str>
19531+
<Disp Icon="Str" />
19532+
</Item>
1949719533
<Item ItemId=";with_statements_are_not_allowed_in_an_async_function_block_1300" ItemType="0" PsrId="306" Leaf="true">
1949819534
<Str Cat="Text">
1949919535
<Val><![CDATA['with' statements are not allowed in an async function block.]]></Val>

src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8199,6 +8199,15 @@
81998199
</Str>
82008200
<Disp Icon="Str" />
82018201
</Item>
8202+
<Item ItemId=";Ignore_the_tsconfig_found_and_build_with_commandline_options_and_files_1549" ItemType="0" PsrId="306" Leaf="true">
8203+
<Str Cat="Text">
8204+
<Val><![CDATA[Ignore the tsconfig found and build with commandline options and files.]]></Val>
8205+
<Tgt Cat="Text" Stat="Loc" Orig="New">
8206+
<Val><![CDATA[Ignorujte nalezenou konfiguraci tsconfig a sestavte pomocí možností příkazového řádku a souborů.]]></Val>
8207+
</Tgt>
8208+
</Str>
8209+
<Disp Icon="Str" />
8210+
</Item>
82028211
<Item ItemId=";Ignore_this_error_message_90019" ItemType="0" PsrId="306" Leaf="true">
82038212
<Str Cat="Text">
82048213
<Val><![CDATA[Ignore this error message]]></Val>
@@ -18639,6 +18648,15 @@
1863918648
</Str>
1864018649
<Disp Icon="Str" />
1864118650
</Item>
18651+
<Item ItemId=";await_using_declarations_are_not_allowed_in_case_or_default_clauses_unless_contained_within_a_block_1548" ItemType="0" PsrId="306" Leaf="true">
18652+
<Str Cat="Text">
18653+
<Val><![CDATA['await using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block.]]></Val>
18654+
<Tgt Cat="Text" Stat="Loc" Orig="New">
18655+
<Val><![CDATA[Deklarace await using nejsou povoleny v klauzulích case ani default, pokud nejsou obsaženy v bloku.]]></Val>
18656+
</Tgt>
18657+
</Str>
18658+
<Disp Icon="Str" />
18659+
</Item>
1864218660
<Item ItemId=";await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_th_2853" ItemType="0" PsrId="306" Leaf="true">
1864318661
<Str Cat="Text">
1864418662
<Val><![CDATA['await using' statements are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module.]]></Val>
@@ -19440,6 +19458,15 @@
1944019458
</Str>
1944119459
<Disp Icon="Str" />
1944219460
</Item>
19461+
<Item ItemId=";tsconfig_json_is_present_but_will_not_be_loaded_if_files_are_specified_on_commandline_Use_ignoreConf_5112" ItemType="0" PsrId="306" Leaf="true">
19462+
<Str Cat="Text">
19463+
<Val><![CDATA[tsconfig.json is present but will not be loaded if files are specified on commandline. Use '--ignoreConfig' to skip this error.]]></Val>
19464+
<Tgt Cat="Text" Stat="Loc" Orig="New">
19465+
<Val><![CDATA[tsconfig.json je k dispozici, ale nebude načten, pokud jsou soubory zadány v příkazovém řádku. K přeskočení této chyby použijte --ignoreConfig.]]></Val>
19466+
</Tgt>
19467+
</Str>
19468+
<Disp Icon="Str" />
19469+
</Item>
1944319470
<Item ItemId=";type_Colon_6902" ItemType="0" PsrId="306" Leaf="true">
1944419471
<Str Cat="Text">
1944519472
<Val><![CDATA[type:]]></Val>
@@ -19503,6 +19530,15 @@
1950319530
</Str>
1950419531
<Disp Icon="Str" />
1950519532
</Item>
19533+
<Item ItemId=";using_declarations_are_not_allowed_in_case_or_default_clauses_unless_contained_within_a_block_1547" ItemType="0" PsrId="306" Leaf="true">
19534+
<Str Cat="Text">
19535+
<Val><![CDATA['using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block.]]></Val>
19536+
<Tgt Cat="Text" Stat="Loc" Orig="New">
19537+
<Val><![CDATA[Deklarace using nejsou povoleny v klauzulích case ani default, pokud nejsou obsaženy v bloku.]]></Val>
19538+
</Tgt>
19539+
</Str>
19540+
<Disp Icon="Str" />
19541+
</Item>
1950619542
<Item ItemId=";with_statements_are_not_allowed_in_an_async_function_block_1300" ItemType="0" PsrId="306" Leaf="true">
1950719543
<Str Cat="Text">
1950819544
<Val><![CDATA['with' statements are not allowed in an async function block.]]></Val>

src/loc/lcl/esn/diagnosticMessages/diagnosticMessages.generated.json.lcl

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8202,6 +8202,15 @@
82028202
</Str>
82038203
<Disp Icon="Str" />
82048204
</Item>
8205+
<Item ItemId=";Ignore_the_tsconfig_found_and_build_with_commandline_options_and_files_1549" ItemType="0" PsrId="306" Leaf="true">
8206+
<Str Cat="Text">
8207+
<Val><![CDATA[Ignore the tsconfig found and build with commandline options and files.]]></Val>
8208+
<Tgt Cat="Text" Stat="Loc" Orig="New">
8209+
<Val><![CDATA[Omita la configuración tsconfig encontrada y compile con archivos y opciones de línea de comandos.]]></Val>
8210+
</Tgt>
8211+
</Str>
8212+
<Disp Icon="Str" />
8213+
</Item>
82058214
<Item ItemId=";Ignore_this_error_message_90019" ItemType="0" PsrId="306" Leaf="true">
82068215
<Str Cat="Text">
82078216
<Val><![CDATA[Ignore this error message]]></Val>
@@ -18642,6 +18651,15 @@
1864218651
</Str>
1864318652
<Disp Icon="Str" />
1864418653
</Item>
18654+
<Item ItemId=";await_using_declarations_are_not_allowed_in_case_or_default_clauses_unless_contained_within_a_block_1548" ItemType="0" PsrId="306" Leaf="true">
18655+
<Str Cat="Text">
18656+
<Val><![CDATA['await using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block.]]></Val>
18657+
<Tgt Cat="Text" Stat="Loc" Orig="New">
18658+
<Val><![CDATA[Las declaraciones "await using" no se permiten en las cláusulas "case" o "default", a menos que estén contenidas en un bloque.]]></Val>
18659+
</Tgt>
18660+
</Str>
18661+
<Disp Icon="Str" />
18662+
</Item>
1864518663
<Item ItemId=";await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_th_2853" ItemType="0" PsrId="306" Leaf="true">
1864618664
<Str Cat="Text">
1864718665
<Val><![CDATA['await using' statements are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module.]]></Val>
@@ -19443,6 +19461,15 @@
1944319461
</Str>
1944419462
<Disp Icon="Str" />
1944519463
</Item>
19464+
<Item ItemId=";tsconfig_json_is_present_but_will_not_be_loaded_if_files_are_specified_on_commandline_Use_ignoreConf_5112" ItemType="0" PsrId="306" Leaf="true">
19465+
<Str Cat="Text">
19466+
<Val><![CDATA[tsconfig.json is present but will not be loaded if files are specified on commandline. Use '--ignoreConfig' to skip this error.]]></Val>
19467+
<Tgt Cat="Text" Stat="Loc" Orig="New">
19468+
<Val><![CDATA[tsconfig.json está presente, pero no se cargará si se especifican archivos en la línea de comandos. Use '--ignoreConfig' para omitir este error.]]></Val>
19469+
</Tgt>
19470+
</Str>
19471+
<Disp Icon="Str" />
19472+
</Item>
1944619473
<Item ItemId=";type_Colon_6902" ItemType="0" PsrId="306" Leaf="true">
1944719474
<Str Cat="Text">
1944819475
<Val><![CDATA[type:]]></Val>
@@ -19506,6 +19533,15 @@
1950619533
</Str>
1950719534
<Disp Icon="Str" />
1950819535
</Item>
19536+
<Item ItemId=";using_declarations_are_not_allowed_in_case_or_default_clauses_unless_contained_within_a_block_1547" ItemType="0" PsrId="306" Leaf="true">
19537+
<Str Cat="Text">
19538+
<Val><![CDATA['using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block.]]></Val>
19539+
<Tgt Cat="Text" Stat="Loc" Orig="New">
19540+
<Val><![CDATA[Las declaraciones "using" no se permiten en las cláusulas "case" o "default", a menos que estén contenidas en un bloque.]]></Val>
19541+
</Tgt>
19542+
</Str>
19543+
<Disp Icon="Str" />
19544+
</Item>
1950919545
<Item ItemId=";with_statements_are_not_allowed_in_an_async_function_block_1300" ItemType="0" PsrId="306" Leaf="true">
1951019546
<Str Cat="Text">
1951119547
<Val><![CDATA['with' statements are not allowed in an async function block.]]></Val>

src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8202,6 +8202,15 @@
82028202
</Str>
82038203
<Disp Icon="Str" />
82048204
</Item>
8205+
<Item ItemId=";Ignore_the_tsconfig_found_and_build_with_commandline_options_and_files_1549" ItemType="0" PsrId="306" Leaf="true">
8206+
<Str Cat="Text">
8207+
<Val><![CDATA[Ignore the tsconfig found and build with commandline options and files.]]></Val>
8208+
<Tgt Cat="Text" Stat="Loc" Orig="New">
8209+
<Val><![CDATA[Ignorez le fichier tsconfig trouvé et compilez avec les options et fichiers spécifiés en ligne de commande.]]></Val>
8210+
</Tgt>
8211+
</Str>
8212+
<Disp Icon="Str" />
8213+
</Item>
82058214
<Item ItemId=";Ignore_this_error_message_90019" ItemType="0" PsrId="306" Leaf="true">
82068215
<Str Cat="Text">
82078216
<Val><![CDATA[Ignore this error message]]></Val>
@@ -18642,6 +18651,15 @@
1864218651
</Str>
1864318652
<Disp Icon="Str" />
1864418653
</Item>
18654+
<Item ItemId=";await_using_declarations_are_not_allowed_in_case_or_default_clauses_unless_contained_within_a_block_1548" ItemType="0" PsrId="306" Leaf="true">
18655+
<Str Cat="Text">
18656+
<Val><![CDATA['await using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block.]]></Val>
18657+
<Tgt Cat="Text" Stat="Loc" Orig="New">
18658+
<Val><![CDATA[Les déclarations 'await using' ne sont pas autorisées dans les clauses 'case' ou 'default', sauf si elles sont contenues dans un bloc.]]></Val>
18659+
</Tgt>
18660+
</Str>
18661+
<Disp Icon="Str" />
18662+
</Item>
1864518663
<Item ItemId=";await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_th_2853" ItemType="0" PsrId="306" Leaf="true">
1864618664
<Str Cat="Text">
1864718665
<Val><![CDATA['await using' statements are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module.]]></Val>
@@ -19443,6 +19461,15 @@
1944319461
</Str>
1944419462
<Disp Icon="Str" />
1944519463
</Item>
19464+
<Item ItemId=";tsconfig_json_is_present_but_will_not_be_loaded_if_files_are_specified_on_commandline_Use_ignoreConf_5112" ItemType="0" PsrId="306" Leaf="true">
19465+
<Str Cat="Text">
19466+
<Val><![CDATA[tsconfig.json is present but will not be loaded if files are specified on commandline. Use '--ignoreConfig' to skip this error.]]></Val>
19467+
<Tgt Cat="Text" Stat="Loc" Orig="New">
19468+
<Val><![CDATA[Le fichier tsconfig.json est présent mais ne sera pas chargé si des fichiers sont spécifiés en ligne de commande. Utilisez '--ignoreConfig' pour ignorer cette erreur.]]></Val>
19469+
</Tgt>
19470+
</Str>
19471+
<Disp Icon="Str" />
19472+
</Item>
1944619473
<Item ItemId=";type_Colon_6902" ItemType="0" PsrId="306" Leaf="true">
1944719474
<Str Cat="Text">
1944819475
<Val><![CDATA[type:]]></Val>
@@ -19506,6 +19533,15 @@
1950619533
</Str>
1950719534
<Disp Icon="Str" />
1950819535
</Item>
19536+
<Item ItemId=";using_declarations_are_not_allowed_in_case_or_default_clauses_unless_contained_within_a_block_1547" ItemType="0" PsrId="306" Leaf="true">
19537+
<Str Cat="Text">
19538+
<Val><![CDATA['using' declarations are not allowed in 'case' or 'default' clauses unless contained within a block.]]></Val>
19539+
<Tgt Cat="Text" Stat="Loc" Orig="New">
19540+
<Val><![CDATA[Les déclarations 'using' ne sont pas autorisées dans les clauses 'case' ou 'default' sauf si elles sont incluses dans un bloc.]]></Val>
19541+
</Tgt>
19542+
</Str>
19543+
<Disp Icon="Str" />
19544+
</Item>
1950919545
<Item ItemId=";with_statements_are_not_allowed_in_an_async_function_block_1300" ItemType="0" PsrId="306" Leaf="true">
1951019546
<Str Cat="Text">
1951119547
<Val><![CDATA['with' statements are not allowed in an async function block.]]></Val>

0 commit comments

Comments
 (0)