From 94e0df39cc685d3b680255320d5b3e08f0400cf2 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 7 Feb 2018 14:55:04 -0800 Subject: [PATCH] Add regression test --- tests/cases/conformance/types/conditional/inferTypes1.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/cases/conformance/types/conditional/inferTypes1.ts b/tests/cases/conformance/types/conditional/inferTypes1.ts index 08c7be5288e..99cfa8a2460 100644 --- a/tests/cases/conformance/types/conditional/inferTypes1.ts +++ b/tests/cases/conformance/types/conditional/inferTypes1.ts @@ -127,3 +127,8 @@ type B1 = S extends A1 ? [T, U] : never; type A2 = [T, U]; type B2 = S extends A2 ? [T, U] : never; type C2 = S extends A2 ? [T, U] : never; + +// Repro from #21735 + +type A = T extends string ? { [P in T]: void; } : T; +type B = string extends T ? { [P in T]: void; } : T; // Error