2014-07-13 01:04:16 +02:00
|
|
|
//// [functionOverloads40.ts]
|
|
|
|
function foo(bar:{a:number;}[]):string;
|
|
|
|
function foo(bar:{a:boolean;}[]):number;
|
|
|
|
function foo(bar:{a:any;}[]):any{ return bar }
|
|
|
|
var x = foo([{a:'bar'}]);
|
|
|
|
|
|
|
|
|
|
|
|
//// [functionOverloads40.js]
|
2015-03-09 02:23:23 +01:00
|
|
|
function foo(bar) {
|
|
|
|
return bar;
|
|
|
|
}
|
|
|
|
var x = foo([
|
|
|
|
{
|
|
|
|
a: 'bar'
|
|
|
|
}
|
|
|
|
]);
|