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]
|
2015-02-07 03:45:09 +01:00
|
|
|
function callb(a) { }
|
2015-02-07 05:03:24 +01:00
|
|
|
callb(function (a) { a.length; }); // error, chose first overload
|
2015-02-07 03:45:09 +01:00
|
|
|
function callb2(a) { }
|
2015-02-07 05:03:24 +01:00
|
|
|
callb2(function (a) { a.length; }); // ok, chose first overload
|