Skip to content

Commit 3531bd2

Browse files
committed
Add regression test
1 parent 5465a5a commit 3531bd2

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// @strict: true
2+
3+
// Repro from #20196
4+
5+
type A = {
6+
a: (x: number) => string
7+
};
8+
type B = {
9+
a: (x: boolean) => string
10+
};
11+
12+
function call0(p: A | B) {
13+
p.a("s"); // Error
14+
}
15+
16+
function callN<T extends A | B>(p: T) {
17+
p.a("s"); // Error
18+
19+
var a: T["a"] = p.a;
20+
a(""); // Error
21+
a("", "", "", ""); // Error
22+
}

0 commit comments

Comments
 (0)