Skip to content

Commit 519c501

Browse files
committed
Add regression test
1 parent 6749141 commit 519c501

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/cases/conformance/types/literal/literalTypeWidening.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,10 @@ export type LangCode = keyof typeof langCodeSet
127127
export const langCodes = keys(langCodeSet)
128128

129129
const arr: Obj[] = langCodes.map(code => ({ code }))
130+
131+
// Repro from #29081
132+
133+
function test<T extends { a: string, b: string }>(obj: T): T {
134+
let { a, ...rest } = obj;
135+
return { a: 'hello', ...rest } as T;
136+
}

0 commit comments

Comments
 (0)