1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
//// [stringLiteralTypesOverloadAssignability02.ts]
function f(x: "foo"): number;
function f(x: "foo"): number {
return 0;
}
function g(x: "bar"): number;
function g(x: "bar"): number {
return 0;
}
let a = f;
let b = g;
a = b;
b = a;
//// [stringLiteralTypesOverloadAssignability02.js]
function f(x) {
return 0;
}
function g(x) {
return 0;
}
var a = f;
var b = g;
a = b;
b = a;
//// [stringLiteralTypesOverloadAssignability02.d.ts]
declare function f(x: "foo"): number;
declare function g(x: "bar"): number;
declare let a: typeof f;
declare let b: typeof g;
|