From 2e1dcd666c790347b02d0af46e4e928c7d45fdf7 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 10 Feb 2018 17:10:44 -0800 Subject: [PATCH] Add regression test --- .../types/conditional/conditionalTypes1.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/cases/conformance/types/conditional/conditionalTypes1.ts b/tests/cases/conformance/types/conditional/conditionalTypes1.ts index 3a6dab9a612..a0776ef2e0e 100644 --- a/tests/cases/conformance/types/conditional/conditionalTypes1.ts +++ b/tests/cases/conformance/types/conditional/conditionalTypes1.ts @@ -252,3 +252,14 @@ function f33() { var z: T1; var z: T2; } + +// Repro from #21863 + +function f40() { + type Eq = T extends U ? U extends T ? true : false : false; + type If = S extends false ? U : T; + type Omit = { [P in keyof T]: If, never, P>; }[keyof T]; + type Omit2 = { [P in keyof T]: If, never, P>; }[keyof T]; + type A = Omit<{ a: void; b: never; }>; // 'a' + type B = Omit2<{ a: void; b: never; }>; // 'a' +}