80 lines
2.1 KiB
Text
80 lines
2.1 KiB
Text
=== tests/cases/compiler/returnTypeParameterWithModules.ts ===
|
|
module M1 {
|
|
>M1 : typeof M1
|
|
|
|
export function reduce<A>(ar, f, e?): Array<A> {
|
|
>reduce : <A>(ar: any, f: any, e?: any) => A[]
|
|
>A : A
|
|
>ar : any
|
|
>f : any
|
|
>e : any
|
|
>Array : T[]
|
|
>A : A
|
|
|
|
return Array.prototype.reduce.apply(ar, e ? [f, e] : [f]);
|
|
>Array.prototype.reduce.apply(ar, e ? [f, e] : [f]) : any
|
|
>Array.prototype.reduce.apply : (thisArg: any, argArray?: any) => any
|
|
>Array.prototype.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; <U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; }
|
|
>Array.prototype : any[]
|
|
>Array : ArrayConstructor
|
|
>prototype : any[]
|
|
>reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; <U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; }
|
|
>apply : (thisArg: any, argArray?: any) => any
|
|
>ar : any
|
|
>e ? [f, e] : [f] : any[]
|
|
>e : any
|
|
>[f, e] : any[]
|
|
>f : any
|
|
>e : any
|
|
>[f] : any[]
|
|
>f : any
|
|
|
|
};
|
|
};
|
|
module M2 {
|
|
>M2 : typeof M2
|
|
|
|
import A = M1
|
|
>A : typeof A
|
|
>M1 : typeof A
|
|
|
|
export function compose() {
|
|
>compose : () => void
|
|
|
|
A.reduce(arguments, compose2);
|
|
>A.reduce(arguments, compose2) : {}[]
|
|
>A.reduce : <A>(ar: any, f: any, e?: any) => A[]
|
|
>A : typeof A
|
|
>reduce : <A>(ar: any, f: any, e?: any) => A[]
|
|
>arguments : IArguments
|
|
>compose2 : <B, C, D>(g: (x: B) => C, f: (x: D) => B) => (x: D) => C
|
|
|
|
};
|
|
export function compose2<B, C, D>(g: (x: B) => C, f: (x: D) => B): (x: D) => C {
|
|
>compose2 : <B, C, D>(g: (x: B) => C, f: (x: D) => B) => (x: D) => C
|
|
>B : B
|
|
>C : C
|
|
>D : D
|
|
>g : (x: B) => C
|
|
>x : B
|
|
>B : B
|
|
>C : C
|
|
>f : (x: D) => B
|
|
>x : D
|
|
>D : D
|
|
>B : B
|
|
>x : D
|
|
>D : D
|
|
>C : C
|
|
|
|
return function (x) { return g(f(x)); }
|
|
>function (x) { return g(f(x)); } : (x: D) => C
|
|
>x : D
|
|
>g(f(x)) : C
|
|
>g : (x: B) => C
|
|
>f(x) : B
|
|
>f : (x: D) => B
|
|
>x : D
|
|
|
|
};
|
|
};
|