Add regression test

This commit is contained in:
Anders Hejlsberg 2017-12-01 16:54:32 -08:00
parent 5465a5aa72
commit 3531bd2b57

View file

@ -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
}