Skip to content

Commit 2212f47

Browse files
committed
Add regression test
1 parent 5270b49 commit 2212f47

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

tests/cases/conformance/types/mapped/recursiveMappedTypes.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,21 @@ type Remap2<T> = T extends object ? { [P in keyof T]: Remap2<T[P]>; } : T;
6161

6262
type a = Remap1<string[]>; // string[]
6363
type b = Remap2<string[]>; // string[]
64+
65+
// Repro from #29992
66+
67+
type NonOptionalKeys<T> = { [P in keyof T]: undefined extends T[P] ? never : P }[keyof T];
68+
type Child<T> = { [P in NonOptionalKeys<T>]: T[P] }
69+
70+
export interface ListWidget {
71+
"type": "list",
72+
"minimum_count": number,
73+
"maximum_count": number,
74+
"collapsable"?: boolean, //default to false, means all expanded
75+
"each": Child<ListWidget>;
76+
}
77+
78+
type ListChild = Child<ListWidget>
79+
80+
declare let x: ListChild;
81+
x.type;

0 commit comments

Comments
 (0)