2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/targetTypeTest2.ts ===
|
|
|
|
// Test target typing for array literals and call expressions
|
|
|
|
|
|
|
|
|
|
|
|
var a : any[] = [1,2,"3"];
|
|
|
|
>a : any[]
|
2014-10-18 01:53:18 +02:00
|
|
|
>[1,2,"3"] : (string | number)[]
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
function func1(stuff:any[]) { return stuff; }
|
|
|
|
>func1 : (stuff: any[]) => any[]
|
|
|
|
>stuff : any[]
|
|
|
|
>stuff : any[]
|
|
|
|
|
|
|
|
function func2(stuff1:string, stuff2:number, stuff3:number) {
|
|
|
|
>func2 : (stuff1: string, stuff2: number, stuff3: number) => any[]
|
|
|
|
>stuff1 : string
|
|
|
|
>stuff2 : number
|
|
|
|
>stuff3 : number
|
|
|
|
|
|
|
|
return func1([stuff1, stuff2, stuff3]);
|
|
|
|
>func1([stuff1, stuff2, stuff3]) : any[]
|
|
|
|
>func1 : (stuff: any[]) => any[]
|
2014-10-18 01:53:18 +02:00
|
|
|
>[stuff1, stuff2, stuff3] : (string | number)[]
|
2014-08-15 23:33:16 +02:00
|
|
|
>stuff1 : string
|
|
|
|
>stuff2 : number
|
|
|
|
>stuff3 : number
|
|
|
|
}
|