mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Add regression test
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user