Closed
Description
cc @ahejlsberg
TypeScript Version: 2.9.0-dev.20180501
Search Terms:
Code
type A<T, V> = { [P in keyof T]: T[P] extends V ? 1 : 0; };
type B<T, V> = { [P in keyof T]: T[P] extends V | object ? 1 : 0; };
type a = A<{ a: 0 | 1 }, 0>; // { a: 0; }
type b = B<{ a: 0 | 1 }, 0>; // { a: 1; }
Expected behavior:
type b = B<{ a: 0 | 1 }, 0>; // { a: 0; }
Actual behavior:
type b = B<{ a: 0 | 1 }, 0>; // { a: 1; }
Playground Link:
Related Issues: