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
9,166 changes: 4,583 additions & 4,583 deletions src/lib/es5.d.ts

Large diffs are not rendered by default.

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
18 changes: 9 additions & 9 deletions tests/baselines/reference/destructuringTuple.errors.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
destructuringTuple.ts(11,7): error TS2461: Type 'number' is not an array type.
destructuringTuple.ts(11,8): error TS2493: Tuple type '[]' of length '0' has no element at index '0'.
destructuringTuple.ts(11,48): error TS2769: No overload matches this call.
Overload 1 of 3, '(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number', gave the following error.
Type 'never[]' is not assignable to type 'number'.
Overload 2 of 3, '(callbackfn: (previousValue: [], currentValue: number, currentIndex: number, array: number[]) => [], initialValue: []): []', gave the following error.
Overload 1 of 3, '(callbackfn: (previousValue: [], currentValue: number, currentIndex: number, array: number[]) => [], initialValue: []): []', gave the following error.
Type 'never[]' is not assignable to type '[]'.
Target allows only 0 element(s) but source may have more.
Overload 2 of 3, '(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number', gave the following error.
Type 'never[]' is not assignable to type 'number'.
destructuringTuple.ts(11,60): error TS2769: No overload matches this call.
Overload 1 of 2, '(...items: ConcatArray<never>[]): never[]', gave the following error.
Argument of type 'number' is not assignable to parameter of type 'ConcatArray<never>'.
Expand All @@ -24,15 +24,15 @@ destructuringTuple.ts(11,60): error TS2769: No overload matches this call.
// Repros from #32140

const [oops1] = [1, 2, 3].reduce((accu, el) => accu.concat(el), []);
~~~~~~~
!!! error TS2461: Type 'number' is not an array type.
~~~~~
!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'.
~~~~~~~~~~~~~~~
!!! error TS2769: No overload matches this call.
!!! error TS2769: Overload 1 of 3, '(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number', gave the following error.
!!! error TS2769: Type 'never[]' is not assignable to type 'number'.
!!! error TS2769: Overload 2 of 3, '(callbackfn: (previousValue: [], currentValue: number, currentIndex: number, array: number[]) => [], initialValue: []): []', gave the following error.
!!! error TS2769: Overload 1 of 3, '(callbackfn: (previousValue: [], currentValue: number, currentIndex: number, array: number[]) => [], initialValue: []): []', gave the following error.
!!! error TS2769: Type 'never[]' is not assignable to type '[]'.
!!! error TS2769: Target allows only 0 element(s) but source may have more.
!!! error TS2769: Overload 2 of 3, '(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number', gave the following error.
!!! error TS2769: Type 'never[]' is not assignable to type 'number'.
!!! related TS6502 lib.es5.d.ts:--:--: The expected type comes from the return type of this signature.
!!! related TS6502 lib.es5.d.ts:--:--: The expected type comes from the return type of this signature.
~~
Expand Down
Loading