25 lines
520 B
Text
25 lines
520 B
Text
=== tests/cases/compiler/functionOverloads42.ts ===
|
|
function foo(bar:{a:number;}[]):string;
|
|
>foo : typeof foo
|
|
>bar : { a: number; }[]
|
|
>a : number
|
|
|
|
function foo(bar:{a:any;}[]):number;
|
|
>foo : typeof foo
|
|
>bar : { a: any; }[]
|
|
>a : any
|
|
|
|
function foo(bar:{a:any;}[]):any{ return bar }
|
|
>foo : typeof foo
|
|
>bar : { a: any; }[]
|
|
>a : any
|
|
>bar : { a: any; }[]
|
|
|
|
var x = foo([{a:'s'}]);
|
|
>x : number
|
|
>foo([{a:'s'}]) : number
|
|
>foo : typeof foo
|
|
>[{a:'s'}] : { a: any; }[]
|
|
>{a:'s'} : { a: string; }
|
|
>a : string
|
|
|