Check that test cases produce expected types

This commit is contained in:
Anders Hejlsberg
2018-05-01 13:05:49 -07:00
parent ce2dea98ca
commit 4c933aef9a
@@ -5,8 +5,8 @@
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: 0; }
let a: A<{ a: 0 | 1 }, 0> = { a: 0 };
let b: B<{ a: 0 | 1 }, 0> = { a: 0 };
function foo<T, U>(x: T) {
let a: object = x; // Error