Skip to content

Commit caa89ca

Browse files
committed
Add regression test
1 parent e0082f6 commit caa89ca

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// @strict
2+
3+
// Repro from #29520
4+
5+
type Test<K extends keyof any> = {
6+
[P in K | "foo"]: P extends "foo" ? true : () => any
7+
}
8+
9+
function test<T extends Test<keyof T>>(arg: T) {
10+
return arg;
11+
}
12+
13+
const res1 = test({
14+
foo: true,
15+
bar() {
16+
}
17+
});
18+
19+
const res2 = test({
20+
foo: true,
21+
bar: function () {
22+
}
23+
});
24+
25+
const res3 = test({
26+
foo: true,
27+
bar: () => {
28+
}
29+
});

0 commit comments

Comments
 (0)