mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 02:33:53 -06:00
Add regression test
This commit is contained in:
parent
5465a5aa72
commit
3531bd2b57
@ -0,0 +1,22 @@
|
||||
// @strict: true
|
||||
|
||||
// Repro from #20196
|
||||
|
||||
type A = {
|
||||
a: (x: number) => string
|
||||
};
|
||||
type B = {
|
||||
a: (x: boolean) => string
|
||||
};
|
||||
|
||||
function call0(p: A | B) {
|
||||
p.a("s"); // Error
|
||||
}
|
||||
|
||||
function callN<T extends A | B>(p: T) {
|
||||
p.a("s"); // Error
|
||||
|
||||
var a: T["a"] = p.a;
|
||||
a(""); // Error
|
||||
a("", "", "", ""); // Error
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user