Skip to content

Commit 59355cb

Browse files
committed
Add regression tests
1 parent 1de8c65 commit 59355cb

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// @strict: true
2+
3+
// Repros from #23800
4+
5+
type A<T, V> = { [P in keyof T]: T[P] extends V ? 1 : 0; };
6+
type B<T, V> = { [P in keyof T]: T[P] extends V | object ? 1 : 0; };
7+
8+
type a = A<{ a: 0 | 1 }, 0>; // { a: 0; }
9+
type b = B<{ a: 0 | 1 }, 0>; // { a: 0; }
10+
11+
function foo<T, U>(x: T) {
12+
let a: object = x; // Error
13+
let b: U | object = x; // Error
14+
}

0 commit comments

Comments
 (0)