Skip to content

Commit ab797df

Browse files
committed
Add regression test
1 parent 93c0f0c commit ab797df

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// @strict: true
2+
3+
// Repro from #29067
4+
5+
function test<T extends { a: string }>(obj: T) {
6+
let { a, ...rest } = obj;
7+
return { ...rest, b: a };
8+
}
9+
10+
let o1 = { a: 'hello', x: 42 };
11+
let o2: { b: string, x: number } = test(o1);

0 commit comments

Comments
 (0)