51 lines
1.1 KiB
Text
51 lines
1.1 KiB
Text
=== tests/cases/compiler/inferentialTypingWithFunctionTypeZip.ts ===
|
|
var pair: <T, S>(x: T) => (y: S) => { x: T; y: S; }
|
|
>pair : <T, S>(x: T) => (y: S) => { x: T; y: S; }
|
|
>T : T
|
|
>S : S
|
|
>x : T
|
|
>T : T
|
|
>y : S
|
|
>S : S
|
|
>x : T
|
|
>T : T
|
|
>y : S
|
|
>S : S
|
|
|
|
var zipWith: <T, S, U>(a: T[], b: S[], f: (x: T) => (y: S) => U) => U[];
|
|
>zipWith : <T, S, U>(a: T[], b: S[], f: (x: T) => (y: S) => U) => U[]
|
|
>T : T
|
|
>S : S
|
|
>U : U
|
|
>a : T[]
|
|
>T : T
|
|
>b : S[]
|
|
>S : S
|
|
>f : (x: T) => (y: S) => U
|
|
>x : T
|
|
>T : T
|
|
>y : S
|
|
>S : S
|
|
>U : U
|
|
>U : U
|
|
|
|
var result = zipWith([1, 2], ['a', 'b'], pair);
|
|
>result : { x: number; y: {}; }[]
|
|
>zipWith([1, 2], ['a', 'b'], pair) : { x: number; y: {}; }[]
|
|
>zipWith : <T, S, U>(a: T[], b: S[], f: (x: T) => (y: S) => U) => U[]
|
|
>[1, 2] : number[]
|
|
>1 : number
|
|
>2 : number
|
|
>['a', 'b'] : string[]
|
|
>'a' : string
|
|
>'b' : string
|
|
>pair : <T, S>(x: T) => (y: S) => { x: T; y: S; }
|
|
|
|
var i = result[0].x; // number
|
|
>i : number
|
|
>result[0].x : number
|
|
>result[0] : { x: number; y: {}; }
|
|
>result : { x: number; y: {}; }[]
|
|
>0 : number
|
|
>x : number
|
|
|