mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-26 00:36:29 -05:00
Fixed a false positive related to binding patterns and spread expressions (#49684)
* Fixed a false positive related to binding patterns and spread expressions
* Improve ancestor lookup when checking if an expression is spread into an object
* Fixed ancestor lookup for more node types
* Remove equality check for contextual types
* Reformat code
* Use `isWithinSpreadAssignment` flag + `objectsWithinSpread` cache instead of ancestor traversal
* Revert "Use `isWithinSpreadAssignment` flag + `objectsWithinSpread` cache instead of ancestor traversal"
This reverts commit be387e3bbf.
* Expand on the existing comment
This commit is contained in:
committed by
GitHub
parent
71e8529228
commit
0e17dc7769
@@ -0,0 +1,15 @@
|
||||
// @noEmit: true
|
||||
|
||||
// repro #49585
|
||||
|
||||
const { value } = (() => ({
|
||||
value: "",
|
||||
...(true ? {} : {}),
|
||||
}))();
|
||||
|
||||
// repro 49684#discussion_r920545763
|
||||
|
||||
const { value2 } = {
|
||||
value2: "",
|
||||
...(() => true ? {} : {})(),
|
||||
};
|
||||
Reference in New Issue
Block a user