mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
Add regression test
This commit is contained in:
parent
93c0f0ca0f
commit
ab797df977
11
tests/cases/compiler/genericIsNeverEmptyObject.ts
Normal file
11
tests/cases/compiler/genericIsNeverEmptyObject.ts
Normal 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);
|
||||
Loading…
x
Reference in New Issue
Block a user