Add regression test

This commit is contained in:
Anders Hejlsberg
2018-12-18 11:58:06 -08:00
parent 67491414f1
commit 519c501ea5

View File

@@ -127,3 +127,10 @@ export type LangCode = keyof typeof langCodeSet
export const langCodes = keys(langCodeSet)
const arr: Obj[] = langCodes.map(code => ({ code }))
// Repro from #29081
function test<T extends { a: string, b: string }>(obj: T): T {
let { a, ...rest } = obj;
return { a: 'hello', ...rest } as T;
}