mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Check that test cases produce expected types
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user