2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/functionOverloads28.ts ===
|
|
|
|
function foo():string;
|
2015-04-13 23:01:57 +02:00
|
|
|
>foo : { (): string; (bar: string): number; }, Symbol(foo, Decl(functionOverloads28.ts, 0, 0), Decl(functionOverloads28.ts, 0, 22), Decl(functionOverloads28.ts, 1, 32))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
function foo(bar:string):number;
|
2015-04-13 23:01:57 +02:00
|
|
|
>foo : { (): string; (bar: string): number; }, Symbol(foo, Decl(functionOverloads28.ts, 0, 0), Decl(functionOverloads28.ts, 0, 22), Decl(functionOverloads28.ts, 1, 32))
|
|
|
|
>bar : string, Symbol(bar, Decl(functionOverloads28.ts, 1, 13))
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
function foo(bar?:any):any{ return '' }
|
2015-04-13 23:01:57 +02:00
|
|
|
>foo : { (): string; (bar: string): number; }, Symbol(foo, Decl(functionOverloads28.ts, 0, 0), Decl(functionOverloads28.ts, 0, 22), Decl(functionOverloads28.ts, 1, 32))
|
|
|
|
>bar : any, Symbol(bar, Decl(functionOverloads28.ts, 2, 13))
|
2015-04-13 21:36:11 +02:00
|
|
|
>'' : string
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var t:any; var x = foo(t);
|
2015-04-13 23:01:57 +02:00
|
|
|
>t : any, Symbol(t, Decl(functionOverloads28.ts, 3, 3))
|
|
|
|
>x : number, Symbol(x, Decl(functionOverloads28.ts, 3, 14))
|
2014-08-15 23:33:16 +02:00
|
|
|
>foo(t) : number
|
2015-04-13 23:01:57 +02:00
|
|
|
>foo : { (): string; (bar: string): number; }, Symbol(foo, Decl(functionOverloads28.ts, 0, 0), Decl(functionOverloads28.ts, 0, 22), Decl(functionOverloads28.ts, 1, 32))
|
|
|
|
>t : any, Symbol(t, Decl(functionOverloads28.ts, 3, 3))
|
2014-08-15 23:33:16 +02:00
|
|
|
|