mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-07 23:08:20 -06:00
Add regression test
This commit is contained in:
parent
052680d4ea
commit
c4e21c912e
@ -341,3 +341,15 @@ declare interface ExtractFooBar<FB extends FooBar> { }
|
||||
type Extracted<Struct> = {
|
||||
[K in keyof Struct]: Struct[K] extends FooBar ? ExtractFooBar<Struct[K]> : Struct[K];
|
||||
}
|
||||
|
||||
// Repro from #22985
|
||||
|
||||
type RecursivePartial<T> = {
|
||||
[P in keyof T]?: T[P] extends Array<any> ? {[index: number]: RecursivePartial<T[P][0]>} :
|
||||
T[P] extends object ? RecursivePartial<T[P]> : T[P];
|
||||
};
|
||||
|
||||
declare function assign<T>(o: T, a: RecursivePartial<T>): void;
|
||||
|
||||
var a = {o: 1, b: 2, c: [{a: 1, c: '213'}]}
|
||||
assign(a, {o: 2, c: {0: {a: 2, c: '213123'}}})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user