Skip to content

Commit ec02ccd

Browse files
committed
Add regression test
1 parent d093d6a commit ec02ccd

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/cases/conformance/types/conditional/conditionalTypes2.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,18 @@ function foo<T>(value: T) {
121121
toString2(value);
122122
}
123123
}
124+
125+
// Repro from #23052
126+
127+
type A<T, V, E> =
128+
T extends object
129+
? { [Q in { [P in keyof T]: T[P] extends V ? P : P; }[keyof T]]: A<T[Q], V, E>; }
130+
: T extends V ? T : never;
131+
132+
type B<T, V> =
133+
T extends object
134+
? { [Q in { [P in keyof T]: T[P] extends V ? P : P; }[keyof T]]: B<T[Q], V>; }
135+
: T extends V ? T : never;
136+
137+
type C<T, V, E> =
138+
{ [Q in { [P in keyof T]: T[P] extends V ? P : P; }[keyof T]]: C<T[Q], V, E>; };

0 commit comments

Comments
 (0)