Add regression tests

This commit is contained in:
Anders Hejlsberg
2018-05-01 12:44:46 -07:00
parent 1de8c65678
commit 59355cbfdb
@@ -0,0 +1,14 @@
// @strict: true
// Repros from #23800
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; }
function foo<T, U>(x: T) {
let a: object = x; // Error
let b: U | object = x; // Error
}