TypeScript/tests/baselines/reference/functionOverloads26.types

20 lines
462 B
Plaintext
Raw Normal View History

2014-08-15 23:33:16 +02:00
=== tests/cases/compiler/functionOverloads26.ts ===
function foo():string;
>foo : { (): string; (bar: string): number; }
2014-08-15 23:33:16 +02:00
function foo(bar:string):number;
>foo : { (): string; (bar: string): number; }
>bar : string
2014-08-15 23:33:16 +02:00
function foo(bar?:any):any{ return '' }
>foo : { (): string; (bar: string): number; }
>bar : any
2015-04-13 21:36:11 +02:00
>'' : string
2014-08-15 23:33:16 +02:00
var x = foo('baz');
>x : number
2014-08-15 23:33:16 +02:00
>foo('baz') : number
>foo : { (): string; (bar: string): number; }
2015-04-13 21:36:11 +02:00
>'baz' : string
2014-08-15 23:33:16 +02:00