Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/lib/es5.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1273,26 +1273,26 @@ interface ReadonlyArray<T> {
* @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
*/
reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T): T;
reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T, initialValue: T): T;
/**
* Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
* @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
* @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
*/
reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: readonly T[]) => U, initialValue: U): U;
reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T, initialValue: T): T;
/**
* Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
* @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
* @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
*/
reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T): T;
reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T, initialValue: T): T;
/**
* Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
* @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
* @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
*/
reduceRight<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: readonly T[]) => U, initialValue: U): U;
reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T, initialValue: T): T;

readonly [n: number]: T;
}
Expand Down Expand Up @@ -1468,26 +1468,26 @@ interface Array<T> {
* @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
*/
reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;
reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
/**
* Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
* @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
* @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
*/
reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
/**
* Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
* @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
* @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
*/
reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;
reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
/**
* Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
* @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
* @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
*/
reduceRight<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;

[n: number]: T;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ paired.reduce(function (a1, a2) {
>a2 : Symbol(a2, Decl(anyInferenceAnonymousFunctions.ts, 2, 27))

return a1.concat({});
>a1.concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>a1 : Symbol(a1, Decl(anyInferenceAnonymousFunctions.ts, 2, 24))
>concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))

} , []);

Expand All @@ -24,7 +26,9 @@ paired.reduce((b1, b2) => {
>b2 : Symbol(b2, Decl(anyInferenceAnonymousFunctions.ts, 8, 18))

return b1.concat({});
>b1.concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>b1 : Symbol(b1, Decl(anyInferenceAnonymousFunctions.ts, 8, 15))
>concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))

} , []);

Expand All @@ -34,7 +38,9 @@ paired.reduce((b3, b4) => b3.concat({}), []);
>reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>b3 : Symbol(b3, Decl(anyInferenceAnonymousFunctions.ts, 13, 15))
>b4 : Symbol(b4, Decl(anyInferenceAnonymousFunctions.ts, 13, 18))
>b3.concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>b3 : Symbol(b3, Decl(anyInferenceAnonymousFunctions.ts, 13, 15))
>concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))

paired.map((c1) => c1.count);
>paired.map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --))
Expand Down
96 changes: 54 additions & 42 deletions tests/baselines/reference/anyInferenceAnonymousFunctions.types
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,29 @@ var paired: any[];
> : ^^^^^

paired.reduce(function (a1, a2) {
>paired.reduce(function (a1, a2) { return a1.concat({});} , []) : any
>paired.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (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; }
> : ^^^ ^^^ ^^^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^
>paired.reduce(function (a1, a2) { return a1.concat({});} , []) : any[]
> : ^^^^^
>paired.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; <U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; }
> : ^^^ ^^^ ^^^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^ ^^^ ^^^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^
>paired : any[]
> : ^^^^^
>reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (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; }
> : ^^^ ^^^ ^^^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^
>function (a1, a2) { return a1.concat({});} : (a1: any, a2: any) => any
> : ^ ^^^^^^^ ^^^^^^^^^^^^^
>a1 : any
>reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; <U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; }
> : ^^^ ^^^ ^^^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^ ^^^ ^^^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^
>function (a1, a2) { return a1.concat({});} : (a1: any[], a2: any) => any[]
> : ^ ^^^^^^^^^ ^^^^^^^^^^^^^^^
>a1 : any[]
> : ^^^^^
>a2 : any

return a1.concat({});
>a1.concat({}) : any
>a1.concat : any
>a1 : any
> : ^^^
>concat : any
> : ^^^
>a1.concat({}) : any[]
> : ^^^^^
>a1.concat : { (...items: ConcatArray<any>[]): any[]; (...items: any[]): any[]; }
> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^
>a1 : any[]
> : ^^^^^
>concat : { (...items: ConcatArray<any>[]): any[]; (...items: any[]): any[]; }
> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^
>{} : {}
> : ^^

Expand All @@ -33,25 +37,29 @@ paired.reduce(function (a1, a2) {
> : ^^^^^^^^^^^

paired.reduce((b1, b2) => {
>paired.reduce((b1, b2) => { return b1.concat({});} , []) : any
>paired.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (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; }
> : ^^^ ^^^ ^^^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^
>paired.reduce((b1, b2) => { return b1.concat({});} , []) : any[]
> : ^^^^^
>paired.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; <U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; }
> : ^^^ ^^^ ^^^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^ ^^^ ^^^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^
>paired : any[]
> : ^^^^^
>reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (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; }
> : ^^^ ^^^ ^^^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^
>(b1, b2) => { return b1.concat({});} : (b1: any, b2: any) => any
> : ^ ^^^^^^^ ^^^^^^^^^^^^^
>b1 : any
>reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; <U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; }
> : ^^^ ^^^ ^^^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^ ^^^ ^^^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^
>(b1, b2) => { return b1.concat({});} : (b1: any[], b2: any) => any[]
> : ^ ^^^^^^^^^ ^^^^^^^^^^^^^^^
>b1 : any[]
> : ^^^^^
>b2 : any

return b1.concat({});
>b1.concat({}) : any
>b1.concat : any
>b1 : any
> : ^^^
>concat : any
> : ^^^
>b1.concat({}) : any[]
> : ^^^^^
>b1.concat : { (...items: ConcatArray<any>[]): any[]; (...items: any[]): any[]; }
> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^
>b1 : any[]
> : ^^^^^
>concat : { (...items: ConcatArray<any>[]): any[]; (...items: any[]): any[]; }
> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^
>{} : {}
> : ^^

Expand All @@ -60,23 +68,27 @@ paired.reduce((b1, b2) => {
> : ^^^^^^^^^^^

paired.reduce((b3, b4) => b3.concat({}), []);
>paired.reduce((b3, b4) => b3.concat({}), []) : any
>paired.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (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; }
> : ^^^ ^^^ ^^^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^
>paired.reduce((b3, b4) => b3.concat({}), []) : any[]
> : ^^^^^
>paired.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; <U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; }
> : ^^^ ^^^ ^^^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^ ^^^ ^^^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^
>paired : any[]
> : ^^^^^
>reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (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; }
> : ^^^ ^^^ ^^^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^
>(b3, b4) => b3.concat({}) : (b3: any, b4: any) => any
> : ^ ^^^^^^^ ^^^^^^^^^^^^^
>b3 : any
>reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; <U>(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; }
> : ^^^ ^^^ ^^^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^ ^^^ ^^^^^^^ ^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^
>(b3, b4) => b3.concat({}) : (b3: any[], b4: any) => any[]
> : ^ ^^^^^^^^^ ^^^^^^^^^^^^^^^
>b3 : any[]
> : ^^^^^
>b4 : any
>b3.concat({}) : any
>b3.concat : any
>b3 : any
> : ^^^
>concat : any
> : ^^^
>b3.concat({}) : any[]
> : ^^^^^
>b3.concat : { (...items: ConcatArray<any>[]): any[]; (...items: any[]): any[]; }
> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^
>b3 : any[]
> : ^^^^^
>concat : { (...items: ConcatArray<any>[]): any[]; (...items: any[]): any[]; }
> : ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^
>{} : {}
> : ^^
>[] : undefined[]
Expand Down
Loading