2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/functionOverloads42.ts ===
|
|
|
|
function foo(bar:{a:number;}[]):string;
|
2015-04-13 23:01:57 +02:00
|
|
|
>foo : { (bar: { a: number; }[]): string; (bar: { a: any; }[]): number; }, Symbol(foo, Decl(functionOverloads42.ts, 0, 0), Decl(functionOverloads42.ts, 0, 39), Decl(functionOverloads42.ts, 1, 36))
|
|
|
|
>bar : { a: number; }[], Symbol(bar, Decl(functionOverloads42.ts, 0, 13))
|
|
|
|
>a : number, Symbol(a, Decl(functionOverloads42.ts, 0, 18))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
function foo(bar:{a:any;}[]):number;
|
2015-04-13 23:01:57 +02:00
|
|
|
>foo : { (bar: { a: number; }[]): string; (bar: { a: any; }[]): number; }, Symbol(foo, Decl(functionOverloads42.ts, 0, 0), Decl(functionOverloads42.ts, 0, 39), Decl(functionOverloads42.ts, 1, 36))
|
|
|
|
>bar : { a: any; }[], Symbol(bar, Decl(functionOverloads42.ts, 1, 13))
|
|
|
|
>a : any, Symbol(a, Decl(functionOverloads42.ts, 1, 18))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
function foo(bar:{a:any;}[]):any{ return bar }
|
2015-04-13 23:01:57 +02:00
|
|
|
>foo : { (bar: { a: number; }[]): string; (bar: { a: any; }[]): number; }, Symbol(foo, Decl(functionOverloads42.ts, 0, 0), Decl(functionOverloads42.ts, 0, 39), Decl(functionOverloads42.ts, 1, 36))
|
|
|
|
>bar : { a: any; }[], Symbol(bar, Decl(functionOverloads42.ts, 2, 13))
|
|
|
|
>a : any, Symbol(a, Decl(functionOverloads42.ts, 2, 18))
|
|
|
|
>bar : { a: any; }[], Symbol(bar, Decl(functionOverloads42.ts, 2, 13))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var x = foo([{a:'s'}]);
|
2015-04-13 23:01:57 +02:00
|
|
|
>x : number, Symbol(x, Decl(functionOverloads42.ts, 3, 3))
|
2014-08-15 23:33:16 +02:00
|
|
|
>foo([{a:'s'}]) : number
|
2015-04-13 23:01:57 +02:00
|
|
|
>foo : { (bar: { a: number; }[]): string; (bar: { a: any; }[]): number; }, Symbol(foo, Decl(functionOverloads42.ts, 0, 0), Decl(functionOverloads42.ts, 0, 39), Decl(functionOverloads42.ts, 1, 36))
|
2014-10-13 15:56:58 +02:00
|
|
|
>[{a:'s'}] : { a: string; }[]
|
2014-08-15 23:33:16 +02:00
|
|
|
>{a:'s'} : { a: string; }
|
2015-04-13 23:01:57 +02:00
|
|
|
>a : string, Symbol(a, Decl(functionOverloads42.ts, 3, 14))
|
2015-04-13 21:36:11 +02:00
|
|
|
>'s' : string
|
2014-08-15 23:33:16 +02:00
|
|
|
|