Cherry-pick PR #47909 into release-4.6 (#47912)

Component commits:
f4a5562543 wip: possible fixes

75cb7392f3 pass parameter type to assignBindingElementTypes

4a7de63c83 undo unnecessary changes

b618cf9371 update baselines

Co-authored-by: Gabriela Araujo Britto <gabrielaa@microsoft.com>
This commit is contained in:
TypeScript Bot
2022-02-16 09:05:17 -08:00
committed by GitHub
co-authored by Gabriela Araujo Britto
parent 83efc9f0d6
commit b6ec37aac2
5 changed files with 138 additions and 4 deletions
@@ -0,0 +1,13 @@
interface Slugs {
foo: string;
bar: string;
}
function call<T extends object>(obj: T, cb: (val: T) => void) {
cb(obj);
}
declare let obj: Slugs;
call(obj, ({foo, ...rest}) => {
console.log(rest.bar);
});