2014-07-13 01:04:16 +02:00
|
|
|
//// [functionOverloadAmbiguity1.ts]
|
|
|
|
function callb(lam: (l: number) => void );
|
|
|
|
function callb(lam: (n: string) => void );
|
|
|
|
function callb(a) { }
|
|
|
|
callb((a) => { a.length; } ); // error, chose first overload
|
|
|
|
|
|
|
|
function callb2(lam: (n: string) => void );
|
|
|
|
function callb2(lam: (l: number) => void );
|
|
|
|
function callb2(a) { }
|
|
|
|
callb2((a) => { a.length; } ); // ok, chose first overload
|
|
|
|
|
|
|
|
|
|
|
|
//// [functionOverloadAmbiguity1.js]
|
|
|
|
function callb(a) {
|
|
|
|
}
|
|
|
|
callb(function (a) {
|
|
|
|
a.length;
|
2014-08-16 00:49:09 +02:00
|
|
|
}); // error, chose first overload
|
2014-07-13 01:04:16 +02:00
|
|
|
function callb2(a) {
|
|
|
|
}
|
|
|
|
callb2(function (a) {
|
|
|
|
a.length;
|
2014-08-16 00:49:09 +02:00
|
|
|
}); // ok, chose first overload
|