mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-06 23:59:42 -05:00
Add regression test
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user