Add regression test

This commit is contained in:
Anders Hejlsberg 2018-12-17 14:14:54 -08:00
parent 93c0f0ca0f
commit ab797df977

View File

@ -0,0 +1,11 @@
// @strict: true
// Repro from #29067
function test<T extends { a: string }>(obj: T) {
let { a, ...rest } = obj;
return { ...rest, b: a };
}
let o1 = { a: 'hello', x: 42 };
let o2: { b: string, x: number } = test(o1);