From cdf155e98053c6bd550dd076a428c1f57c367ef4 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 3 Apr 2018 09:04:36 -0700 Subject: [PATCH] Add regression test --- .../types/conditional/conditionalTypes2.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/cases/conformance/types/conditional/conditionalTypes2.ts b/tests/cases/conformance/types/conditional/conditionalTypes2.ts index 4002ab6a0a7..be758945469 100644 --- a/tests/cases/conformance/types/conditional/conditionalTypes2.ts +++ b/tests/cases/conformance/types/conditional/conditionalTypes2.ts @@ -136,3 +136,14 @@ type B = type C = { [Q in { [P in keyof T]: T[P] extends V ? P : P; }[keyof T]]: C; }; + +// Repro from #23100 + +type A2 = + T extends object ? T extends any[] ? T : { [Q in keyof T]: A2; } : T; + +type B2 = + T extends object ? T extends any[] ? T : { [Q in keyof T]: B2; } : T; + +type C2 = + T extends object ? { [Q in keyof T]: C2; } : T;