Add regression test

This commit is contained in:
Anders Hejlsberg
2019-02-26 12:44:12 -08:00
parent 5270b49bcc
commit 2212f4777a
@@ -61,3 +61,21 @@ type Remap2<T> = T extends object ? { [P in keyof T]: Remap2<T[P]>; } : T;
type a = Remap1<string[]>; // string[]
type b = Remap2<string[]>; // string[]
// Repro from #29992
type NonOptionalKeys<T> = { [P in keyof T]: undefined extends T[P] ? never : P }[keyof T];
type Child<T> = { [P in NonOptionalKeys<T>]: T[P] }
export interface ListWidget {
"type": "list",
"minimum_count": number,
"maximum_count": number,
"collapsable"?: boolean, //default to false, means all expanded
"each": Child<ListWidget>;
}
type ListChild = Child<ListWidget>
declare let x: ListChild;
x.type;